Move MD5 deprecation warning into Pathname#md5
This way it will print when the verification takes place, making it a bit more obvious which formula it refers to.
This commit is contained in:
parent
7da376a50c
commit
c166ce3f58
@ -265,10 +265,6 @@ class SoftwareSpec
|
|||||||
if val.nil?
|
if val.nil?
|
||||||
@checksum if checksum.nil? or @checksum.hash_type == :md5
|
@checksum if checksum.nil? or @checksum.hash_type == :md5
|
||||||
else
|
else
|
||||||
opoo <<-EOS.undent
|
|
||||||
MD5 support is deprecated and will be removed in a future version.
|
|
||||||
Please switch this formula to #{Checksum::TYPES.map { |t| t.to_s.upcase } * ' or '}.
|
|
||||||
EOS
|
|
||||||
@checksum = Checksum.new(:md5, val)
|
@checksum = Checksum.new(:md5, val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -277,6 +273,10 @@ end
|
|||||||
class Pathname
|
class Pathname
|
||||||
def md5
|
def md5
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
|
opoo <<-EOS.undent
|
||||||
|
MD5 support is deprecated and will be removed in a future version.
|
||||||
|
Please switch this formula to #{Checksum::TYPES.map { |t| t.to_s.upcase } * ' or '}.
|
||||||
|
EOS
|
||||||
incremental_hash(Digest::MD5)
|
incremental_hash(Digest::MD5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user