Module: OS

Extended by:
T::Sig
Defined in:
os.rb,
os/mac.rb,
os/linux.rb,
cask/macos.rb,
os/mac/sdk.rb,
os/mac/xcode.rb,
os/linux/glibc.rb,
os/mac/version.rb,
os/mac/xquartz.rb,
os/linux/kernel.rb

Defined Under Namespace

Modules: Linux, Mac

Constant Summary collapse

CI_GLIBC_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"2.23"
CI_OS_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"Ubuntu 16.04"
ISSUES_URL =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"https://docs.brew.sh/Troubleshooting"
PATH_OPEN =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"xdg-open"

Class Method Summary collapse

Class Method Details

.kernel_versionVersion

Get the kernel version.

Returns:



34
35
36
# File 'os.rb', line 34

def self.kernel_version
  @kernel_version ||= Version.new(Utils.safe_popen_read("uname", "-r").chomp)
end

.linux?Boolean

Check if the operating system is Linux.

Returns:

  • (Boolean)


24
25
26
27
28
# File 'os.rb', line 24

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

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

.mac?Boolean

Check if the operating system is macOS.

Returns:

  • (Boolean)


14
15
16
17
18
# File 'os.rb', line 14

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

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