Created
June 18, 2014 15:55
-
-
Save edymerchk/8d88382a421377932e6f to your computer and use it in GitHub Desktop.
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
require 'rbconfig' | |
def os | |
@os ||= ( | |
host_os = RbConfig::CONFIG['host_os'] | |
case host_os | |
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ | |
:windows | |
when /darwin|mac os/ | |
:macosx | |
when /linux/ | |
:linux | |
when /solaris|bsd/ | |
:unix | |
else | |
raise "unknown os: #{host_os.inspect}" | |
end | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment