[Rake-devel] ~/.rake file?

Trans transfire at gmail.com
Fri Aug 22 03:03:24 EDT 2008


On Thu, Aug 21, 2008 at 11:59 PM, Adam Salter <adam.q.salter at gmail.com> wrote:
>
> 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.

Or maybe 'gem/platform'.

T.


More information about the Rake-devel mailing list