Skip to content

Commit 69f4205

Browse files
committed
Use backtrick instead of custom helper to get the result of system calls
1 parent a2a9703 commit 69f4205

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

run_benchmarks.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
require_relative 'lib/table_formatter'
1616
require_relative 'lib/benchmark_filter'
1717

18-
def check_output(*command)
19-
IO.popen(*command, &:read)
20-
end
21-
2218
def have_yjit?(ruby)
23-
ruby_version = check_output("#{ruby} -v --yjit", err: File::NULL).strip
19+
ruby_version = `#{ruby} -v --yjit 2> #{File::NULL}`.strip
2420
ruby_version.downcase.include?("yjit")
2521
end
2622

@@ -381,7 +377,7 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
381377

382378
ruby_descriptions = {}
383379
args.executables.each do |name, executable|
384-
ruby_descriptions[name] = check_output([*executable, "-v"]).chomp
380+
ruby_descriptions[name] = `#{executable.shelljoin} -v`.chomp
385381
end
386382

387383
# Benchmark with and without YJIT

0 commit comments

Comments
 (0)