Class: Cask::Artifact::Pkg Private

Inherits:
AbstractArtifact show all
Defined in:
cask/artifact/pkg.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.

Artifact corresponding to the pkg stanza.

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

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 Pkg.



25
26
27
28
29
# File 'cask/artifact/pkg.rb', line 25

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

Instance Attribute Details

#pathObject (readonly)

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.



18
19
20
# File 'cask/artifact/pkg.rb', line 18

def path
  @path
end

#stanza_optionsObject (readonly)

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.



18
19
20
# File 'cask/artifact/pkg.rb', line 18

def stanza_options
  @stanza_options
end

Class Method Details

.from_args(cask, path, **stanza_options) ⇒ 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.



20
21
22
23
# File 'cask/artifact/pkg.rb', line 20

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

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.



35
36
37
# File 'cask/artifact/pkg.rb', line 35

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

#summarizeObject

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.



31
32
33
# File 'cask/artifact/pkg.rb', line 31

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