Class: Watchdog::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/watchdog/utils.rb

Class Method Summary collapse

Class Method Details

.run_cmd(cmd) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/watchdog/utils.rb', line 5

def self.run_cmd(cmd)
  if $watchdog_relative_dir
    Dir.chdir($watchdog_relative_dir){
      # %x[ #{cmd} ]
      out, err, _sts = Open3.capture3(cmd)
      return out, err
    }
  else
    out, err, _sts = Open3.capture3(cmd)
    return out, err
  end
end