Module: IPScriptables::Helpers

Extended by:
Forwardable
Included in:
Ruleset
Defined in:
lib/ipscriptables/helpers.rb

Class Method Summary collapse

Class Method Details

.ohaiObject



22
23
24
# File 'lib/ipscriptables/helpers.rb', line 22

def ohai
  @ohai ||= setup_ohai
end

.run_command(*argv) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/ipscriptables/helpers.rb', line 12

def run_command(*argv)
  status, stdout, stderr = systemu(argv)
  unless status.success?
    $stderr.puts stdout.gsub(/^/, "#{argv.first}: ") unless stdout.empty?
    fail "#{status}: #{stderr}"
  end
  $stderr.puts stderr.gsub(/^/, "#{argv.first}: ") unless stderr.empty?
  stdout
end