Class: Cask::DSL::DependsOn Private

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
cask/dsl/depends_on.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.

Class corresponding to the depends_on stanza.

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.

Set.new([
  :formula,
  :cask,
  :macos,
  :arch,
]).freeze
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.

{
  intel:  { type: :intel, bits: 64 },
  # specific
  x86_64: { type: :intel, bits: 64 },
  arm64:  { type: :arm, bits: 64 },
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDependsOn

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 a new instance of DependsOn.



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

def initialize
  super({})
  @cask ||= []
  @formula ||= []
end

Instance Attribute Details

#archObject

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.



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

def arch
  @arch
end

#caskObject

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.



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

def cask
  @cask
end

#formulaObject

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.



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

def formula
  @formula
end

#macosObject

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.



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

def macos
  @macos
end

Instance Method Details

#load(**pairs) ⇒ Object

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.



36
37
38
39
40
41
42
# File 'cask/dsl/depends_on.rb', line 36

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