Module: HttpdConfigmapGenerator::Base::Command
- Included in:
- HttpdConfigmapGenerator::Base
- Defined in:
- lib/httpd_configmap_generator/base/command.rb
Instance Method Summary collapse
- #command_run(executable, options = {}) ⇒ Object
- #command_run!(executable, options = {}) ⇒ Object
- #log_command_error(err) ⇒ Object
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, = {}) if opts && opts[:debug] debug_msg("Running Command: #{AwesomeSpawn.build_command_line(executable, )}") end AwesomeSpawn.run(executable, ) 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, = {}) if opts && opts[:debug] debug_msg("Running Command: #{AwesomeSpawn.build_command_line(executable, )}") end AwesomeSpawn.run!(executable, ) 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 |