Adding .rb file into java application

Hello!
I just finished my ruby script and inside i have a variable of the type
integer and i am setting this integer to a value that i now whant to put
in a variable that is not in the script its outside the script in the
normal java code, So basicaly i whant to get the value from the variable
inside the script and add that to my variable in the java code,

Anyone know how i can do it?

Hi,

here’s a example:

Java side:
public ScriptingContainer container = new ScriptingContainer();
String java = “java side”;
container.put( “javastring”, java);

On ruby-side then you can use it then like a normal variable:
"javastring => “java side”
javastring.reverse!

in Java it ends then in:
" java => “edis avaj”

kind regards
Peter

2011/7/28 Oskar M. [email protected]