Define MacOS::Version::SYMBOLS on macOS and linux
This commit is contained in:
parent
6ebd5174d6
commit
f38db6e100
@ -1,6 +1,8 @@
|
|||||||
# typed: true
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "version"
|
||||||
|
|
||||||
# Helper functions for querying operating system information.
|
# Helper functions for querying operating system information.
|
||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
@ -48,6 +50,25 @@ module OS
|
|||||||
CI_GLIBC_VERSION = "2.23"
|
CI_GLIBC_VERSION = "2.23"
|
||||||
CI_OS_VERSION = "Ubuntu 16.04"
|
CI_OS_VERSION = "Ubuntu 16.04"
|
||||||
|
|
||||||
|
module Mac
|
||||||
|
::MacOS = OS::Mac
|
||||||
|
|
||||||
|
class Version < ::Version
|
||||||
|
# TODO: when removing symbols here, ensure that they are added to
|
||||||
|
# DEPRECATED_MACOS_VERSIONS in MacOSRequirement.
|
||||||
|
SYMBOLS = {
|
||||||
|
ventura: "13",
|
||||||
|
monterey: "12",
|
||||||
|
big_sur: "11",
|
||||||
|
catalina: "10.15",
|
||||||
|
mojave: "10.14",
|
||||||
|
high_sierra: "10.13",
|
||||||
|
sierra: "10.12",
|
||||||
|
el_capitan: "10.11",
|
||||||
|
}.freeze
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if OS.mac?
|
if OS.mac?
|
||||||
require "os/mac"
|
require "os/mac"
|
||||||
# Don't tell people to report issues on unsupported configurations.
|
# Don't tell people to report issues on unsupported configurations.
|
||||||
|
|||||||
@ -31,12 +31,6 @@ module OS
|
|||||||
module Mac
|
module Mac
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
# rubocop:disable Naming/ConstantName
|
|
||||||
# rubocop:disable Style/MutableConstant
|
|
||||||
::MacOS = OS::Mac
|
|
||||||
# rubocop:enable Naming/ConstantName
|
|
||||||
# rubocop:enable Style/MutableConstant
|
|
||||||
|
|
||||||
raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
||||||
|
|
||||||
def version
|
def version
|
||||||
|
|||||||
@ -13,12 +13,6 @@ module OS
|
|||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
# rubocop:disable Naming/ConstantName
|
|
||||||
# rubocop:disable Style/MutableConstant
|
|
||||||
::MacOS = OS::Mac
|
|
||||||
# rubocop:enable Naming/ConstantName
|
|
||||||
# rubocop:enable Style/MutableConstant
|
|
||||||
|
|
||||||
raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
||||||
|
|
||||||
VERSION = ENV.fetch("HOMEBREW_MACOS_VERSION").chomp.freeze
|
VERSION = ENV.fetch("HOMEBREW_MACOS_VERSION").chomp.freeze
|
||||||
|
|||||||
@ -13,22 +13,10 @@ module OS
|
|||||||
class Version < ::Version
|
class Version < ::Version
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
# TODO: when removing symbols here, ensure that they are added to
|
|
||||||
# DEPRECATED_MACOS_VERSIONS in MacOSRequirement.
|
|
||||||
SYMBOLS = {
|
|
||||||
ventura: "13",
|
|
||||||
monterey: "12",
|
|
||||||
big_sur: "11",
|
|
||||||
catalina: "10.15",
|
|
||||||
mojave: "10.14",
|
|
||||||
high_sierra: "10.13",
|
|
||||||
sierra: "10.12",
|
|
||||||
el_capitan: "10.11",
|
|
||||||
}.freeze
|
|
||||||
|
|
||||||
# TODO: bump version when new macOS is released or announced
|
# TODO: bump version when new macOS is released or announced
|
||||||
# and also update references in docs/Installation.md and
|
# and also update references in docs/Installation.md,
|
||||||
# https://github.com/Homebrew/install/blob/HEAD/install.sh
|
# https://github.com/Homebrew/install/blob/HEAD/install.sh and
|
||||||
|
# OS::Mac::Version (in HOMEBREW_LIBRARY/os.rb)
|
||||||
NEWEST_UNSUPPORTED = "13"
|
NEWEST_UNSUPPORTED = "13"
|
||||||
private_constant :NEWEST_UNSUPPORTED
|
private_constant :NEWEST_UNSUPPORTED
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user