Module: Dependable Abstract Private
Overview
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Subclasses must implement the abstract methods below.
Shared functions for classes which can be depended upon.
Constant Summary collapse
- PRUNE =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
Return from an Dependency.expand or Requirement.expand block to remove a dependency/requirement and all of its recursive dependencies from the result list.
:prune- SKIP =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
Return from a Dependency.expand block to omit a dependency from the result list but continue expanding its children.
:skip- KEEP_BUT_PRUNE_RECURSIVE_DEPS =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
Return from a Dependency.expand block to keep a dependency in the result list but stop recursing into its own dependencies.
:keep_but_prune_recursive_deps- RESERVED_TAGS =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
:runand:linkedare no longer used but keep them here to avoid their misuse in future. [:build, :optional, :recommended, :run, :test, :linked, :implicit, :no_linkage].freeze
Instance Method Summary collapse
- #build? ⇒ Boolean private
- #implicit? ⇒ Boolean private
- #no_linkage? ⇒ Boolean private
- #option_names ⇒ Array<String> abstract private
- #option_tags ⇒ Array<String> private
- #optional? ⇒ Boolean private
- #options ⇒ Options private
- #prune_from_option?(build) ⇒ Boolean private
- #prune_if_build_and_not_dependent?(dependent, formula = nil) ⇒ Boolean private
- #recommended? ⇒ Boolean private
- #required? ⇒ Boolean private
- #tags ⇒ Array<Symbol, String, Array<T.untyped>> private
- #test? ⇒ Boolean private
Instance Method Details
#build? ⇒ 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.
37 38 39 |
# File 'dependable.rb', line 37 def build? .include? :build end |
#implicit? ⇒ 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.
57 58 59 |
# File 'dependable.rb', line 57 def implicit? .include? :implicit end |
#no_linkage? ⇒ 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.
62 63 64 |
# File 'dependable.rb', line 62 def no_linkage? .include? :no_linkage end |
#option_names ⇒ Array<String>
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.
34 |
# File 'dependable.rb', line 34 def option_names; end |
#option_tags ⇒ Array<String>
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.
72 73 74 |
# File 'dependable.rb', line 72 def .grep(String) end |
#optional? ⇒ 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.
42 43 44 |
# File 'dependable.rb', line 42 def optional? .include? :optional end |
#options ⇒ Options
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.
77 78 79 |
# File 'dependable.rb', line 77 def Options.create() end |
#prune_from_option?(build) ⇒ 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.
82 83 84 85 86 |
# File 'dependable.rb', line 82 def prune_from_option?(build) return false if !optional? && !recommended? build.without?(self) end |
#prune_if_build_and_not_dependent?(dependent, formula = 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.
89 90 91 92 93 94 95 96 97 98 99 |
# File 'dependable.rb', line 89 def prune_if_build_and_not_dependent?(dependent, formula = nil) return false unless build? if formula dependent != formula else raise "dependent is not a formula or cask dependent" unless dependent.is_a?(Dependency) dependent.installed? end end |
#recommended? ⇒ 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.
47 48 49 |
# File 'dependable.rb', line 47 def recommended? .include? :recommended end |
#required? ⇒ 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.
67 68 69 |
# File 'dependable.rb', line 67 def required? !build? && !test? && !optional? && !recommended? end |
#tags ⇒ Array<Symbol, String, Array<T.untyped>>
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.
29 30 31 |
# File 'dependable.rb', line 29 def @tags ||= T.let([], T.nilable(T::Array[T.any(Symbol, String, T::Array[T.untyped])])) end |
#test? ⇒ 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.
52 53 54 |
# File 'dependable.rb', line 52 def test? .include? :test end |