I have a version of env.js ported to johnson(ruby gem, based on
tracemonkey) working, passing the env.js tests, and a slighty higher
number of jquery tests than rhino.
I don't know what stage you would call it. POC/alpha/.... It runs the
tests and seems reasonably stable, but it's not integrated with the
java version yet. The multi-window support has to be reconciled
between the two and the mutli-platform stuff cleaned up a little now
that we actually have multiple platforms.
It's in my repo at git://github.com/smparkes/env-js.git, on the
envjsrb branch (not the default). It requires my copy of johnson
(tracemonkey port), which will get pulled in if you do a "git
submodule update --init". Then all you have to do is a rake in vendor/
johnson and then a rake at the root of the repo.
Alternately, you can just do a "gem install smparkes.envjs" (you'll
need to add gemcutter if you haven't yet). That will install both
envjs and johnson (my version, smparkes.johnson). It takes a while to
install Johnson because it includes all of tracemonkey (and, actually,
the older spidermonkey).
After that you can do things like:
smparkes@barronpark ~/env.js $ envjsrb
INFO: [Tue Oct 27 2009 18:33:54 GMT-0700 (PST)] {ENVJS} Initializing
Core Platform Env
js> window.location = "test/index.html"
INFO: [Tue Oct 27 2009 18:34:16 GMT-0700 (PST)] {ENVJS} adding value
to history: file:///home/barronpark/smparkes/env.js/test/index.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Initializing
Core Platform Env
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} adding value
to history: file:///home/barronpark/smparkes/env.js/test/html/iframe1.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Sucessfully
loaded document at file:///home/barronpark/smparkes/env.js/test/html/iframe1.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Initializing
Core Platform Env
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} adding value
to history: file:///home/barronpark/smparkes/env.js/test/html/events.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Sucessfully
loaded document at file:///home/barronpark/smparkes/env.js/test/html/events.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Initializing
Core Platform Env
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} adding value
to history: file:///home/barronpark/smparkes/env.js/test/html/scope.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Sucessfully
loaded document at file:///home/barronpark/smparkes/env.js/test/html/scope.html
INFO: [Tue Oct 27 2009 18:34:17 GMT-0700 (PST)] {ENVJS} Sucessfully
loaded document at file:///home/barronpark/smparkes/env.js/test/index.html
=> "test/index.html"
js> rb
rb> window = js["this"]
=> [object Window 0]
rb> window.document.title
=> "jQuery Test Suite"
js> prompts are javascript; rb> prompts are ruby.
I wanted to show "window.frames.map(&:document).map(&:title)" but we
don't implement frames() yet ...