The OS gem allows for some easy telling if you're on windows or not.

require 'os'

>>

If there are any other features you'd like, let me know, I'll do what I can to add them :)

github.com/rdp/os for feedback et al

Related projects:

rubygems:

Gem::Platform.local
Gem.ruby

The reason Gem::Platform.local felt wrong to me is that it treated cygwin as windows–which for most build environments, is wrong. Hence the creation of this gem.

the facets gem (has a class similar to rubygems, above)

require 'facets/platform'
Platform.local

the “platform” gem, itself (a different gem)

FFI::Platform::OS

License: MIT (see LICENSE file)