Module: HttpdConfigmapGenerator::Base::Command

Included in:
HttpdConfigmapGenerator::Base
Defined in:
lib/httpd_configmap_generator/base/command.rb

Instance Method Summary collapse

Instance Method Details

#command_run(executable, options = {}) ⇒ Object



6
7
8
9
10
11
# 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 = {}) ⇒ Object



13
14
15
16
17
18
# 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) ⇒ Object



20
21
22
23
24
25
26
27
28
# 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