Skip to content

Commit

Permalink
Fix Benchmarking.
Browse files Browse the repository at this point in the history
  • Loading branch information
envygeeks committed Oct 30, 2018
1 parent 4ec47fd commit 372ef53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions benchmark/support/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(name)
def setup_task
Rake::Task.define_task(@name) do
$stdout.puts "Running benchmark files in benchmark/*.rb", ""
Dir[File.join(File.expand_path("benchmark"), "*.rb")].each do |file|
Dir[File.expand_path(File.join(__dir__, "../*.rb"))].each do |file|
run file
end

Expand Down Expand Up @@ -58,7 +58,9 @@ def print_faster

private
def run(file)
_, err, = command ENV["BUNDLE_BIN_PATH"], "exec", "ruby", file
bundler = ENV.key?("BUNDLE_BIN_PATH")
_, err, = command "ruby", file unless bundler
_, err, = command ENV["BUNDLE_BIN_PATH"], "exec", "ruby", file if bundler
abort err unless err.empty?

json = JSON.load(File.read("benchmark.json"))
Expand Down

0 comments on commit 372ef53

Please sign in to comment.