[rubygems/rubygems] OpenSSL::Digest is always provided after Ruby 2.4
https://github.com/rubygems/rubygems/commit/4f2f2ad412
This commit is contained in:
parent
09041a6ee8
commit
b528ecc164
@ -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
|
||||
|
||||
##
|
||||
|
Loading…
x
Reference in New Issue
Block a user