Module: OS
- Defined in:
- os.rb,
os/mac.rb,
os/linux.rb,
cask/macos.rb,
os/mac/sdk.rb,
os/mac/xcode.rb,
macos_version.rb,
os/linux/glibc.rb,
os/linux/kernel.rb
Defined Under Namespace
Constant Summary collapse
- LINUX_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.
See Linux-CI.md
"Ubuntu 22.04"
- LINUX_GLIBC_CI_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.35"
- LINUX_GLIBC_NEXT_CI_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.35"
- LINUX_GCC_CI_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.
"11.0"
- LINUX_PREFERRED_GCC_COMPILER_FORMULA =
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://packages.ubuntu.com/jammy/gcc
"gcc@11"
- LINUX_PREFERRED_GCC_RUNTIME_FORMULA =
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.
"gcc"
- 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.
if OS::Linux.wsl? && (wslview = which("wslview").presence) wslview.to_s else "xdg-open" end.freeze
Class Method Summary collapse
-
.kernel_name ⇒ String
Get the kernel name.
-
.kernel_version ⇒ Version
Get the kernel version.
-
.linux? ⇒ Boolean
Check if the operating system is Linux.
-
.mac? ⇒ Boolean
Check if the operating system is macOS.
-
.unsupported_configuration? ⇒ Boolean
private
Class Method Details
.kernel_name ⇒ String
Get the kernel name.
42 43 44 |
# File 'os.rb', line 42 def self.kernel_name @kernel_name ||= Utils.safe_popen_read("uname", "-s").chomp end |
.kernel_version ⇒ Version
Get the kernel version.
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.
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.
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 |
.unsupported_configuration? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
79 80 81 |
# File 'os.rb', line 79 def self.unsupported_configuration? !defined?(OS::ISSUES_URL) end |