Jruby on rails setup


#1

If I develop a new rails application with both new ruby and java files,
where
is the ideal place for the java files and the resulting .jar to be
placed in
the rails directory structure?

Also, how do you specify classpath for the resulting jar file under the
rails directory structure?

View this message in context:
http://www.nabble.com/Jruby-on-rails-setup-tp23380696p23380696.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

If I develop a new rails application with both new ruby and
java files, where
is the ideal place for the java files and the resulting .jar
to be placed in
the rails directory structure?

I tend to put jar files into the lib directory - when warbled up, the
jar file will end up in WEB-INF/lib, and hence will be on the classpath.
Note that the app won’t run properly when it’s not war-ed up however,
unless you explicitely add them to the classpath or make a require call
in the ruby code.

This is the correct approach if what you have are java servlets or
context listeners that make calls to your ruby code. If what you have
are ruby libraries with compiled parts, then it’s probably best to have
the jar file elsewhere in the directory structure and explicitely
required from your code - that way there’ll be no difference between
using the code from script\console and script\server to when it’s run
from the war.

I’m not sure how the requiring of a jar file works if that jar is
already on the classpath - does anybody know if that’s a no-op, or does
it reload the classes within the ruby classloader?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

On Mon, May 4, 2009 at 9:20 PM, Daniel S. removed_email_address@domain.invalid
wrote:

in the ruby code.
I agree with this. I’m also working on making an exploded/development
mode easier to use for any Java application server that supports
directory deployment. Currently I think Jetty-Rails is the only
development server that does this.

it reload the classes within the ruby classloader?
Should be a no-op.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email