Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ class JRubyTruffleRunner
debug: ['-d', '--debug', 'JVM remote debugging', assign_new_value, false],
require: ['-r', '--require FILE', 'Files to require, same as Ruby\'s -r', add_to_array, []],
load_path: ['-I', '--load-path LOAD_PATH', 'Paths to add to load path, same as Ruby\'s -I', add_to_array, []],
executable: ['-e', '--executable NAME', 'finds and runs an executable of a gem', assign_new_value, nil],
jexception: ['--jexception', 'print Java exceptions', assign_new_value, false]
},
clean: {
@@ -286,6 +287,12 @@ def subcommand_run(rest)
end
end

executable = if @options[:run][:executable]
executables = Dir.glob("#{@options[:global][:truffle_bundle_path]}/jruby+truffle/*/gems/*/{bin,exe}/*")
executables.find { |path| File.basename(path) == @options[:run][:executable] } or
raise "no executable with name '#{@options[:run][:executable]}' found"
end

core_load_path = "#{jruby_path}/truffle/src/main/ruby"

cmd_options = [
@@ -303,6 +310,7 @@ def subcommand_run(rest)
cmd = [(env unless env.empty?),
@options[:global][:jruby_truffle_path],
*cmd_options,
executable,
*rest
].compact

4 comments on commit 6d62f88

@pitr-ch
Copy link
Member Author

@pitr-ch pitr-ch commented on 6d62f88 Sep 9, 2015

Choose a reason for hiding this comment

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

@eregon
Copy link
Member

@eregon eregon commented on 6d62f88 Sep 11, 2015

Choose a reason for hiding this comment

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

Should it be -S, like the ruby/jruby command does?

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I think -S could be a good idea.

Sorry, something went wrong.

@pitr-ch
Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, the resulting functionality is close enough. In most cases it'll do the same thing (it does not use PATH). Renaming.

Sorry, something went wrong.

Please sign in to comment.