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, minimum_compatibility_version: 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?, #no_linkage?, #option_names, #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.
265 266 267 268 269 |
# File 'dependency.rb', line 265 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.
262 263 264 |
# File 'dependency.rb', line 262 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.
310 311 312 |
# File 'dependency.rb', line 310 def dup_with_formula_name(formula) self.class.new(formula.full_name.to_s, , bounds:) end |
#installed?(minimum_version: nil, minimum_revision: nil, minimum_compatibility_version: 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.
283 284 285 |
# File 'dependency.rb', line 283 def installed?(minimum_version: nil, minimum_revision: nil, minimum_compatibility_version: 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.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'dependency.rb', line 288 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.
305 306 307 |
# File 'dependency.rb', line 305 def uses_from_macos? true end |