Skip to content

Instantly share code, notes, and snippets.

@headius
Created November 19, 2009 01:05
Show Gist options
  • Save headius/238439 to your computer and use it in GitHub Desktop.
Save headius/238439 to your computer and use it in GitHub Desktop.
~/projects ➔ gem install java-inline
Successfully installed ZenTest-4.1.4
Successfully installed RubyInline-3.8.3
Successfully installed java-inline-0.0.1-java
3 gems installed
Installing ri documentation for ZenTest-4.1.4...
Installing ri documentation for RubyInline-3.8.3...
Installing ri documentation for java-inline-0.0.1-java...
Installing RDoc documentation for ZenTest-4.1.4...
Installing RDoc documentation for RubyInline-3.8.3...
Installing RDoc documentation for java-inline-0.0.1-java...
~/projects ➔ cat demo.rb
require 'rubygems'
require 'java_inline'
class Woo
inline :Java do |builder|
builder.java '
public static String hello() {
return "woo";
}
'
end
end
puts Woo.new.hello
~/projects ➔ jruby demo.rb
woo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment