Class: Cask::DSL::DependsOn Private

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
Library/Homebrew/cask/dsl/depends_on.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class corresponding to the depends_on stanza.

Constant Summary collapse

VALID_KEYS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Set.new([
  :formula,
  :cask,
  :macos,
  :arch,
  :x11,
  :java,
]).freeze
VALID_ARCHES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  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. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DependsOn.


33
34
35
36
37
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 33

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

Instance Attribute Details

#archObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 31

def arch
  @arch
end

#caskObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 31

def cask
  @cask
end

#formulaObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 31

def formula
  @formula
end

#javaObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


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

def java
  @java
end

#macosObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 31

def macos
  @macos
end

#x11Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 31

def x11
  @x11
end

Instance Method Details

#load(**pairs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


39
40
41
42
43
44
45
# File 'Library/Homebrew/cask/dsl/depends_on.rb', line 39

def load(**pairs)
  pairs.each do |key, value|
    raise "invalid depends_on key: '#{key.inspect}'" unless VALID_KEYS.include?(key)

    self[key] = send(:"#{key}=", *value)
  end
end