Class: Cask::Artifact::Artifact Private

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

Generic artifact corresponding to the artifact stanza.

Instance Attribute Summary

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Moved

english_description, #install_phase, #summarize_installed, #uninstall_phase

Methods inherited from Relocated

#initialize, #source, #summarize, #target, #to_a

Methods inherited from AbstractArtifact

#config, dirmethod, dsl_key, english_article, #initialize, read_script_arguments, #staged_path_join_executable, #summarize, #to_args

Methods included from Attrable

#attr_predicate, #attr_rw

Constructor Details

This class inherits a constructor from Cask::Artifact::Relocated

Class Method Details

.english_nameString

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:



11
12
13
# File 'cask/artifact/artifact.rb', line 11

def self.english_name
  "Generic Artifact"
end

.from_args(cask, *args) ⇒ T.attached_class

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:

  • cask (Cask)
  • args (T.untyped)

Returns:

  • (T.attached_class)

Raises:



16
17
18
19
20
21
22
23
24
25
26
# File 'cask/artifact/artifact.rb', line 16

def self.from_args(cask, *args)
  source, options = args

  raise CaskInvalidError.new(cask.token, "No source provided for #{english_name}.") if source.blank?

  unless options&.key?(:target)
    raise CaskInvalidError.new(cask.token, "#{english_name} '#{source}' requires a target.")
  end

  new(cask, source, **options)
end

Instance Method Details

#resolve_target(target) ⇒ Pathname

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:



29
30
31
# File 'cask/artifact/artifact.rb', line 29

def resolve_target(target)
  super(target, base_dir: nil)
end