Skip to content

Commit 076a4e2

Browse files
luke-grubereightbitraptor
authored andcommitted
Remove the need to specify the full harness path
Instead -Iharness-name can be used
1 parent af74414 commit 076a4e2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

harness/loader.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# Use harness/harness.rb by default. You can change it with -I option.
22
# i.e. ruby -Iharness benchmarks/railsbench/benchmark.rb
3-
$LOAD_PATH << File.expand_path(__dir__)
4-
require "harness"
3+
retries = 0
4+
begin
5+
require "harness"
6+
rescue LoadError => e
7+
if retries == 0 && e.path == "harness"
8+
retries += 1
9+
$LOAD_PATH << File.expand_path(__dir__)
10+
retry
11+
end
12+
raise
13+
end

0 commit comments

Comments
 (0)