Class: Processing::Launcher
- Inherits:
-
Object
- Object
- Processing::Launcher
- Defined in:
- lib/jruby_art/launcher.rb
Overview
The command class check for configuration and options, before creating and executing the jruby (or java) command to run the sketch
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
-
#cmd(root) ⇒ Object
Trade in this Ruby instance for a JRuby instance, loading in a starter script and passing it some arguments.
-
#initialize(runner:, args:, filename:) ⇒ Launcher
constructor
A new instance of Launcher.
Constructor Details
#initialize(runner:, args:, filename:) ⇒ Launcher
Returns a new instance of Launcher.
9 10 11 12 13 |
# File 'lib/jruby_art/launcher.rb', line 9 def initialize(runner:, args:, filename:) @runner = runner @args = args @filename = filename end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/jruby_art/launcher.rb', line 8 def args @args end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
8 9 10 |
# File 'lib/jruby_art/launcher.rb', line 8 def filename @filename end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
8 9 10 |
# File 'lib/jruby_art/launcher.rb', line 8 def runner @runner end |
Instance Method Details
#cmd(root) ⇒ Object
Trade in this Ruby instance for a JRuby instance, loading in a starter script and passing it some arguments. Unless you set JRUBY: false in ~/.jruby_art/config.yml, an installed version of jruby is used instead of our vendored one. Note the use of jruby-complete might make using other gems in your sketches hard (but not impossible).…
20 21 22 23 24 25 26 27 |
# File 'lib/jruby_art/launcher.rb', line 20 def cmd(root) cmda = jruby_command(root) begin exec(*cmda) # exec replaces the Ruby process with the JRuby one. rescue Java::JavaLang::ClassNotFoundException end end |