Skip to content

Commit 52287c6

Browse files
committed
Set Ruby parser if the given ruby accepts --parser
Now envutil.rb is a part of test-unit-ruby-core gem, which still supports old versions, 2.3 or later.
1 parent 5b2ec0e commit 52287c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tool/lib/envutil.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
225225

226226
args = [args] if args.kind_of?(String)
227227
# use the same parser as current ruby
228-
if args.none? { |arg| arg.start_with?("--parser=") }
228+
if (args.none? { |arg| arg.start_with?("--parser=") } and
229+
/^ +--parser=/ =~ IO.popen([rubybin, "--help"], &:read))
229230
args = ["--parser=#{current_parser}"] + args
230231
end
231232
pid = spawn(child_env, *precommand, rubybin, *args, opt)

0 commit comments

Comments
 (0)