Asiri,

On Tue, Jun 2, 2009 at 4:00 AM, Asiri Rathnayake
<[email protected]> wrote:
> Hi Devs,
>
> I tried the following code snippet with two versions of JRuby:
>
> <code>
>
> ScriptEngineManager manager = new ScriptEngineManager();
> ScriptEngine engine = manager.getEngineByName("jruby");
> engine.put("who", "Asiri");
> engine.eval("puts \"Hello #{$who}!\"");
>
> </code>
>
> With 1.2.0 above code snippet works fine and prints "Hello Asiri!". But with
> 1.3.0RC2 the output is "Hello !"
>
> Am I doing something wrong? or is it a bug?

I got the same result, so you are doing in a right way. Sharing global
varables worked on the version I got from git on May 14. After that,
JRuby's internal API must have been changed and affects on above
result.

JSR 223 JRuby engine overrides
org.jruby.internal.runtime.GlobalVariables and save global variables
in its attribute map to revert GlobalVariables to the original
condition. As far as I tracked variables down, the instance of
GlobalVariables that JRuby engine has is not used while evaluating.
However, I haven't figured out how to fix this. Does someone know what
changes were made related to GlobalVariables?

-Yoko

>
> Thanks.
>
> - Asiri
>

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

    http://xircles.codehaus.org/manage_email


Reply via email to