Module: OS

Defined in:
brew/Library/Homebrew/os.rb,
brew/Library/Homebrew/os/mac.rb,
brew/Library/Homebrew/os/linux.rb,
brew/Library/Homebrew/cask/macos.rb,
brew/Library/Homebrew/os/mac/sdk.rb,
brew/Library/Homebrew/os/mac/xcode.rb,
brew/Library/Homebrew/os/linux/glibc.rb,
brew/Library/Homebrew/os/mac/version.rb,
brew/Library/Homebrew/os/mac/xquartz.rb,
brew/Library/Homebrew/os/linux/kernel.rb

Defined Under Namespace

Modules: Linux, Mac

Constant Summary collapse

ISSUES_URL =
"https://docs.brew.sh/Troubleshooting"
PATH_OPEN =
"xdg-open"

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'brew/Library/Homebrew/os.rb', line 10

def self.linux?
  return false if ENV["HOMEBREW_TEST_GENERIC_OS"]

  RbConfig::CONFIG["host_os"].include? "linux"
end

.mac?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'brew/Library/Homebrew/os.rb', line 4

def self.mac?
  return false if ENV["HOMEBREW_TEST_GENERIC_OS"]

  RbConfig::CONFIG["host_os"].include? "darwin"
end