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