From: Aaron Patterson Date: 2008-05-27T03:13:24+09:00 Subject: Re: Executing javascript from Ruby On Sat, May 24, 2008 at 07:45:00AM +0900, bcparanj@gmail.com wrote: > I need to execute a javascript from Ruby. The result of the javascript > is a URL. I could not find anything that help bridge the gap between > javascript and Ruby. Does anyone know if there is something that I can > use for this problem? TIA. Yes.... Johnson bridges Ruby to JavaScript. We haven't released a gem yet, but you can check it out from github now. Its pretty stable, and we only have 1 bug blocking our release. :-) http://github.com/jbarnette/johnson/tree/master Example: context = Johnson::Context.new context.evaluate("function foo() { return 'hello world'; }") context.evaluate("foo()") # => 'hello world' -- Aaron Patterson http://tenderlovemaking.com/