Created
September 27, 2010 13:36
-
-
Save timfel/599036 to your computer and use it in GitHub Desktop.
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
bin/jruby jruby-cext/examples/MyTest/MyTest.rb |
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
require 'mytest' | |
MyTest.test1 |
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
LD_LIBRARY_CONFIG=jruby-cext/examples/MyTest:cext/build \ | |
bin/jruby -J-Djava.library.path=cext/build \ | |
jruby-cext/examples/MyTest/MyTest.rb |
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
include Java | |
m = org.jruby.cext.ModuleLoader.new | |
ext = File.join(File.dirname(__FILE__), "mytest") | |
m.load(self, ext) | |
MyTest.test1 # call the C defined method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment