Class: Cask::Artifact::Pkg

Inherits:
AbstractArtifact show all
Defined in:
brew/Library/Homebrew/cask/artifact/pkg.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractArtifact

#<=>, #config, dirmethod, dsl_key, english_article, english_name, read_script_arguments, #staged_path_join_executable, #to_s

Methods included from Predicable

#attr_predicate

Constructor Details

#initialize(cask, path, **stanza_options) ⇒ Pkg

Returns a new instance of Pkg



23
24
25
26
27
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 23

def initialize(cask, path, **stanza_options)
  super(cask)
  @path = cask.staged_path.join(path)
  @stanza_options = stanza_options
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



21
22
23
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 21

def path
  @path
end

#pkg_relative_pathObject (readonly)

Returns the value of attribute pkg_relative_path



14
15
16
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 14

def pkg_relative_path
  @pkg_relative_path
end

#stanza_optionsObject (readonly)

Returns the value of attribute stanza_options



21
22
23
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 21

def stanza_options
  @stanza_options
end

Class Method Details

.from_args(cask, path, **stanza_options) ⇒ Object



16
17
18
19
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 16

def self.from_args(cask, path, **stanza_options)
  stanza_options.assert_valid_keys!(:allow_untrusted, :choices)
  new(cask, path, **stanza_options)
end

Instance Method Details

#install_phase(**options) ⇒ Object



33
34
35
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 33

def install_phase(**options)
  run_installer(**options)
end

#summarizeObject



29
30
31
# File 'brew/Library/Homebrew/cask/artifact/pkg.rb', line 29

def summarize
  path.relative_path_from(cask.staged_path).to_s
end