Class: MacOSRequirement

Inherits:
Requirement show all
Defined in:
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

#==, default_formula, #env, env, #env_proc, expand, #fatal?, #hash, #inspect, #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, #recommended?, #required?, #run?

Constructor Details

#initialize(tags = []) ⇒ MacOSRequirement

Returns a new instance of MacOSRequirement



6
7
8
9
# File 'Library/Homebrew/requirements/macos_requirement.rb', line 6

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

Instance Method Details

#display_sObject



27
28
29
30
# File 'Library/Homebrew/requirements/macos_requirement.rb', line 27

def display_s
  return "macOS is required" unless minimum_version_specified?
  "macOS >= #{@version}"
end

#messageObject



22
23
24
25
# File 'Library/Homebrew/requirements/macos_requirement.rb', line 22

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)


11
12
13
# File 'Library/Homebrew/requirements/macos_requirement.rb', line 11

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