From: list-bounce / example.com [mailto:list-bounce / example.com] On Behalf Of
Brad Tilley
Sent: Monday, October 30, 2006 11:25 PM
>Wes Gamble wrote:
>> What's the easiest way to figure out if you are on a Windows vs. UNIX
>> platform in Ruby from within a Ruby program?
>
>Try this:
>
>irb(main):005:0> puts RUBY_PLATFORM
>powerpc-darwin8.0
>

Not very useful sometimes:

irb(main):001:0> puts RUBY_PLATFORM
i386-mswin32_71
(1)  (2) (3)(4)

Here's encoded: CPU architecture (1), OS (2), CPU bits (3), compiler (4 -
it's MS Visual Studio 7.1)

Pasing this on every platform may become a pain.

v.