jruby 1.7.23 (1.9.3p551) 2015-11-24 f496dd5 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_79-b15 +jit [Windows 7-amd64]
I run a scriptlet in my scripting container like this:
(RubyObject) ro = (RubyObject)container.runScriptlet(org.jruby.embed.PathType.RELATIVE,"example.rb");
where container
is of type ScriptingContainer. The "local variable behaviour" is set to "transient".
The file example.rb contains the following lines:
foo='xxx'
$bar='yyy'
'zzz'
I can retrieve from the Java side the value 'zzz', because it is explicitly returned from runScriptlet. I can also retrieve the value of $bar using
container.get("$bar")
Is there a way to retrieve the value of foo? container.get("foo")
returns the null pointer.
I also tried to change the local variable behaviour to "persistent", but still same result.