Skip to content

Instantly share code, notes, and snippets.

@jrgifford
Created August 2, 2011 17:26
Show Gist options
  • Save jrgifford/1120714 to your computer and use it in GitHub Desktop.
Save jrgifford/1120714 to your computer and use it in GitHub Desktop.
if RUBY_PLATFORM =~ /win32/
puts "We're in Windows!"
elsif RUBY_PLATFORM =~ /linux/
puts "We're in Linux!"
elsif RUBY_PLATFORM =~ /darwin/
puts "We're in Mac OS X!"
elsif RUBY_PLATFORM =~ /freebsd/
puts "We're in FreeBSD!"
elsif RUBY_PLATFORM =~ /java/
puts "WHOOT JRUBY!!"
else
puts "We're running under some secret government OS. :O"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment