mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
support ruby 1.9.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b0d1586fa7
commit
42bb73cf64
1 changed files with 10 additions and 4 deletions
14
tool/vcs.rb
14
tool/vcs.rb
|
@ -91,14 +91,20 @@ else
|
||||||
end
|
end
|
||||||
using DebugPOpen
|
using DebugPOpen
|
||||||
module DebugSystem
|
module DebugSystem
|
||||||
def system(*args, **opts)
|
def system(*args)
|
||||||
STDERR.puts [*args, **opts].inspect if $DEBUG
|
STDERR.puts args.inspect if $DEBUG
|
||||||
|
exception = false
|
||||||
|
opts = Hash.try_convert(args[-1])
|
||||||
if RUBY_VERSION >= "2.6"
|
if RUBY_VERSION >= "2.6"
|
||||||
|
unless opts
|
||||||
|
opts = {}
|
||||||
|
args << opts
|
||||||
|
end
|
||||||
exception = opts.fetch(:exception) {opts[:exception] = true}
|
exception = opts.fetch(:exception) {opts[:exception] = true}
|
||||||
else
|
elsif opts
|
||||||
exception = opts.delete(:exception) {true}
|
exception = opts.delete(:exception) {true}
|
||||||
end
|
end
|
||||||
ret = super(*args, **opts)
|
ret = super(*args)
|
||||||
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
|
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
|
||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue