aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os.rb
blob: 4500fbd1e863c9881925843acbac64b3b6a2e5e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module OS
  def self.mac?
    return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
    RUBY_PLATFORM.to_s.downcase.include? "darwin"
  end

  def self.linux?
    RUBY_PLATFORM.to_s.downcase.include? "linux"
  end

  ::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]

  if OS.mac?
    require "os/mac"
    ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
    PATH_OPEN = "/usr/bin/open".freeze
    # compatibility
    ::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
    ::MACOS_VERSION = OS::Mac.version.to_s.freeze
  elsif OS.linux?
    ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting".freeze
    PATH_OPEN = "xdg-open".freeze
  end
end