JRuby

Experiments with direct complete-jar-launched utilities

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 0.9.2
  • Fix Version/s: JRuby 0.9.8
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

This ticket is a placeholder for some work on the complete jar to allow extraction of a JRuby environment and direct launching of irb and gem. It features:

  • Extraction of a jruby directory footprint from a jruby-complete.jar. Run one of the following:
    java -jar jruby-complete.jar --command extract  # extracts to ~/.jruby
    java -jar jruby-complete.jar --command extract path/to/new/jruby/home
    

    The first command extracts the directory to a specified location, while the second extracts to jruby.home. Per JRUBY-418, jruby.home defaults to ~/.jruby if not specified as a system property.

  • Run irb directly from the jar.
    java -jar jruby-complete.jar --command irb
    
  • Run Rubygems' gem command directly from the jar. This will also perform an extraction if jruby.home does not exist, so that gem has a directory in which to place installed gems.
    java -jar jruby-complete.jar --command gem install rake
    

Note: this is only available with the maven-built form of jruby-complete.jar at the moment. To build yourself, cd to jruby/maven/jruby-complete.jar and type mvn install.

Issue Links

Activity

Hide
Charles Oliver Nutter added a comment -

I like it a lot, but the command line is rather long. What about:

java -jar jruby-complete.jar -command=extract
java -jar jruby-complete.jar -command=irb
java -jar jruby-complete.jar -command=gem install rake

Or something similar? There could be a set of "known" commands and a way to register new ones (like for gem, rake, rails).

Show
Charles Oliver Nutter added a comment - I like it a lot, but the command line is rather long. What about: java -jar jruby-complete.jar -command=extract java -jar jruby-complete.jar -command=irb java -jar jruby-complete.jar -command=gem install rake Or something similar? There could be a set of "known" commands and a way to register new ones (like for gem, rake, rails).
Hide
Nick Sieger added a comment -

Absolutely. This was just the first pass, to get something working. I got a little nifty with the way the commands were invoked just so they could communicate a little bit of intent.

I like the -command idea quite a bit, and could be easy to implement. Are we ok with the idea of deviating from MRI command-line args? I assume so, as long as we don't override or change the meaning of existing args.

Show
Nick Sieger added a comment - Absolutely. This was just the first pass, to get something working. I got a little nifty with the way the commands were invoked just so they could communicate a little bit of intent. I like the -command idea quite a bit, and could be easy to implement. Are we ok with the idea of deviating from MRI command-line args? I assume so, as long as we don't override or change the meaning of existing args.
Hide
Nick Sieger added a comment -

As of 2715, you can use "--command <script>" to run any script in $JRUBY_HOME/bin. "gem" and "irb/jirb" are also predefined if your jruby home doesn't contain any files yet. "extract" is available too, but will only really work if running from within the jruby-complete.jar.

Show
Nick Sieger added a comment - As of 2715, you can use "--command <script>" to run any script in $JRUBY_HOME/bin. "gem" and "irb/jirb" are also predefined if your jruby home doesn't contain any files yet. "extract" is available too, but will only really work if running from within the jruby-complete.jar.
Hide
Nick Sieger added a comment -

Changed the description to reflect the implementation.

Show
Nick Sieger added a comment - Changed the description to reflect the implementation.
Hide
Aris Bartee added a comment -

I really like playing with the "complete" jar version of jruby, Thanks man.

How do I tell it that my ".jruby" directory is not under my user account. I've set the environment variable JRUBY_HOME to where I'd like to go, but no dice.

Show
Aris Bartee added a comment - I really like playing with the "complete" jar version of jruby, Thanks man. How do I tell it that my ".jruby" directory is not under my user account. I've set the environment variable JRUBY_HOME to where I'd like to go, but no dice.
Hide
Nick Sieger added a comment -

You actually need to user the "jruby.home" system property. Either always pass it on the command line or create a simple script or alias:

java -Djruby.home=/dir/you/use -jar jruby-complete.jar ...
Show
Nick Sieger added a comment - You actually need to user the "jruby.home" system property. Either always pass it on the command line or create a simple script or alias:
java -Djruby.home=/dir/you/use -jar jruby-complete.jar ...

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: