Module: CreateGithubRelease::BacktickDebug
- Included in:
- AssertionBase, Project, TaskBase
- Defined in:
- lib/create_github_release/backtick_debug.rb
Overview
Include this module to output debug information for backticks
The class this module is included in must have a backtick_debug?
method.
Instance Method Summary collapse
-
#`(command) ⇒ String
Calls
super
and shows the command and its result ifbacktick_debug?
is true.
Instance Method Details
#`(command) ⇒ String
Calls super
and shows the command and its result if backtick_debug?
is true
The command, it's output, and it's exit status are output to stdout via puts
.
The including class is expected to have a backtick_debug?
method.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/create_github_release/backtick_debug.rb', line 58 def `(command) puts "COMMAND\n #{command}" if backtick_debug? super.tap do |output| if backtick_debug? puts "OUTPUT\n" output.lines { |l| puts " #{l.chomp}" } puts "EXITSTATUS\n #{$CHILD_STATUS.exitstatus}\n" end end end |