Class: Hbc::Artifact::Moved

Inherits:
Relocated show all
Defined in:
Library/Homebrew/cask/lib/hbc/artifact/moved.rb

Instance Attribute Summary

Attributes inherited from Relocated

#source, #target

Attributes inherited from AbstractArtifact

#cask, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Relocated

from_args, #initialize, #resolve_target, #summarize, #to_a

Methods inherited from AbstractArtifact

#<=>, dirmethod, dsl_key, english_article, english_name, #initialize, read_script_arguments, #to_s

Methods included from Predicable

#attr_predicate

Constructor Details

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

Class Method Details

.english_descriptionObject



6
7
8
# File 'Library/Homebrew/cask/lib/hbc/artifact/moved.rb', line 6

def self.english_description
  "#{english_name}s"
end

Instance Method Details

#install_phase(**options) ⇒ Object



10
11
12
# File 'Library/Homebrew/cask/lib/hbc/artifact/moved.rb', line 10

def install_phase(**options)
  move(**options)
end

#summarize_installedObject



18
19
20
21
22
23
24
# File 'Library/Homebrew/cask/lib/hbc/artifact/moved.rb', line 18

def summarize_installed
  if target.exist?
    "#{printable_target} (#{target.abv})"
  else
    Formatter.error(printable_target, label: "Missing #{self.class.english_name}")
  end
end

#uninstall_phase(**options) ⇒ Object



14
15
16
# File 'Library/Homebrew/cask/lib/hbc/artifact/moved.rb', line 14

def uninstall_phase(**options)
  move_back(**options)
end