On 16/08/2008, at 1:54 AM, Berger, Daniel wrote:

Don't do this:

PLATFORM =~ /win32/

First, PLATFORM is deprecated instead of RUBY_PLATFORM. But, with the
advent of alternative implementations like Jruby and IronRuby,
RUBY_PLATFORM is no longer a wise approach. Jruby, for example, will
return 'java' for the RUBY_PLATFORM, even if you're on Windows.

Use rbconfig + host_os instead:

require 'rbconfig'

if Config::CONFIG['host_os'] =~ /mswin/I
...


Can someone please confirm that this is the "absolute" best way to check for Windows? There was some discussion that there would be different reports for MinGW...

Pending confirmation I'm going to use this method.

Thanks,
-Adam
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel

Reply via email to