diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-01 09:41:32 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-01 09:41:32 +0000 |
commit | 25a9b62d45ddd60a231272567c7dda9337da9b62 (patch) | |
tree | e72ba4c9c01cba5fb510eb1eafaba76d998baf4c /lib/rubygems/spec_fetcher.rb | |
parent | 86bb0af7ea3b50f72e6845a6f5f64cb1b23fd279 (diff) | |
download | ruby-25a9b62d45ddd60a231272567c7dda9337da9b62.tar.gz |
Import rubygems 1.6.0 (released version @ 58d8a0b9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index c999a65cd9..ab05c2f9dd 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) - File.join @dir, "#{uri.host}%#{uri.port}", File.dirname(uri.path) + escaped_path = uri.path.sub(%r[^/([a-z]):/]i, '/\\1-/') # Correct for windows paths + File.join @dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path) end ## @@ -100,6 +101,7 @@ class Gem::SpecFetcher end def fetch_spec(spec, source_uri) + source_uri = URI.parse source_uri if String === source_uri spec = spec - [nil, 'ruby', ''] spec_file_name = "#{spec.join '-'}.gemspec" @@ -179,7 +181,7 @@ class Gem::SpecFetcher def suggest_gems_from_name gem_name gem_name = gem_name.downcase max = gem_name.size / 2 - specs = list.values.flatten(1) # flatten(1) is 1.8.7 and up + specs = list.values.flatten 1 matches = specs.map { |name, version, platform| next unless Gem::Platform.match platform |