= JSRuby = JSRuby is a Ruby interpreter impremented in !JavaScript. Requires: IE6, Firefox2, Opera9, Safari3, !SpiderMonkey, Rhino - JSRuby release (download) - 0.1.1 : http://svn.coderepos.org/share/lang/javascript/jsruby/release/jsruby-0.1.1.js - 0.1 : http://svn.coderepos.org/share/lang/javascript/jsruby/release/jsruby-0.1.js - JSRuby Test Page - http://labs.cybozu.co.jp/blog/nakatani/jsruby/jsruby_test.html == JSRuby Latest Version (For Developers) == - SVN repository (trunk) - http://svn.coderepos.org/share/lang/javascript/jsruby/trunk/ {{{ svn co http://svn.coderepos.org/share/lang/javascript/jsruby/trunk/ }}} "./trunk/check.html" is a simple check form of JSRuby. You can get a parse tree of ruby script and execute it. You can also try jsirb(interactive JSRuby). For making the release package, you execute "make.sh". {{{ cd ./trunk bash ./make.sh }}} "jsruby.js" will be generated on "./dist/" . == Functional Test == In JSRuby's functional test, you use !JsUnit. - !JsUnit : http://www.jsunit.net/ - download : https://sourceforge.net/project/showfiles.php?group_id=28041 You get "jsunit2.2alpha11.zip" and extract all from it at "./trunk/", so "./jsunit/" directory will be made. {{{ cd ./trunk unzip jsunit2.2alpha11.zip }}} Open "./jsunit/testRunner.html" by a web browser. e.g. if you extract on c:/jsruby/trunk/ file:///c:/jsruby/trunk/jsunit/testRunner.html?testPage=c:/jsruby/trunk/testsuite.html&autoRun=true == Sample Code == Simplely execute a Ruby code. {{{ var ruby = new RubyEngine.Interpreter(); ruby.exec(" (1..10).each{ |x| puts x*x } "); alert(ruby.stdout); }}} Invoke a user defined Ruby method from Javascript. {{{ }}} Use jQuery in JSRuby. {{{ }}} == Supported Features (JSRuby 0.1) == - if ~ elsif ~ else ~ end - def - puts, p - Array#<< - Array#[], []= - Array#each - Array#inject - Array#join - Array#length - Array#member? - Array#new - Array#push - Array#reverse - Numeric#+, -, *, /, %, **, ==, <=> - Numeric#chr - Numeric#to_s - Numeric#upto - String#+, *, == - String#[], []= - String#center - String#length - String#reverse - String#to_i - Range#each - Extensional: - Handling Javascript object - $window, $document - Calling user defined Ruby method from Javascript == See Also == - http://labs.cybozu.co.jp/blog/nakatani/2008/01/javascript_ruby_jsruby_01.html ( Japanese ) - http://labs.cybozu.co.jp/blog/nakatani/2007/11/jsirb_javascript_ruby.html ( Japanese ) - http://labs.cybozu.co.jp/blog/nakatani/2007/12/jjsruby_jsruby_for_rhino.html ( Japanese )