Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retire support for no_checksum stanza #4689

Merged
merged 1 commit into from
Jun 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions doc/CASK_LANGUAGE_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ Each Cask must declare one or more *artifacts* (i.e. something to install)

## Legacy Stanzas

The following stanzas may be seen in current use but are deprecated
and slated for retirement.
The following stanzas are no longer in use.

| name | multiple occurrences allowed? | meaning |
| ------------------ |------------------------------ | ----------- |
Expand Down Expand Up @@ -169,8 +168,8 @@ And the following methods may be useful for interpolation:

## Checksum Stanza Details

Older Casks may still use `no_checksum` stanzas. This is OK, but new
Casks and updates should adopt `sha256 :no_check`.
Casks should no longer use `no_checksum` stanzas. That form has
been superseded by `sha256 :no_check`.


## URL Stanza Details
Expand Down
12 changes: 0 additions & 12 deletions lib/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ def hash_name(hash_type)
end

def sha256(sha2=nil)
# @@@ todo remove this after deleting support for legacy no_checksum stanza
if @sums == :no_check
raise CaskInvalidError.new(self.title, "'no_checksum' stanza conflicts with 'sha256'")
end
if sha2 == :no_check
@sums = sha2
else
Expand All @@ -152,14 +148,6 @@ def sha256(sha2=nil)
end
end

# @@@ todo remove support for no_checksum stanza
def no_checksum
unless @sums.nil? or @sums.empty?
raise CaskInvalidError.new(self.title, "'no_checksum' stanza conflicts with '#{hash_name(@sums.first.hash_type)}'")
end
@sums = :no_check
end

def method_missing(method, *args)
poo = <<-EOPOO.undent
Unexpected method '#{method}' called on #{self}.
Expand Down
16 changes: 0 additions & 16 deletions test/cask/dsl_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,4 @@ def caveats; <<-EOS.undent
}.must_raise(CaskInvalidError)
err.message.must_include "'version' stanza may only appear once"
end

# @@@ todo this test can be removed when support for no_checksum is dropped
it "prevents defining conflicting checksums (first order)" do
err = lambda {
invalid_cask = Cask.load('invalid/invalid-checksum-conflict1')
}.must_raise(CaskInvalidError)
err.message.must_include "'no_checksum' stanza conflicts with"
end

# @@@ todo this test can be removed when support for no_checksum is dropped
it "prevents defining conflicting checksums (second order)" do
err = lambda {
invalid_cask = Cask.load('invalid/invalid-checksum-conflict2')
}.must_raise(CaskInvalidError)
err.message.must_include "'no_checksum' stanza conflicts with"
end
end
9 changes: 0 additions & 9 deletions test/support/Casks/invalid/invalid-checksum-conflict1.rb

This file was deleted.

9 changes: 0 additions & 9 deletions test/support/Casks/invalid/invalid-checksum-conflict2.rb

This file was deleted.