Document Artifact.
This commit is contained in:
parent
a3065080c3
commit
5426e47579
@ -27,6 +27,9 @@ require "cask/artifact/uninstall"
|
|||||||
require "cask/artifact/zap"
|
require "cask/artifact/zap"
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
|
# Module containing all cask artifact classes.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
module Artifact
|
module Artifact
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Abstract superclass for all artifacts.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class AbstractArtifact
|
class AbstractArtifact
|
||||||
include Comparable
|
include Comparable
|
||||||
extend Predicable
|
extend Predicable
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_artifact"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Abstract superclass for block artifacts.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class AbstractFlightBlock < AbstractArtifact
|
class AbstractFlightBlock < AbstractArtifact
|
||||||
def self.dsl_key
|
def self.dsl_key
|
||||||
super.to_s.sub(/_block$/, "").to_sym
|
super.to_s.sub(/_block$/, "").to_sym
|
||||||
|
|||||||
@ -10,6 +10,9 @@ using HashValidator
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Abstract superclass for uninstall artifacts.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class AbstractUninstall < AbstractArtifact
|
class AbstractUninstall < AbstractArtifact
|
||||||
ORDERED_DIRECTIVES = [
|
ORDERED_DIRECTIVES = [
|
||||||
:early_script,
|
:early_script,
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `app` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class App < Moved
|
class App < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,6 +7,9 @@ using HashValidator
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Generic artifact corresponding to the `artifact` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Artifact < Moved
|
class Artifact < Moved
|
||||||
def self.english_name
|
def self.english_name
|
||||||
"Generic Artifact"
|
"Generic Artifact"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `audio_unit_plugin` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class AudioUnitPlugin < Moved
|
class AudioUnitPlugin < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/symlinked"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `binary` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Binary < Symlinked
|
class Binary < Symlinked
|
||||||
def link(command: nil, **options)
|
def link(command: nil, **options)
|
||||||
super(command: command, **options)
|
super(command: command, **options)
|
||||||
|
|||||||
@ -3,6 +3,9 @@
|
|||||||
require "cask/artifact/moved"
|
require "cask/artifact/moved"
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
|
# Artifact corresponding to the `colorpicker` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
module Artifact
|
module Artifact
|
||||||
class Colorpicker < Moved
|
class Colorpicker < Moved
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `dictionary` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Dictionary < Moved
|
class Dictionary < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `font` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Font < Moved
|
class Font < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `input_method` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class InputMethod < Moved
|
class InputMethod < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,12 +7,16 @@ using HashValidator
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `installer` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Installer < AbstractArtifact
|
class Installer < AbstractArtifact
|
||||||
VALID_KEYS = Set.new([
|
VALID_KEYS = Set.new([
|
||||||
:manual,
|
:manual,
|
||||||
:script,
|
:script,
|
||||||
]).freeze
|
]).freeze
|
||||||
|
|
||||||
|
# Extension module for manual installers.
|
||||||
module ManualInstaller
|
module ManualInstaller
|
||||||
def install_phase(**)
|
def install_phase(**)
|
||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
@ -23,6 +27,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Extension module for script installers.
|
||||||
module ScriptInstaller
|
module ScriptInstaller
|
||||||
def install_phase(command: nil, **_)
|
def install_phase(command: nil, **_)
|
||||||
ohai "Running #{self.class.dsl_key} script '#{path}'"
|
ohai "Running #{self.class.dsl_key} script '#{path}'"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `internet_plugin` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class InternetPlugin < Moved
|
class InternetPlugin < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/symlinked"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `manpage` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Manpage < Symlinked
|
class Manpage < Symlinked
|
||||||
attr_reader :section
|
attr_reader :section
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `mdimporter` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Mdimporter < Moved
|
class Mdimporter < Moved
|
||||||
def self.english_name
|
def self.english_name
|
||||||
"Spotlight metadata importer"
|
"Spotlight metadata importer"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/relocated"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Superclass for all artifacts which are installed by moving them to the target location.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Moved < Relocated
|
class Moved < Relocated
|
||||||
def self.english_description
|
def self.english_description
|
||||||
"#{english_name}s"
|
"#{english_name}s"
|
||||||
|
|||||||
@ -10,6 +10,9 @@ using HashValidator
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `pkg` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Pkg < AbstractArtifact
|
class Pkg < AbstractArtifact
|
||||||
attr_reader :pkg_relative_path, :path, :stanza_options
|
attr_reader :pkg_relative_path, :path, :stanza_options
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_flight_block"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `postflight` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class PostflightBlock < AbstractFlightBlock
|
class PostflightBlock < AbstractFlightBlock
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_flight_block"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `preflight` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class PreflightBlock < AbstractFlightBlock
|
class PreflightBlock < AbstractFlightBlock
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `prefpane` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Prefpane < Moved
|
class Prefpane < Moved
|
||||||
def self.english_name
|
def self.english_name
|
||||||
"Preference Pane"
|
"Preference Pane"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `qlplugin` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Qlplugin < Moved
|
class Qlplugin < Moved
|
||||||
def self.english_name
|
def self.english_name
|
||||||
"QuickLook Plugin"
|
"QuickLook Plugin"
|
||||||
|
|||||||
@ -7,6 +7,9 @@ using HashValidator
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Superclass for all artifacts which have a source and a target location.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Relocated < AbstractArtifact
|
class Relocated < AbstractArtifact
|
||||||
def self.from_args(cask, *args)
|
def self.from_args(cask, *args)
|
||||||
source_string, target_hash = args
|
source_string, target_hash = args
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `screen_saver` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class ScreenSaver < Moved
|
class ScreenSaver < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `service` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Service < Moved
|
class Service < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_artifact"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `stage_only` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class StageOnly < AbstractArtifact
|
class StageOnly < AbstractArtifact
|
||||||
def self.from_args(cask, *args)
|
def self.from_args(cask, *args)
|
||||||
raise CaskInvalidError.new(cask.token, "'stage_only' takes only a single argument: true") if args != [true]
|
raise CaskInvalidError.new(cask.token, "'stage_only' takes only a single argument: true") if args != [true]
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `suite` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Suite < Moved
|
class Suite < Moved
|
||||||
def self.english_name
|
def self.english_name
|
||||||
"App Suite"
|
"App Suite"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/relocated"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Superclass for all artifacts which are installed by symlinking them to the target location.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Symlinked < Relocated
|
class Symlinked < Relocated
|
||||||
def self.link_type_english_name
|
def self.link_type_english_name
|
||||||
"Symlink"
|
"Symlink"
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_uninstall"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `uninstall` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Uninstall < AbstractUninstall
|
class Uninstall < AbstractUninstall
|
||||||
def uninstall_phase(**options)
|
def uninstall_phase(**options)
|
||||||
ORDERED_DIRECTIVES.reject { |directive_sym| directive_sym == :rmdir }
|
ORDERED_DIRECTIVES.reject { |directive_sym| directive_sym == :rmdir }
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `vst3_plugin` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Vst3Plugin < Moved
|
class Vst3Plugin < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/moved"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `vst_plugin` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class VstPlugin < Moved
|
class VstPlugin < Moved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4,6 +4,9 @@ require "cask/artifact/abstract_uninstall"
|
|||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
module Artifact
|
module Artifact
|
||||||
|
# Artifact corresponding to the `zap` stanza.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Zap < AbstractUninstall
|
class Zap < AbstractUninstall
|
||||||
def zap_phase(**options)
|
def zap_phase(**options)
|
||||||
dispatch_uninstall_directives(**options)
|
dispatch_uninstall_directives(**options)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user