Top Level Namespace

Defined Under Namespace

Modules: Rubysh

Instance Method Summary collapse

Instance Method Details

#AliasRubysh(name) ⇒ Object



73
74
75
76
77
# File 'lib/rubysh.rb', line 73

def AliasRubysh(name)
  metaclass = class << self; self; end
  metaclass.send(:alias_method, name, :Rubysh)
  Object.const_set(name, Rubysh)
end

#Rubysh(*args, &blk) ⇒ Object

You can then create a new Rubysh command:

command = Rubysh('ls')
command.run


69
70
71
# File 'lib/rubysh.rb', line 69

def Rubysh(*args, &blk)
  Rubysh::Command.new(args, &blk)
end