os: fix Rubocop warnings.

This commit is contained in:
Mike McQuaid 2016-07-26 20:30:30 -06:00
parent 932e145d9c
commit 3318967609

View File

@ -1,23 +1,24 @@
module OS module OS
def self.mac? def self.mac?
/darwin/i === RUBY_PLATFORM && !ENV["HOMEBREW_TEST_GENERIC_OS"] return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
RUBY_PLATFORM.to_s.downcase.include? "darwin"
end end
def self.linux? def self.linux?
/linux/i === RUBY_PLATFORM RUBY_PLATFORM.to_s.downcase.include? "linux"
end end
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"] ::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
if OS.mac? if OS.mac?
require "os/mac" require "os/mac"
ISSUES_URL = "https://git.io/brew-troubleshooting" ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
PATH_OPEN = "/usr/bin/open" PATH_OPEN = "/usr/bin/open".freeze
# compatibility # compatibility
::MACOS_FULL_VERSION = OS::Mac.full_version.to_s ::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
::MACOS_VERSION = OS::Mac.version.to_s ::MACOS_VERSION = OS::Mac.version.to_s.freeze
elsif OS.linux? elsif OS.linux?
ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting" ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting".freeze
PATH_OPEN = "xdg-open" PATH_OPEN = "xdg-open".freeze
end end
end end