mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
openssl/digest.rb: get rid of deprecated class
* ext/openssl/lib/openssl/digest.rb (digest, hexdigest): create new instance and call on it directly, to get rid of deprecated class OpenSSL::Digest::Digest. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40d7c9c18b
commit
0ede9926f7
2 changed files with 4 additions and 4 deletions
|
@ -38,7 +38,7 @@ module OpenSSL
|
|||
# OpenSSL::Digest::SHA256.digest("abc")
|
||||
|
||||
def self.digest(name, data)
|
||||
super(data, name)
|
||||
super(data, name)
|
||||
end
|
||||
|
||||
alg.each{|name|
|
||||
|
@ -53,8 +53,8 @@ module OpenSSL
|
|||
}
|
||||
singleton = (class << klass; self; end)
|
||||
singleton.class_eval{
|
||||
define_method(:digest){|data| Digest.digest(name, data) }
|
||||
define_method(:hexdigest){|data| Digest.hexdigest(name, data) }
|
||||
define_method(:digest){|data| new.digest(data) }
|
||||
define_method(:hexdigest){|data| new.hexdigest(data) }
|
||||
}
|
||||
const_set(name, klass)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue