module HttpdConfigmapGenerator::Base::Command

Public Instance Methods

command_run(executable, options = {}) click to toggle source
# File lib/httpd_configmap_generator/base/command.rb, line 6
def command_run(executable, options = {})
  if opts && opts[:debug]
    debug_msg("Running Command: #{AwesomeSpawn.build_command_line(executable, options)}")
  end
  AwesomeSpawn.run(executable, options)
end
command_run!(executable, options = {}) click to toggle source
# File lib/httpd_configmap_generator/base/command.rb, line 13
def command_run!(executable, options = {})
  if opts && opts[:debug]
    debug_msg("Running Command: #{AwesomeSpawn.build_command_line(executable, options)}")
  end
  AwesomeSpawn.run!(executable, options)
end
log_command_error(err) click to toggle source
# File lib/httpd_configmap_generator/base/command.rb, line 20
def log_command_error(err)
  err_msg("Command Error: #{err}")
  if err.kind_of?(AwesomeSpawn::CommandResultError)
    err_msg("stdout: #{err.result.output}")
    err_msg("stderr: #{err.result.error}")
  else
    err_msg(err.backtrace)
  end
end