Created
July 8, 2011 03:20
-
-
Save daytonn/1071068 to your computer and use it in GitHub Desktop.
Determine Windows Ruby Platform (stolen straight from rubygems)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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