Class: Yacli::Run
Instance Method Summary collapse
- #go(cmd = 'uname -a') ⇒ Object
-
#initialize(opt = {}) ⇒ Run
constructor
A new instance of Run.
Methods inherited from Base
#cli, #error_exit, #init_logger, #init_opt, #log, options, #pass_cli
Constructor Details
#initialize(opt = {}) ⇒ Run
Returns a new instance of Run.
7 8 9 10 11 |
# File 'lib/yacli/run.rb', line 7 def initialize(opt = {}) log_path = !opt['log-path'].nil? ? opt['log-path'] : nil @log = init_logger(log_path) @log.debug "opt: #{opt.inspect}" end |
Instance Method Details
#go(cmd = 'uname -a') ⇒ Object
13 14 15 16 17 18 |
# File 'lib/yacli/run.rb', line 13 def go(cmd = 'uname -a') @log.debug "cmd: #{cmd}" output = pass_cli cmd @log.info "output: #{output}" output end |