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?  Normally I'd say unix but there might be
application cases where it's more on the Windows side...

>   b) a short description of that very same.
>
> I will gather all of those emails and create said minimal library.
> Comments on interface propositions are also welcome.

I think I remember having seen something like this.  Maybe you check with
ruby-talk archive.

Kind regards

    robert