Top Level Namespace
Defined Under Namespace
Modules: Rubysh
Instance Method Summary collapse
- #AliasRubysh(name) ⇒ Object
-
#Rubysh(*args, &blk) ⇒ Object
Either create a new Rubysh command:.
Instance Method Details
#AliasRubysh(name) ⇒ Object
84 85 86 87 88 |
# File 'lib/rubysh.rb', line 84 def AliasRubysh(name) = class << self; self; end .send(:alias_method, name, :Rubysh) Object.const_set(name, Rubysh) end |
#Rubysh(*args, &blk) ⇒ Object
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rubysh.rb', line 73 def Rubysh(*args, &blk) if blk raise Rubysh::Error::BaseError.new("Can't provide arguments and a block") if args.length > 0 command = blk.call command = Rubysh::Command.new(command) unless command.kind_of?(Rubysh::Command) command.run else Rubysh::Command.new(args) end end |