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.
243 244 245 246 247 |
# File 'dependency.rb', line 243 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.
240 241 242 |
# File 'dependency.rb', line 240 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.
285 286 287 |
# File 'dependency.rb', line 285 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.
258 259 260 |
# File 'dependency.rb', line 258 def installed?(minimum_version: nil, minimum_revision: nil) use_macos_install? || super(minimum_version:, minimum_revision:) 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.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'dependency.rb', line 263 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.
280 281 282 |
# File 'dependency.rb', line 280 def uses_from_macos? true end |