Add samples for compiler2. · jruby/jruby@8012811 · GitHub
Skip to content

Commit 8012811

Browse files
committed
Add samples for compiler2.
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@9397 961051c9-f516-0410-bf72-c9f7e237a7b7
1 parent 57fcb72 commit 8012811

4 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class MyObjectTest {
2+
public static void main(String[] args) {
3+
MyObject2 obj = new MyObject2();
4+
obj.booleanMethod(false);
5+
obj.byteMethod((byte)1);
6+
obj.shortMethod((short)1);
7+
obj.charMethod((char)1);
8+
obj.intMethod(1);
9+
obj.longMethod(1L);
10+
obj.floatMethod(1.0f);
11+
obj.doubleMethod(1.0);
12+
}
13+
}

‎samples/compiler2/myruby.rb‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'rbconfig'
2+
require 'java'
3+
require 'tool/signature'
4+
5+
class MyRubyClass
6+
def helloWorld
7+
puts "Hello from Ruby"
8+
end
9+
def goodbyeWorld(a)
10+
puts a
11+
end
12+
13+
signature :helloWorld, [] => Java::void
14+
signature :goodbyeWorld, [java.lang.String] => Java::void
15+
end

‎samples/compiler2/myruby2.rb‎

Lines changed: 11 additions & 0 deletions

0 commit comments

Comments
 (0)