davetroy / geohash

Improved Geohash Gem for Ruby
116 stars 46 forks source link

JRuby #2

Closed outoftime closed 14 years ago

outoftime commented 14 years ago

Hey Dave,

Here's my patch for JRuby compatibility. The idea here is that you can now build two versions of the gem -- an MRI-compatible version (what you already had), and a JRuby-compatible version. The JRuby-comptaible version uses the geohash-java library:

http://github.com/kungfoo/geohash-java

The gemspec uses the gem platform version to distinguish between the two. It builds the JRuby version if the JRUBY environment variable is set, or you're actually running gem build in JRuby. You should be able to push both the C and JRuby versions of the gem to gemcutter under the same name; it's smart about distinguishing between the platform versions and installing the right one.

Let me know if you have any questions!

Mat