Skip to content

Commit

Permalink
Merge pull request #4869 from rolandwalker/add_zap_stanza
Browse files Browse the repository at this point in the history
DSL: add `zap` stanza
  • Loading branch information
rolandwalker committed Jun 28, 2014
2 parents aeb7f83 + 64313c7 commit caeeaf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/cask/artifact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -46,6 +46,7 @@ def self.artifacts
Cask::Artifact::ScreenSaver,
Cask::Artifact::Uninstall,
Cask::Artifact::AfterBlock,
Cask::Artifact::Zap,
]
end

Expand Down
13 changes: 13 additions & 0 deletions lib/cask/artifact/zap.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion lib/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def self.ordinary_artifact_types

SPECIAL_ARTIFACT_TYPES = [
:nested_container,
:uninstall
:uninstall,
:zap,
]

SPECIAL_ARTIFACT_TYPES.each do |type|
Expand Down

0 comments on commit caeeaf2

Please sign in to comment.