On Thu, Jan 14, 2010 at 8:09 PM, Kevin S. Lim [email protected] wrote:
Would it be possible to get to the rails environment then?
This brings me another question actually.
While back, when I tried this, the second jruby runtime was created by
runtime = Ruby.newInstance(); // because getCurrentInstance() is deprecated?
And I had thought that this new runtime instance is different than the original jruby runtime which started rails.
From the java code(third one on above sequences), can I get the original jruby runtime or rails environments?
Ah, I honestly understood what you wanted to do, now.
Yes. Currently, Ruby runtime isn’t a static, so you’ll get another
runtime instance. This happens even though you use
We had a discussion recently about a static Ruby runtime,
When we have this new runtime, JRuby Embed as well as JSR223 impl will
be able to return the same instance as the original runtime.
But, we don’t have such kind of runtime right now, so you probably
need a trick. For example, using Java’s system property:
in a code on rails:
in another code:
This is just an example, so you have other couple of options, I think.
Here is how my objects are instantiated. (jruby -> rails -> java ->
but org.jruby.Ruby.getCurrentInstance() returns null.
Sort of. ScriptEngine doesn’t expose Ruby runtime rather than it
To unsubscribe from this list, please visit: