Class: Cask::Artifact::Artifact Private

Inherits:
Moved show all
Extended by:
T::Sig
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 Relocated

#source, #target

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

#summarize, #to_a

Methods inherited from AbstractArtifact

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

Methods included from Predicable

#attr_predicate

Constructor Details

#initialize(cask, source, target:) ⇒ void

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:



41
42
43
# File 'cask/artifact/artifact.rb', line 41

def initialize(cask, source, target:)
  super(cask, source, target: target)
end

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:



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

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:



23
24
25
26
27
28
29
30
31
32
33
# File 'cask/artifact/artifact.rb', line 23

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.try(: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:



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

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