summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-30 07:34:06 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-30 07:34:06 +0000
commit42bb73cf64bc4a122b80eb2262f5b9c47381a024 (patch)
tree4a5bf68d49aa05c489839281f771fc2dd5cec17a /tool
parentb0d1586fa79ff9123db07daf838aee67bc452cf5 (diff)
support ruby 1.9.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/vcs.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 7e06f3dbcc..022783acac 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -91,14 +91,20 @@ else
end
using DebugPOpen
module DebugSystem
- def system(*args, **opts)
- STDERR.puts [*args, **opts].inspect if $DEBUG
+ def system(*args)
+ STDERR.puts args.inspect if $DEBUG
+ exception = false
+ opts = Hash.try_convert(args[-1])
if RUBY_VERSION >= "2.6"
+ unless opts
+ opts = {}
+ args << opts
+ end
exception = opts.fetch(:exception) {opts[:exception] = true}
- else
+ elsif opts
exception = opts.delete(:exception) {true}
end
- ret = super(*args, **opts)
+ ret = super(*args)
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
ret
end