Created
December 10, 2008 15:45
-
-
Save ohammersmith/34352 to your computer and use it in GitHub Desktop.
Sniff Windows platform in Ruby
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
if RUBY_PLATFORM =~ /mswin|mingw/ | |
begin | |
require 'win32/open3' | |
rescue LoadError | |
warn "You must 'gem install win32-open3' to use the github command on Windows" | |
exit 1 | |
end | |
else | |
require 'open3' | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment