Robert Klemme wrote:
> Kaspar Schiess wrote:
> 
>>Dear list,
>>
>>A common Ruby idiom seems to be something like
>>  if PLATFORM =~ /mswin32/
>>    # do windows stuff
>>  end
>>
>>Variations include matching for /mswin/.
>>
>>Neither of those works on the mingw32 PLATFORM (i386-mingw32).
>>
>>As a consequence of fixing this in a lot of libraries all the time I
>>would like to create a small library that permits
>>  Platform.windows?
>>  Platform.unix?
>>  ...
>>tests. To that end, I would need a complete collection of those
>>PLATFORM strings and how to classify them. I ask you all to send me:
>>  a) output of PLATFORM on your .. well.. platform
> 
> 
> 18:05:35 [~]: ruby -e 'p PLATFORM, RUBY_VERSION'
> "i386-cygwin"
> "1.8.3"
> 
> Now, how do you classify that?

cygwin != windows
mingw != windows

The whole pointof cygwin/mingw is to give you a Unix like environment on 
Windows, including header files, etc.

The notion that PLATFORM.match("mswin") doesn't work for cygwin/ming strikes me 
as odd, since you'll get the unixy behavior you (presumably) want if you're 
running cygwin/mingw.

Regards,

Dan