2013-10-18 12:56:51 -05:00
|
|
|
module OS
|
|
|
|
def self.mac?
|
2016-07-26 20:30:30 -06:00
|
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
|
|
|
RUBY_PLATFORM.to_s.downcase.include? "darwin"
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.linux?
|
2016-07-27 22:10:34 -06:00
|
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
2016-07-26 20:30:30 -06:00
|
|
|
RUBY_PLATFORM.to_s.downcase.include? "linux"
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|
2014-06-03 16:59:50 +02:00
|
|
|
|
2016-04-04 11:46:33 +01:00
|
|
|
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
|
|
|
|
|
2014-06-03 16:59:50 +02:00
|
|
|
if OS.mac?
|
2015-10-16 16:41:14 +08:00
|
|
|
require "os/mac"
|
2016-07-26 20:30:30 -06:00
|
|
|
ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
|
|
|
|
PATH_OPEN = "/usr/bin/open".freeze
|
2015-10-16 16:41:14 +08:00
|
|
|
# compatibility
|
2016-07-26 20:30:30 -06:00
|
|
|
::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
|
|
|
|
::MACOS_VERSION = OS::Mac.version.to_s.freeze
|
2014-06-03 16:59:50 +02:00
|
|
|
elsif OS.linux?
|
2016-09-18 10:28:23 -04:00
|
|
|
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
|
2016-07-26 20:30:30 -06:00
|
|
|
PATH_OPEN = "xdg-open".freeze
|
2014-06-03 16:59:50 +02:00
|
|
|
end
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|