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, #warn
Constructor Details
- (RubyCommand) initialize(desc = nil, &cmd)
Returns a new instance of RubyCommand
167 168 169 170 171 |
# File 'lib/rubu.rb', line 167 def initialize( desc = nil, &cmd ) super() @desc = desc @cmd = cmd end |
Instance Method Details
- (Object) run
Execution content.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/rubu.rb', line 174 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 |