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

Dylan Bruzenak dylan at ideaswarm.com
Fri Dec 18 15:03:36 PST 2009


I use defined? MACRUBY_VERSION, myself. A bit shorter ;)

On Fri, Dec 18, 2009 at 3:34 PM, Josh Ballanco <joshua.ballanco at apple.com>wrote:

> Whoops...that's what I get for replying with untested code...
>
>
> On Dec 18, 2009, at 12:14 PM, Paul Howson wrote:
>
> > On 17/12/2009, at 6:21 PM, Josh Ballanco wrote:
> >
> >> def is_macruby?
> >> defined? RUBY_ENGINE && RUBY_ENGINE == 'macruby'
> >> end
> >>
> >> Cheers,
> >> Josh
> >
> > Thanks Josh. However I note this works only if you write:
> >
> > defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
> >
> > i.e. the argument to defined? must be put in parentheses else MacRuby
> crashes.
> >
> > Paul Howson
> >
> > _______________________________________________
> > MacRuby-devel mailing list
> > MacRuby-devel at lists.macosforge.org
> > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20091218/dffb87aa/attachment.html>


More information about the MacRuby-devel mailing list