summaryrefslogtreecommitdiff
path: root/test/ruby/envutil.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r--test/ruby/envutil.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 3f0fed3ad5f..186fcae1e64 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -1,10 +1,13 @@
module EnvUtil
def rubybin
- if File.exist? "miniruby" or File.exist? "miniruby.exe"
- "./miniruby"
- else
- "ruby"
+ miniruby = "miniruby"
+ 3.times do
+ if File.exist? miniruby or File.exist? miniruby+".exe"
+ return File.expand_path(miniruby)
+ end
+ miniruby = "../"+miniruby
end
+ "ruby"
end
module_function :rubybin
end