Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -152,12 +152,12 @@ def self.find_ruby
end

def self.find_jruby
if mx?
if ENV['RUBY_BIN']
ENV['RUBY_BIN']
elsif mx?
"#{JRUBY_DIR}/tool/jruby_mx"
elsif jruby_eclipse?
"#{JRUBY_DIR}/tool/jruby_eclipse"
elsif ENV['RUBY_BIN']
ENV['RUBY_BIN']
else
"#{JRUBY_DIR}/bin/jruby"
end
@@ -169,7 +169,9 @@ def self.find_jruby_bin_dir
FileUtils.rm_f ruby_symlink
File.symlink Utilities.find_jruby, ruby_symlink

if jruby_eclipse? or mx?
if ENV['RUBY_BIN']
File.dirname(ENV['RUBY_BIN'])
elsif jruby_eclipse? or mx?
JRUBY_DIR + "/bin"
else
File.dirname(find_jruby)

2 comments on commit 0657bbd

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eregon RUBY_BIN is used to allow us to test an external binary, such as the GraalVM ruby command, potentially from a distribution binary tarball. So it needs to take priority over other ways of running Ruby.

@eregon
Copy link
Member

@eregon eregon commented on 0657bbd Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, looks fine.
Maybe File.expand_path the environment variable if you intend to pass it a relative path.

Please sign in to comment.