From: Daniel Berger Date: 2010-01-25T00:39:37+09:00 Subject: Re: Test for OS name from inside ruby script On Jan 23, 12:09 am, Jacob Mitchell wrote: > On Sat, Jan 23, 2010 at 1:56 AM, Dale Ackerman wrote: > > How do I test in my scripts for the OS type?  So I can conditionally run > > different code..? > > A quick google search led to this:http://snippets.dzone.com/posts/show/6238 I imagine using RUBY_PLATFORM in > some manner is a good solution. No, do not use RUBY_PLATFORM. JRuby will return "java", for example: If you want something built in use rbconfig.rb. Specifically, Config::CONFIG['host_os']. Or you can use a 3rd party gem like sys- uname or os. Regards, Dan