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: “[email protected]” [email protected]
An: [email protected]
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
On Sat, May 24, 2008 at 07:45:00AM +0900, [email protected] 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.
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’