mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vcs.rb: debug print in system method
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c30aed0817
commit
e168963d8a
1 changed files with 8 additions and 0 deletions
|
@ -86,6 +86,14 @@ else
|
|||
super
|
||||
end
|
||||
end
|
||||
refine Kernel do
|
||||
def system(*args, exception: true, **opts)
|
||||
STDERR.puts [*args, **opts].inspect if $DEBUG
|
||||
ret = super(*args, **opts, exception: exception)
|
||||
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
|
||||
ret
|
||||
end
|
||||
end
|
||||
ensure
|
||||
$VERBOSE = verbose unless verbose.nil?
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue