Skip to content

Instantly share code, notes, and snippets.

@daytonn
Created July 8, 2011 03:20
Show Gist options
  • Save daytonn/1071068 to your computer and use it in GitHub Desktop.
Save daytonn/1071068 to your computer and use it in GitHub Desktop.
Determine Windows Ruby Platform (stolen straight from rubygems)
WIN_PATTERNS = [
/bccwin/i,
/cygwin/i,
/djgpp/i,
/mingw/i,
/mswin/i,
/wince/i,
]
def win_platform?
@win_platform = !!WIN_PATTERNS.find{ |r| RUBY_PLATFORM =~ r } if @win_platform.nil?
@win_platform
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment