summaryrefslogtreecommitdiff
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-10-15 11:37:41 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-10-15 11:37:41 -0500
commit9e3e39896f9c682782fcc00bd27f81e2a284b2bb (patch)
tree61c7b754b0dad4feac32b4c799da8676f1d88a2d /lib/bundler/source
parentfea177f61df71121c6f9422a74b093e42c504388 (diff)
downloadbundler-9e3e39896f9c682782fcc00bd27f81e2a284b2bb.tar.gz
Load digest subclasses in a thread-safe mannerseg-digest-loading
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/git.rb4
-rw-r--r--lib/bundler/source/rubygems/remote.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 97bc1724a0..d9f658d8bb 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -2,7 +2,7 @@
require "bundler/vendored_fileutils"
require "uri"
-require "digest/sha1"
+require "digest"
module Bundler
class Source
@@ -284,7 +284,7 @@ module Bundler
# If there is no URI scheme, assume it is an ssh/git URI
input = uri
end
- Digest::SHA1.hexdigest(input)
+ Digest(:SHA1).hexdigest(input)
end
def cached_revision
diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb
index 67f4f373db..9ee1a53eea 100644
--- a/lib/bundler/source/rubygems/remote.rb
+++ b/lib/bundler/source/rubygems/remote.rb
@@ -26,7 +26,7 @@ module Bundler
cache_uri = original_uri || uri
uri_parts = [cache_uri.host, cache_uri.user, cache_uri.port, cache_uri.path]
- uri_digest = Digest::MD5.hexdigest(uri_parts.compact.join("."))
+ uri_digest = Digest(:MD5).hexdigest(uri_parts.compact.join("."))
uri_parts[-1] = uri_digest
uri_parts.compact.join(".")