2003-10-04 22:56:42 -04:00
|
|
|
module EnvUtil
|
|
|
|
def rubybin
|
2004-05-19 10:45:49 -04:00
|
|
|
if ruby = ENV["RUBY"]
|
|
|
|
return ruby
|
|
|
|
end
|
2003-10-13 09:05:24 -04:00
|
|
|
miniruby = "miniruby"
|
|
|
|
3.times do
|
|
|
|
if File.exist? miniruby or File.exist? miniruby+".exe"
|
|
|
|
return File.expand_path(miniruby)
|
|
|
|
end
|
2003-10-13 10:59:25 -04:00
|
|
|
miniruby = File.join("..", miniruby)
|
|
|
|
end
|
|
|
|
begin
|
|
|
|
require "rbconfig"
|
|
|
|
File.join(
|
|
|
|
Config::CONFIG["bindir"],
|
|
|
|
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
|
|
|
|
)
|
|
|
|
rescue LoadError
|
|
|
|
"ruby"
|
2003-10-04 22:56:42 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
module_function :rubybin
|
|
|
|
end
|