Sha256: 1be7dccaccd5f238575de79eb5863546384fb6ab5448322e22a9cf386eb9ac1f

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

module FS
  module Alias
    ALIASES = {
      :ls      => :list,
      :mkdir   => :makedir,
      :mkdir_p => :makedirs,
      :rmdir   => :removedir,
      :rm_r    => :removedirs,
      :cd      => :changedir,
      :pwd     => :currentdir,
      :mv      => :move,
      :cp      => :copy,
      :rm      => :remove,
      :cat     => :read,
      :ln      => :link,
      :dir?    => :directory?,
      :expand  => :expand_path,
      :[]      => :join,
    }

    def self.included(base)
      base.class_eval do
        ALIASES.each do |shortcut, original|
          alias_method shortcut, original
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fs-0.1.2 lib/fs/alias.rb