|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I need to execute a javascript from Ruby. The result of the javascript
is a URL. I could not find anything that bridge the gap between javascript and Ruby. Does anyone know if there is something that I can use for this problem? TIA. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
-------- 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 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/1..._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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 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/ |
|
![]() |
| Outils de la discussion | |
|
|