29 lines
753 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"]
2018-09-17 02:45:00 +02:00
RbConfig::CONFIG["host_os"].include? "darwin"
2013-10-18 12:56:51 -05:00
end
def self.linux?
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
2018-09-17 02:45:00 +02:00
RbConfig::CONFIG["host_os"].include? "linux"
2013-10-18 12:56:51 -05:00
end
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
if OS.mac?
require "os/mac"
# Don't tell people to report issues on unsupported versions of macOS.
if !OS::Mac.prerelease? && !OS::Mac.outdated_release?
ISSUES_URL = "https://docs.brew.sh/Troubleshooting".freeze
end
2016-07-26 20:30:30 -06:00
PATH_OPEN = "/usr/bin/open".freeze
elsif OS.linux?
require "os/linux"
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
2016-07-26 20:30:30 -06:00
PATH_OPEN = "xdg-open".freeze
end
2013-10-18 12:56:51 -05:00
end