Skip to content

Instantly share code, notes, and snippets.

@headius
Created November 19, 2009 01:05
Show Gist options
  • Select an option

  • Save headius/238439 to your computer and use it in GitHub Desktop.

Select an option

Save headius/238439 to your computer and use it in GitHub Desktop.

Revisions

  1. headius created this gist Nov 19, 2009.
    30 changes: 30 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    ~/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