25 lines
666 B
Ruby
Raw Normal View History

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-26 20:30:30 -06:00
RUBY_PLATFORM.to_s.downcase.include? "linux"
2013-10-18 12:56:51 -05:00
end
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
if OS.mac?
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
# 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
elsif OS.linux?
2016-07-26 20:30:30 -06:00
ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting".freeze
PATH_OPEN = "xdg-open".freeze
end
2013-10-18 12:56:51 -05:00
end