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

remove md5 checksum support #2931

Merged
merged 1 commit into from
Feb 22, 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
8 changes: 0 additions & 8 deletions lib/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ def hash_name(hash_type)
hash_type.to_s == 'sha2' ? 'sha256' : hash_type.to_s
end

def md5(md5=nil)
if @sums == 0
raise CaskInvalidError.new(self.title, "'no_checksum' stanza conflicts with 'md5'")
end
@sums ||= []
@sums << Checksum.new(:md5, md5) unless md5.nil?
end

def sha1(sha1=nil)
if @sums == 0
raise CaskInvalidError.new(self.title, "'no_checksum' stanza conflicts with 'sha1'")
Expand Down
4 changes: 1 addition & 3 deletions test/cask/dsl_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
test_cask.version.must_equal '1.2.3'
end

it "lets you set checksum via sha1, sha256, and/or md5" do
it "lets you set checksum via sha1 and/or sha256" do
ChecksumCask = Class.new(Cask)
ChecksumCask.class_eval do
md5 'imamd5'
sha1 'imasha1'
sha256 'imasha2'
end
instance = ChecksumCask.new
instance.sums.must_equal [
Checksum.new(:md5, 'imamd5'),
Checksum.new(:sha1, 'imasha1'),
Checksum.new(:sha2, 'imasha2')
]
Expand Down