[Ironruby-core] Platform

Nathan Stults Nathan_Stults at HSIHealth.com
Thu Oct 29 03:25:36 EDT 2009

I noticed that the PLATFORM and RUBY_PLATFORM constants returns the same
string when running from MRI as from IronRuby. Is there a standard Ruby
constant or Kernel method or something that will indicate that the
interpreter is IronRuby as opposed to MRI? While it is certainly true
that the OS is the same when running from both environments, it would
seem pretty useful to me to be able to distinguish, as JRuby does, so we
can write libraries that can selectively do things like selectively take
advantage of the .NET BCL if present. There are probably easy enough
ways to work around this, like 'begin require System @platform="ir"
rescue LoadError end' but using PLATFORM directly feels like it would be
more elegant.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091029/6292b500/attachment.html>

More information about the Ironruby-core mailing list