[MacRuby-devel] How to test if you're running MacRuby vs. Ruby?

Josh Ballanco joshua.ballanco at apple.com
Thu Dec 17 00:21:54 PST 2009


def is_macruby?
  defined? RUBY_ENGINE && RUBY_ENGINE == 'macruby'
end

Cheers,

Josh


On Dec 17, 2009, at 12:18 AM, Paul Howson wrote:

> Is there a way to test if code is running in MacRuby rather than Ruby? I'm developing and testing some code using plain old Ruby 1.8.7 in TextMate, then integrating it into an Xcode project, so I need to be able to "comment out" some lines which are Cocoa-dependent when testing in plain Ruby.
> 
> Paul Howson
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list