In a previous question, I asked how to tell my Gemfile whether to take the JRuby-relevant gems or the MRI-relevant gems. The answer I got was to do the following in the Gemfile:
platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
end
platforms :mri do
gem "sqlite3"
end
Obviously, the platforms() method in Bundler knows how to figure out if I’m running MRI or JRuby. Is there another way I can tell within my program if I am running JRuby or MRI?
Are you able to distinguish between the two like this:
You could write a method to give you a
jruby?method if required: