diff options
author | Andre Arko <andre@arko.net> | 2015-12-28 17:06:11 +0800 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-25 10:49:51 -0600 |
commit | 4ee51af3f45e309d3f61200c7c75206c8acaaf00 (patch) | |
tree | 131271377923d3026c6d8b4da73c0059e51e093b | |
parent | 5314eb651b72664c16e55cd64fab87b6f8cf3fe3 (diff) | |
download | bundler-4ee51af3f45e309d3f61200c7c75206c8acaaf00.tar.gz |
turns out URI#hostname is 1.9+, URI#host is 1.8+
-rw-r--r-- | lib/bundler/fetcher/compact_index.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 6932ea2c85..9fb8d8dd79 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -63,15 +63,16 @@ module Bundler def compact_index_client @compact_index_client ||= begin - uri_part = [display_uri.hostname, display_uri.port, Digest::MD5.hexdigest(display_uri.path)].compact.join(".") + path_digest = Digest::MD5.hexdigest(display_uri.path) + uri_part = [display_uri.host, display_uri.port, path_digest].compact.join(".") + index_path = Bundler.user_cache + "compact_index" + uri_part compact_fetcher = lambda do |path, headers| downloader.fetch(fetch_uri + path, headers) end - path = Bundler.user_cache + "compact_index" + uri_part - SharedHelpers.filesystem_access(path) do - CompactIndexClient.new(path, compact_fetcher) + SharedHelpers.filesystem_access(index_path) do + CompactIndexClient.new(index_path, compact_fetcher) end end end |