diff options
| author | David Rodriguez <deivid.rodriguez@riseup.net> | 2021-10-10 17:21:53 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-10-25 20:48:52 +0900 |
| commit | 9d286180916e23bb2d9e6bf43cd75f439a1939ce (patch) | |
| tree | 3177653b7c9af3c7012caa80548e10beafeba4c7 /lib | |
| parent | a959342abf3c77fc5f08a91107f5f27cfe1766a7 (diff) | |
[rubygems/rubygems] Avoid loading the `digest` gem unnecessarily
OpenSSL includes what we need.
https://github.com/rubygems/rubygems/commit/955f3b72ca
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rubygems/s3_uri_signer.rb | 3 | ||||
| -rw-r--r-- | lib/rubygems/source/git.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/rubygems/s3_uri_signer.rb b/lib/rubygems/s3_uri_signer.rb index da2af5f326..4d1deee997 100644 --- a/lib/rubygems/s3_uri_signer.rb +++ b/lib/rubygems/s3_uri_signer.rb @@ -1,4 +1,3 @@ -require 'digest' require_relative 'openssl' ## @@ -87,7 +86,7 @@ class Gem::S3URISigner "AWS4-HMAC-SHA256", date_time, credential_info, - Digest::SHA256.hexdigest(canonical_request), + OpenSSL::Digest::SHA256.hexdigest(canonical_request), ].join("\n") end diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb index 95dee9b883..cda5aa8073 100644 --- a/lib/rubygems/source/git.rb +++ b/lib/rubygems/source/git.rb @@ -225,7 +225,7 @@ class Gem::Source::Git < Gem::Source # A hash for the git gem based on the git repository URI. def uri_hash # :nodoc: - require 'digest' + require_relative '../openssl' normalized = if @repository =~ %r{^\w+://(\w+@)?} @@ -235,6 +235,6 @@ class Gem::Source::Git < Gem::Source @repository end - Digest::SHA1.hexdigest normalized + OpenSSL::Digest::SHA1.hexdigest normalized end end |
