summaryrefslogtreecommitdiff
path: root/lib/rubygems/spec_fetcher.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-09 22:32:29 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-09 22:32:29 +0000
commit6e5f49770c9b9be151e3142a575abe99a69b0d14 (patch)
tree15495cf2652a8a3d2010ace89b0813e8589341bd /lib/rubygems/spec_fetcher.rb
parent08c07a215d3d4b5e26293d9d52bc06b486f15844 (diff)
Import rubygems 1.6.2 (release candidate @ 2026fbb5)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r--lib/rubygems/spec_fetcher.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
index ab05c2f9dd..6c71ee63aa 100644
--- a/lib/rubygems/spec_fetcher.rb
+++ b/lib/rubygems/spec_fetcher.rb
@@ -76,7 +76,8 @@ class Gem::SpecFetcher
# Returns the local directory to write +uri+ to.
def cache_dir(uri)
- escaped_path = uri.path.sub(%r[^/([a-z]):/]i, '/\\1-/') # Correct for windows paths
+ # Correct for windows paths
+ escaped_path = uri.path.sub(/^\/([a-z]):\//i, '/\\1-/')
File.join @dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
end
@@ -86,8 +87,14 @@ class Gem::SpecFetcher
# false, all platforms are returned. If +prerelease+ is true,
# prerelease versions are included.
- def fetch_with_errors(dependency, all = false, matching_platform = true, prerelease = false)
- specs_and_sources, errors = find_matching_with_errors dependency, all, matching_platform, prerelease
+ def fetch_with_errors(dependency,
+ all = false,
+ matching_platform = true,
+ prerelease = false)
+ specs_and_sources, errors = find_matching_with_errors(dependency,
+ all,
+ matching_platform,
+ prerelease)
ss = specs_and_sources.map do |spec_tuple, source_uri|
[fetch_spec(spec_tuple, URI.parse(source_uri)), source_uri]