Class: Cask::DSL::DependsOn Private
- Includes:
- Kernel
- Defined in:
- cask/dsl/depends_on.rb,
cask/dsl/depends_on.rbi
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.
Constant Summary collapse
- VALID_KEYS =
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.
T.let(Set.new([ :formula, :cask, :macos, :arch, ]).freeze, T::Set[Symbol])
- VALID_ARCHES =
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.
T.let({ intel: { type: :intel, bits: 64 }, # specific x86_64: { type: :intel, bits: 64 }, arm64: { type: :arm, bits: 64 }, }.freeze, T::Hash[Symbol, T::Hash[Symbol, T.any(Symbol, Integer)]])
Constants included from Kernel
Kernel::IGNORE_INTERRUPTS_MUTEX
Instance Attribute Summary collapse
Instance Method Summary collapse
- #cask ⇒ Array<String> private
- #cask=(*args) ⇒ Array<String> private
- #empty? ⇒ Boolean private
- #formula ⇒ Array<String> private
- #formula=(*args) ⇒ Array<String> private
- #initialize ⇒ void constructor private
- #load(pairs) ⇒ void private
- #present? ⇒ Boolean private
Methods included from Kernel
#ensure_executable!, #exec_browser, #exec_editor, #ignore_interrupts, #interactive_shell, #quiet_system, #redirect_stdout, #safe_system, #which, #which_editor, #with_env, #with_homebrew_path
Constructor Details
#initialize ⇒ 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.
33 34 35 36 37 38 39 |
# File 'cask/dsl/depends_on.rb', line 33 def initialize super({}) @arch = T.let(nil, T.nilable(T::Array[T::Hash[Symbol, T.any(Symbol, Integer)]])) @cask = T.let(nil, T.nilable(T::Array[String])) @formula = T.let(nil, T.nilable(T::Array[String])) @macos = T.let(nil, T.nilable(MacOSRequirement)) end |
Instance Attribute Details
#arch ⇒ Array<Hash{Symbol => Symbol, Integer}>?
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.
27 28 29 |
# File 'cask/dsl/depends_on.rb', line 27 def arch @arch end |
#macos ⇒ MacOSRequirement?
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.
30 31 32 |
# File 'cask/dsl/depends_on.rb', line 30 def macos @macos end |
Instance Method Details
#cask ⇒ 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.
42 43 44 |
# File 'cask/dsl/depends_on.rb', line 42 def cask @cask ||= [] end |
#cask=(*args) ⇒ 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.
66 67 68 |
# File 'cask/dsl/depends_on.rb', line 66 def cask=(*args) cask.concat(args) end |
#empty? ⇒ 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.
109 |
# File 'cask/dsl/depends_on.rb', line 109 def empty? = T.let(__getobj__, T::Hash[Symbol, T.untyped]).empty? |
#formula ⇒ 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.
47 48 49 |
# File 'cask/dsl/depends_on.rb', line 47 def formula @formula ||= [] end |
#formula=(*args) ⇒ 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.
61 62 63 |
# File 'cask/dsl/depends_on.rb', line 61 def formula=(*args) formula.concat(args) end |
#load(pairs) ⇒ 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.
This method returns an undefined value.
52 53 54 55 56 57 58 |
# File 'cask/dsl/depends_on.rb', line 52 def load(pairs) pairs.each do |key, value| raise "invalid depends_on key: '#{key.inspect}'" unless VALID_KEYS.include?(key) __getobj__[key] = send(:"#{key}=", *value) end end |
#present? ⇒ 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.
112 |
# File 'cask/dsl/depends_on.rb', line 112 def present? = !empty? |