Class: MacOSRequirement

Inherits:
Requirement show all
Defined in:
brew/Library/Homebrew/requirements/macos_requirement.rb

Constant Summary

Constants included from Dependable

Dependable::RESERVED_TAGS

Instance Attribute Summary

Attributes inherited from Requirement

#cask, #download, #name, #tags

Instance Method Summary collapse

Methods inherited from Requirement

#==, #env, env, #env_proc, expand, #fatal?, #hash, #inspect, #mktemp, #modify_build_environment, #option_names, prune, prune?, #satisfied?, #satisfied_result_parent, satisfy

Methods included from BuildEnvironment::DSL

#env

Methods included from Dependable

#build?, #option_tags, #optional?, #options, #prune_from_option?, #prune_if_build_and_not_dependent?, #recommended?, #required?, #test?

Constructor Details

#initialize(tags = []) ⇒ MacOSRequirement

Returns a new instance of MacOSRequirement



8
9
10
11
# File 'brew/Library/Homebrew/requirements/macos_requirement.rb', line 8

def initialize(tags = [])
  @version = MacOS::Version.from_symbol(tags.shift) unless tags.empty?
  super(tags)
end

Instance Method Details

#display_sObject



31
32
33
34
35
# File 'brew/Library/Homebrew/requirements/macos_requirement.rb', line 31

def display_s
  return "macOS is required" unless minimum_version_specified?

  "macOS >= #{@version}"
end

#messageObject



25
26
27
28
29
# File 'brew/Library/Homebrew/requirements/macos_requirement.rb', line 25

def message
  return "macOS is required." unless minimum_version_specified?

  "macOS #{@version.pretty_name} or newer is required."
end

#minimum_version_specified?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'brew/Library/Homebrew/requirements/macos_requirement.rb', line 13

def minimum_version_specified?
  OS.mac? && @version
end