Use JRuby's DripMain plus a better init for booting JRuby. #73
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit changes two things when Drip is used to run JRuby:
DripMain has been available in JRuby since 1.7.0 was released over
a year ago, and does extra prebooting to prepare a JRuby instance
and to optionally load dripmain.rb in the current directory. With
these combined changes, JRuby commands can be reduced from seconds
to tenths of a second, even for complex commands that must boot
frameworks like Raile.
Rather than simple evaluating "nil", we instead use "1 + 1" which
forces more classes to boot and dynamic call mechanisms to fire.
The DRIP_INIT arguments are not used in currently-released
versions of JRuby, but currently-released versions of JRuby use
the "1 + 1" boot by default.
It is my understanding that if org.jruby.main.DripMain is not
present, the default behavior is falling back on Drip's own main,
so at worst this will have no impact on older versions of JRuby
used with Drip. It's also worth pointing out that the old class --
org.jruby.main -- does not exist, so current versions of Drip were
not actually prebooting JRuby at all. The correct class would have
been org.jruby.Main.