Module: OS
- Defined in:
- Library/Homebrew/os.rb,
Library/Homebrew/os/mac.rb,
Library/Homebrew/os/linux.rb,
Library/Homebrew/cask/macos.rb,
Library/Homebrew/os/mac/sdk.rb,
Library/Homebrew/os/mac/xcode.rb,
Library/Homebrew/os/linux/glibc.rb,
Library/Homebrew/os/mac/version.rb,
Library/Homebrew/os/mac/xquartz.rb,
Library/Homebrew/os/linux/kernel.rb
Overview
typed: true frozen_string_literal: true
Defined Under Namespace
Constant Summary collapse
- ISSUES_URL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"https://docs.brew.sh/Troubleshooting"
- PATH_OPEN =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"xdg-open"
Class Method Summary collapse
-
.kernel_version ⇒ Object
Get the kernel version.
-
.linux? ⇒ Boolean
Check if the operating system is Linux.
-
.mac? ⇒ Boolean
Check if the operating system is macOS.
Class Method Details
.kernel_version ⇒ Object
Get the kernel version.
29 30 31 |
# File 'Library/Homebrew/os.rb', line 29 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.
20 21 22 23 24 |
# File 'Library/Homebrew/os.rb', line 20 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.
11 12 13 14 15 |
# File 'Library/Homebrew/os.rb', line 11 def self.mac? return false if ENV["HOMEBREW_TEST_GENERIC_OS"] RbConfig::CONFIG["host_os"].include? "darwin" end |