class Rush::EmbeddableShell
This is a class that can be embedded in other applications rake tasks, utility scripts, etc
Delegates unknown method calls to a Rush::Shell
instance
Attributes
shell[RW]
Public Class Methods
new(suppress_output = true)
click to toggle source
# File lib/rush/embeddable_shell.rb, line 10 def initialize(suppress_output = true) self.shell = Rush::Shell.new shell.suppress_output = suppress_output end
Public Instance Methods
execute_in_shell(&block)
click to toggle source
take a whole block and execute it as if it were inside a shell
# File lib/rush/embeddable_shell.rb, line 22 def execute_in_shell(&block) self.instance_eval(&block) end
method_missing(sym, *args, &block)
click to toggle source
evalutes and unkown method call agains the rush shell
# File lib/rush/embeddable_shell.rb, line 16 def method_missing(sym, *args, &block) shell.execute sym.to_s $last_res end