diff --git a/lib/cask/artifact.rb b/lib/cask/artifact.rb index bfb16b005f21..3bd17a8df005 100644 --- a/lib/cask/artifact.rb +++ b/lib/cask/artifact.rb @@ -21,7 +21,7 @@ module Cask::Artifact; end require 'cask/artifact/input_method' require 'cask/artifact/screen_saver' require 'cask/artifact/uninstall' - +require 'cask/artifact/zap' module Cask::Artifact # @@ -46,6 +46,7 @@ def self.artifacts Cask::Artifact::ScreenSaver, Cask::Artifact::Uninstall, Cask::Artifact::AfterBlock, + Cask::Artifact::Zap, ] end diff --git a/lib/cask/artifact/zap.rb b/lib/cask/artifact/zap.rb new file mode 100644 index 000000000000..9aefc3b87f77 --- /dev/null +++ b/lib/cask/artifact/zap.rb @@ -0,0 +1,13 @@ +class Cask::Artifact::Zap < Cask::Artifact::UninstallBase + def install_phase + odebug "Nothing to do. The zap artifact has no install phase." + end + + def uninstall_phase + odebug "Nothing to do. The zap artifact has no uninstall phase." + end + + def zap_phase + dispatch_uninstall_directives(self.class.artifact_dsl_key) + end +end diff --git a/lib/cask/dsl.rb b/lib/cask/dsl.rb index 8d00ed97f93f..412a49f7c2ef 100644 --- a/lib/cask/dsl.rb +++ b/lib/cask/dsl.rb @@ -121,7 +121,8 @@ def self.ordinary_artifact_types SPECIAL_ARTIFACT_TYPES = [ :nested_container, - :uninstall + :uninstall, + :zap, ] SPECIAL_ARTIFACT_TYPES.each do |type|