Created
September 12, 2011 05:05
-
-
Save lorenzoplanas/1210626 to your computer and use it in GitHub Desktop.
jruby - develop & test using jruby interpreter. Compile the code to Java bytecodes and run it straight away
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| require "Foo" | |
| class Bar | |
| def self.say_hello | |
| Foo.say_hello | |
| end | |
| end | |
| p Bar.say_hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jruby Bar.rb | |
| -> "Hello world!" | |
| jrubyc Foo.rb | |
| -> Creates Foo.class | |
| jrubyc Bar.rb | |
| -> Creates Bar.class | |
| java -cp .:$GEM_HOME/gems/jruby-jars-1.6.4/lib/jruby-core-1.6.4.jar -Djruby.compat.version=RUBY1_9 Bar | |
| -> "Hello world!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jruby Bar.rb | |
| -> "Hello world!" | |
| jrubyc Foo.rb | |
| -> Creates Foo.class | |
| jrubyc Bar.rb | |
| -> Creates Bar.class | |
| java -cp .:$GEM_HOME/gems/jruby-jars-1.6.4/lib/jruby-core-1.6.4.jar -Djruby.compat.version=RUBY1_9 Bar | |
| -> "Hello world!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| class Foo | |
| def self.say_hello | |
| "Hello world!" | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment