public
Description: JavaScript in Disguise
Homepage:
Clone URL: git://github.com/jcrosby/snarl.git
snarl /
name age message
file .document Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
file .gitignore Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
file LICENSE Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
file README.rdoc Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
file Rakefile Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
file VERSION Sun Nov 08 17:16:27 -0800 2009 Version bump to 0.1.0 [jcrosby]
directory lib/ Sun Nov 08 17:15:54 -0800 2009 Use jeweler [jcrosby]
directory spec/ Sun Nov 08 11:51:58 -0800 2009 Adjust spec wording [jcrosby]
README.rdoc

Snarl

Snarl is JavaScript in disguise, bridging Ruby and Rhino. JRuby required.

Synopsis

  context = Snarl::JavascriptContext.new
  context.eval("1+1") # => 2

  context.eval("var increment = function(i){ return i+1 };")
  context.eval("increment(3)") # => 4

  context.load("/path/to/js/lib.js") # allows use of lib.js

  context.put("foo", "bar")
  context.get("foo") # => "bar"

Testing

Run "rake"

Copyright

Copyright © 2009 Jon Crosby. See LICENSE for details.