I’m currently using a mix of Ruby interpreters for building a system. For instance, I use JRuby for Celerity, IronRuby for Windows Forms (on Mono) and MRI for other things.
To ensure I don’t mess things up, I came up with some tiny guards to get a clear message when I’m not using the interpreter I should be using. I’m sharing these here in case it’s useful to someone else.
# JRuby
abort $0 + " requires JRuby" unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
# IronRuby
abort($0 + " requires IronRuby") unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby"
Note that RUBY_ENGINE doesn’t seem to be defined under MRI.
To receive each article,
subscribe by RSS
or
by email.
The comments system is brand new - don't be afraid to comment!
All the posts are listed below and on the homepage.
- Monitoring File Changes and Getting Notified via Growl (February 14th, 2010)
- How to use Google Calendar and Rufus-Google for Basic Time Tracking (November 27th, 2009)
- Using JRuby to prototype VST plugins (November 17th, 2009)
- Introducing Learnivore.com (September 15th, 2009)
- How to create small, unique tokens in Ruby (July 2nd, 2009)
- How to create an empty Rails Edge application (January 28th, 2009)
- How to Freeze Gems with Rails >= 2.1 (December 23rd, 2008)
- Thoughts on IronRuby and .Net Testing (December 1st, 2008)
- How to Retrieve Delicious Tags and Number of Bookmarks for a Given Url (November 30th, 2008)
- Fixing Symbol not found _rl_filename_completion_function (November 6th, 2008)
- How to Generate a Gradient for your CSS using RMagick (October 21st, 2008)
- Analyzing Your GMail History (September 18th, 2008)
- Data Visualization with Ruby and RMagick - Where Are Those Bikes ? (March 31st, 2008)
- All-Time Classics: a Selection of Recommended Books for Software Developers (February 23rd, 2008)

