I tried the current gem and it doesn't seem to have the stuff below.
Basically, inside the gem bin/glassfish_rails.rb needs to be the first
section of code below and lib/glassfish.rb needs to be the second
section of code. This will allow glassfish_rails to install with gem's
executable wrappers and also to be loaded as a library if someone wants
to start up glassfish from another app.
We should probably figure out how this would be named and versioned as
well...10.0 is likely to be pretty confusing for some folks, and the gem
itself should probably be named "glassfish_rails-<version>-java" or -jruby.
- Charlie
Charles Oliver Nutter wrote:
> - The startup script should be a normal Ruby script rather than a shell
> script; then we do all the hassle of locating JRuby and Java for you, as
> well as processing normal JRuby command-line logic. Here's the script I
> came up with:
>
> bin/glassfish_rails:
>
> <CODE>
> #!/usr/bin/env jruby
> require 'java'
> require 'rubygems'
> require 'glassfish'
>
> GlassFish.startup(ARGV)
> </CODE>
>
> And inside the gem under lib, glassfish.rb:
>
> <CODE>
> require 'glassfish-10.0-SNAPSHOT.jar'
>
> module GlassFish
> import com.sun.enterprise.glassfish.bootstrap.Main
> def startup(args)
> Main.main(args.to_java(:string))
> end
>
> module_function :startup
> end
> </CODE>