Class: Cask::DSL::DependsOn Private

Inherits:
SimpleDelegator
  • Object
show all
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

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

#initializevoid

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

#archArray<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.

Returns:



27
28
29
# File 'cask/dsl/depends_on.rb', line 27

def arch
  @arch
end

#macosMacOSRequirement?

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.

Returns:



30
31
32
# File 'cask/dsl/depends_on.rb', line 30

def macos
  @macos
end

Instance Method Details

#caskArray<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.

Returns:



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.

Parameters:

Returns:



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.

Returns:

  • (Boolean)


109
# File 'cask/dsl/depends_on.rb', line 109

def empty? = T.let(__getobj__, T::Hash[Symbol, T.untyped]).empty?

#formulaArray<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.

Returns:



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.

Parameters:

Returns:



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.

Parameters:



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.

Returns:

  • (Boolean)


112
# File 'cask/dsl/depends_on.rb', line 112

def present? = !empty?