From: Eleanor McHugh Date: 2009-04-08T20:27:25+09:00 Subject: Re: How to find Operating system On 8 Apr 2009, at 11:53, Ben Lovell wrote: > You can reach into the ENV object for a whole load of information > about your > current execution environment: > > ENV.to_hash.each do |key, value| > puts("#{key} - #{value}") > end Or you can use rbconfig: require 'rbconfig' case Config::CONFIG['host_os'] when /darwin/i puts "Ah, Darwin :)" when /mswin|windows/i raise "You call that an operating system?" else raise "I haven't the foggiest" end However be aware that if you're using JRuby it will still report the underlying OS which might not be as informative as you'd like so you'll also need to check other CONFIG options. Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason