Skip to content

Commit 9c85a94

Browse files
committed
vcs.rb: Drop support for ruby older than 2.6
1 parent 6094cb5 commit 9c85a94

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

tool/lib/vcs.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,9 @@ def popen(*args)
5151
end
5252
using DebugPOpen
5353
module DebugSystem
54-
def system(*args)
54+
def system(*args, exception: true, **opts)
5555
VCS.dump(args, "args: ") if $DEBUG
56-
exception = false
57-
opts = Hash.try_convert(args[-1])
58-
if RUBY_VERSION >= "2.6"
59-
unless opts
60-
opts = {}
61-
args << opts
62-
end
63-
exception = opts.fetch(:exception) {opts[:exception] = true}
64-
elsif opts
65-
exception = opts.delete(:exception) {true}
66-
args.pop if opts.empty?
67-
end
68-
ret = super(*args)
69-
raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
70-
ret
56+
super(*args, exception: exception, **opts)
7157
end
7258
end
7359

0 commit comments

Comments
 (0)