Created
February 24, 2010 23:49
-
-
Save headius/314044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/projects/jruby ➔ cat remote_rhino.rb | |
require 'java' | |
$CLASSPATH << 'http://mirrors.ibiblio.org/pub/mirrors/maven2/rhino/js/1.7R2/js-1.7R2.jar' | |
ctx = org.mozilla.javascript.Context.enter | |
scope = ctx.init_standard_objects nil | |
result = ctx.evaluate_string scope, 'function f(x){return x+1} f(7)', 'x', 1, nil | |
puts result | |
~/projects/jruby ➔ jruby remote_rhino.rb | |
8.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment