mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
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
This commit is contained in:
parent
86bb0af7ea
commit
25a9b62d45
73 changed files with 2408 additions and 719 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue