Skip to content

Commit

Permalink
add zap stanza to DSL
Browse files Browse the repository at this point in the history
The zap functionality here is in working form, but there is not a
corresponding `brew cask zap` command verb, which is to be supplied
in a separate PR.

Like other forward-compatible DSL extensions, it is intentionally
undocumented.

References: #4688
  • Loading branch information
rolandwalker committed Jun 28, 2014
1 parent 0d01d35 commit 64313c7
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 @@ -121,7 +121,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 64313c7

Please sign in to comment.