Skip to content

Commit

Permalink
Merge pull request #2931 from rolandwalker/remove_md5
Browse files Browse the repository at this point in the history
remove md5 checksum support
  • Loading branch information
rolandwalker committed Feb 22, 2014
2 parents c4479a7 + 15f437e commit 6050032
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
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

0 comments on commit 6050032

Please sign in to comment.