Forum: JRuby Jruby on rails setup

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F83c1af30d26eba076ba9883c3d5e60c?d=identicon&s=25 glenanderson (Guest)
on 2009-05-05 06:07
(Received via mailing list)
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-tp23380...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
1c1e3bdfe006a22214102fcd6434a012?d=identicon&s=25 Daniel Sheppard (Guest)
on 2009-05-05 06:22
(Received via mailing list)
> 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
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-05-05 18:10
(Received via mailing list)
On Mon, May 4, 2009 at 9:20 PM, Daniel Sheppard <daniels@pronto.com.au>
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
This topic is locked and can not be replied to.