[rubygems/rubygems] OpenSSL::Digest is always provided after Ruby 2.4

https://github.com/rubygems/rubygems/commit/4f2f2ad412
This commit is contained in:
Hiroshi SHIBATA 2023-03-15 15:10:12 +09:00 committed by git
parent 09041a6ee8
commit b528ecc164

View File

@ -461,16 +461,8 @@ module Gem::Security
# Creates a new digest instance using the specified +algorithm+. The default
# is SHA256.
if defined?(OpenSSL::Digest)
def self.create_digest(algorithm = DIGEST_NAME)
OpenSSL::Digest.new(algorithm)
end
else
require "digest"
def self.create_digest(algorithm = DIGEST_NAME)
Digest.const_get(algorithm).new
end
def self.create_digest(algorithm = DIGEST_NAME)
OpenSSL::Digest.new(algorithm)
end
##