From b528ecc164b0b4975f61d626d3bc60d9555d3d18 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 Mar 2023 15:10:12 +0900 Subject: [PATCH] [rubygems/rubygems] OpenSSL::Digest is always provided after Ruby 2.4 https://github.com/rubygems/rubygems/commit/4f2f2ad412 --- lib/rubygems/security.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index 3ba8c6957c..5dda8fa14f 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -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 ##