Module: FS::Alias

Included in:
FS
Defined in:
lib/fs/alias.rb

Constant Summary collapse

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,
  :chop    => :chop_path,
  :[]      => :join,
}

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


22
23
24
25
26
27
28
# File 'lib/fs/alias.rb', line 22

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