Hi all,
I have the Hitimes gem (http://copiousfreetime.rubyforge.org/hitimes/),
and I
received a request to have it work on JRuby. It has an embedded C
extension,
and does not link to an external library. I figured, why not take the
opportunity to learn how to write a pure JRuby extension.
After looking at the extensions and Ruby class implmenations in the
jruby
distribution I think I implemented what I needed correctly, using
annotations.
It compiles, and creates the .jar. Only now, the annotated classes and
methods
do not appear to exist in the runtime.
I’m sure I have missed something simple, I just need the obvious pointed
out
to me. If someone could take a few minutes and help me out, I would
greatly
appreciate it.
http://github.com/copiousfreetime/hitimes/tree/java-ext
The gem list you need to run the rake tasks is:
configuration (0.0.4)
jruby-openssl (0.7)
json_pure (1.4.3)
rake (0.8.7)
rdoc (2.5.8)
rspec (1.3.0)
rubyforge (2.0.4)
If you check out that tree, then you can build and locally install the
jar.
rake ext:build_jruby
I then drop into irb and attempt this:
% irb
>> $: << "lib"
>> require 'hitimes'
>> puts Hitimes::Interval
NameError: uninitialized constant Hitimes::Interval
The Hitimes::Interval class is defined in the extension.
Any and all help is appreciated.
thanks,
-jeremy
–
Jeremy H. [email protected]
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email