Executing javascript from Ruby

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.

-------- Original-Nachricht --------

Datum: Sat, 24 May 2008 07:45:00 +0900
Von: "bcparanj@gmail.com" <bcparanj@gmail.com>
An: ruby-talk@ruby-lang.org
Betreff: Executing javascript from Ruby

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.

Hi ---

do you want to open the URL in Ruby ?
There are many possibilities: look eg. here:

http://www.juretta.com/log/2006/08/13/ruby_net_http_and_open-uri/

Best regards,

Axel

···

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

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. :slight_smile:

  GitHub - jbarnette/johnson: Johnson wraps JavaScript in a loving Ruby embrace.

Example:

  context = Johnson::Context.new
  context.evaluate("function foo() { return 'hello world'; }")
  context.evaluate("foo()") # => 'hello world'

···

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.

--
Aaron Patterson
http://tenderlovemaking.com/