Class: UsesFromMacOSDependency Private
- Inherits:
-
Dependency
- Object
- Dependency
- UsesFromMacOSDependency
- Defined in:
- dependency.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A dependency that's marked as "installed" on macOS
Constant Summary
Constants included from Dependable
Instance Attribute Summary collapse
- #bounds ⇒ Object readonly private
Attributes inherited from Dependency
Attributes included from Dependable
Instance Method Summary collapse
- #dup_with_formula_name(formula) ⇒ T.self_type private
- #initialize(name, tags = [], bounds:) ⇒ void constructor private
- #installed?(minimum_version: nil, minimum_revision: nil) ⇒ Boolean private
- #use_macos_install? ⇒ Boolean private
- #uses_from_macos? ⇒ Boolean private
Methods inherited from Dependency
action, expand, keep_but_prune_recursive_deps, merge_repeats, #missing_options, #option_names, prune, #satisfied?, skip, #to_formula
Methods included from Cachable
Methods included from Dependable
#build?, #implicit?, #option_tags, #optional?, #options, #prune_from_option?, #prune_if_build_and_not_dependent?, #recommended?, #required?, #test?
Constructor Details
#initialize(name, tags = [], bounds:) ⇒ void
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.
250 251 252 253 254 |
# File 'dependency.rb', line 250 def initialize(name, = [], bounds:) super(name, ) @bounds = bounds end |
Instance Attribute Details
#bounds ⇒ Object (readonly)
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.
247 248 249 |
# File 'dependency.rb', line 247 def bounds @bounds end |
Instance Method Details
#dup_with_formula_name(formula) ⇒ T.self_type
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.
292 293 294 |
# File 'dependency.rb', line 292 def dup_with_formula_name(formula) self.class.new(formula.full_name.to_s, , bounds:) end |
#installed?(minimum_version: nil, minimum_revision: nil) ⇒ 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.
265 266 267 |
# File 'dependency.rb', line 265 def installed?(minimum_version: nil, minimum_revision: nil) use_macos_install? || super end |
#use_macos_install? ⇒ 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.
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'dependency.rb', line 270 def use_macos_install? # Check whether macOS is new enough for dependency to not be required. if Homebrew::SimulateSystem.simulating_or_running_on_macos? # Assume the oldest macOS version when simulating a generic macOS version return true if Homebrew::SimulateSystem.current_os == :macos && !bounds.key?(:since) if Homebrew::SimulateSystem.current_os != :macos current_os = MacOSVersion.from_symbol(Homebrew::SimulateSystem.current_os) since_os = MacOSVersion.from_symbol(bounds[:since]) if bounds.key?(:since) return true if current_os >= since_os end end false end |
#uses_from_macos? ⇒ 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.
287 288 289 |
# File 'dependency.rb', line 287 def uses_from_macos? true end |