public
Created

  • Download Gist
new_cext_run.sh
Shell
1
bin/jruby jruby-cext/examples/MyTest/MyTest.rb
new_require.rb
Ruby
1 2
require 'mytest'
MyTest.test1
old_cext_run.sh
Shell
1 2 3
LD_LIBRARY_CONFIG=jruby-cext/examples/MyTest:cext/build \
bin/jruby -J-Djava.library.path=cext/build \
jruby-cext/examples/MyTest/MyTest.rb
old_require.rb
Ruby
1 2 3 4 5
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.