DRbProxy
Why? I am using JRuby for my development because I need to access some Java libraries. That said, every time I run tests is going to take forever as I need to start a JVM and Rails environment initialization. Even with the help on Nailgun, it is still very slow. DRbProxy allows me to interact JRuby classes with Ruby.
How? Let’s say I want to use my GData JRuby client library from Ruby:
-
I create a file called ‘libs.rb’ with the following content:
gem 'gdata-jruby-client'
require 'gdata_jruby_client'
-
I start the drbproxy server
jruby drbproxy -f libs.rb
-
Define GData class in Ruby/IRb:
require 'drbproxy'
class GData < DRbProxy::DRbProxyClass; end
-
Now I can do things like:
puts GData::CalendarService::OWN_CALENDAR_URL
=> "http://www.google.com/calendar/feeds/default/owncalendars/full"