Method: Guard.debug_command_execution
- Defined in:
- lib/guard.rb
.debug_command_execution ⇒ Object
Adds a command logger in debug mode. This wraps common command execution functions and logs the executed command before execution.
448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/guard.rb', line 448 def debug_command_execution Kernel.send(:alias_method, :original_system, :system) Kernel.send(:define_method, :system) do |command, *args| ::Guard::UI.debug "Command execution: #{ command } #{ args.join(' ') }" original_system command, *args end Kernel.send(:alias_method, :original_backtick, :'`') Kernel.send(:define_method, :'`') do |command| ::Guard::UI.debug "Command execution: #{ command }" original_backtick command end end |