Skip to content

Instantly share code, notes, and snippets.

@galaakk
Last active December 27, 2015 13:58
Show Gist options
  • Save galaakk/7336687 to your computer and use it in GitHub Desktop.
Save galaakk/7336687 to your computer and use it in GitHub Desktop.
Detect Windows platform - conditional Gem loading
winPlatforms = ['mswin', 'mingw', 'mingw_18', 'mingw_19', 'mingw_20']
case Gem::Platform.local.os
when *winPlatforms
require 'win32console'
end
source "http://rubygems.org"
gem "win32console", ">= 1.3.2", :platforms => [:mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment