Class: Yacli::Run

Inherits:
Base
  • Object
show all
Defined in:
lib/yacli/run.rb

Instance Method Summary collapse

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