Class: SystemRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/adx_toolkit/system_runner.rb

Overview

Class that responsible for running bash script

Instance Method Summary collapse

Instance Method Details

#run(command) ⇒ Object



7
8
9
10
# File 'lib/adx_toolkit/system_runner.rb', line 7

def run(command)
  p "Running => #{command.chomp}"
  system(command) || raise("Error running #{command}")
end

#run_with_output(command) ⇒ Object



12
13
14
15
16
# File 'lib/adx_toolkit/system_runner.rb', line 12

def run_with_output(command)
  # p "Running => #{command.chomp}"
  output = `#{command} 2>&1` || raise("Error running #{command}")
  output.chomp
end