Class: Rubu::RubyCommand
Overview
Ruby based command.
Instance Attribute Summary
Attributes inherited from Move
#errmsg, #output, #status, #subs
Instance Method Summary (collapse)
-
- (RubyCommand) initialize(desc = nil, &cmd)
constructor
A new instance of RubyCommand.
-
- (Object) run
Execution content.
Methods inherited from Move
#display, #error, #host, #host_in, #host_out, #use
Constructor Details
- (RubyCommand) initialize(desc = nil, &cmd)
Returns a new instance of RubyCommand
158 159 160 161 162 |
# File 'lib/rubu.rb', line 158 def initialize( desc = nil, &cmd ) super() @desc = desc @cmd = cmd end |
Instance Method Details
- (Object) run
Execution content.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/rubu.rb', line 165 def run begin ret = instance_eval( &@cmd ) @status = :success if @desc && Order[ :verbose ] STDOUT.puts @desc end rescue => f @status = :error error( f.backtrace.join("\n") ) end self end |