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