diff options
Diffstat (limited to 'bin/with_rubygems')
-rwxr-xr-x | bin/with_rubygems | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/with_rubygems b/bin/with_rubygems index 666467b1e5..d16c289822 100755 --- a/bin/with_rubygems +++ b/bin/with_rubygems @@ -19,8 +19,12 @@ Dir.chdir(rubygems_path) do run("git", "checkout", version, "--quiet") end if version -ENV["RUBYOPT"] = %(-I#{rubygems_path + "lib"} #{ENV["RUBYOPT"]}) -if cmd = ARGV.first +rubygems_lib = rubygems_path + "lib" +ENV["RUBYOPT"] = %(-I#{rubygems_lib} #{ENV["RUBYOPT"]}) + +if $0 != __FILE__ + ARGV.unshift($0) +elsif cmd = ARGV.first possible_dirs = [ Pathname.new(__FILE__) + "..", Pathname.new(__FILE__) + "../../exe", @@ -32,4 +36,4 @@ if cmd = ARGV.first ARGV[0] = cmd.to_s if cmd end -exec(*ARGV) if $0 == __FILE__ +exec(*ARGV) |