You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Venkata Krishnan <fo...@gmail.com> on 2007/05/03 10:16:22 UTC

JRubyScriptEngine in Tuscany ScriptImpl

Hi Ant,

I guess the JRubyScriptEngine in the BSF distribution has some problem
dealing with 'global variables' since the other three engines - JavaScript,
Groovy and Jython work clean.

I pulled down the source for JRubyScriptEngine from
https://scripting.dev.java.net/source/browse/*checkout*/scripting/engines/jruby/src/com/sun/script/jruby/JRubyScriptEngine.java?rev=1.7and
hacked a bit with it to get this going.

So here is what I suggest we can do : -
- make a copy of the JRubyScriptEngine code locally within the script-impl
module with the hacks to get it going for us.
- in the ScriptComponent.createInstance method, if the script extn. is 'rb'
we will instantiate this local copy of the JRubyScriptEngine otherwise
delegate it to the ScriptManager to get the engine for the extn. as it is
being done presently.  I also explored a bit about registering this local
copy of the engine with the ScriptManager but there are somethings that make
it a little complicated.  So decided to go with this simpler option which is
anyways a temporary fix till we find a solution.

Please let me know your thoughts about this.  I hope there is not going to
be any licensing issues with this copying over of the engine code.

Thanks

- Venkat

Re: JRubyScriptEngine in Tuscany ScriptImpl

Posted by ant elder <an...@gmail.com>.
Sounds ok to me, we'll also have to make sure before we cut a release that
the src distribution and implementation-script jar have the LICENSE and
NOTICE file updated for the Sun copyright and BSD license.

   ...ant

On 5/3/07, Venkata Krishnan <fo...@gmail.com> wrote:
>
> Hi Ant,
>
> I guess the JRubyScriptEngine in the BSF distribution has some problem
> dealing with 'global variables' since the other three engines -
> JavaScript,
> Groovy and Jython work clean.
>
> I pulled down the source for JRubyScriptEngine from
>
> https://scripting.dev.java.net/source/browse/*checkout*/scripting/engines/jruby/src/com/sun/script/jruby/JRubyScriptEngine.java?rev=1.7and
> hacked a bit with it to get this going.
>
> So here is what I suggest we can do : -
> - make a copy of the JRubyScriptEngine code locally within the script-impl
> module with the hacks to get it going for us.
> - in the ScriptComponent.createInstance method, if the script extn. is
> 'rb'
> we will instantiate this local copy of the JRubyScriptEngine otherwise
> delegate it to the ScriptManager to get the engine for the extn. as it is
> being done presently.  I also explored a bit about registering this local
> copy of the engine with the ScriptManager but there are somethings that
> make
> it a little complicated.  So decided to go with this simpler option which
> is
> anyways a temporary fix till we find a solution.
>
> Please let me know your thoughts about this.  I hope there is not going to
> be any licensing issues with this copying over of the engine code.
>
> Thanks
>
> - Venkat
>