mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 18:13:58 +02:00
* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
in this commit: RubyGems now chooses the test server port reliably. Patch by akr. Partial implementation of bundler's Gemfile format. Refactorings to improve the new resolver. Fixes bugs in the resolver. * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
31d355aaa9
commit
4f6779bac7
75 changed files with 3143 additions and 616 deletions
|
@ -47,11 +47,21 @@ class Gem::DependencyResolver::ActivationRequest
|
|||
end
|
||||
|
||||
def inspect # :nodoc:
|
||||
others_possible = nil
|
||||
others_possible = ' (others possible)' if @others_possible
|
||||
others =
|
||||
case @others_possible
|
||||
when true then # TODO remove at RubyGems 3
|
||||
' (others possible)'
|
||||
when false then # TODO remove at RubyGems 3
|
||||
nil
|
||||
else
|
||||
unless @others_possible.empty? then
|
||||
others = @others_possible.map { |s| s.full_name }
|
||||
" (others possible: #{others.join ', '})"
|
||||
end
|
||||
end
|
||||
|
||||
'#<%s for %p from %s%s>' % [
|
||||
self.class, @spec, @request, others_possible
|
||||
self.class, @spec, @request, others
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -59,10 +69,15 @@ class Gem::DependencyResolver::ActivationRequest
|
|||
# Indicates if the requested gem has already been installed.
|
||||
|
||||
def installed?
|
||||
this_spec = full_spec
|
||||
case @spec
|
||||
when Gem::DependencyResolver::VendorSpecification then
|
||||
true
|
||||
else
|
||||
this_spec = full_spec
|
||||
|
||||
Gem::Specification.any? do |s|
|
||||
s == this_spec
|
||||
Gem::Specification.any? do |s|
|
||||
s == this_spec
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -75,7 +90,12 @@ class Gem::DependencyResolver::ActivationRequest
|
|||
# requests for the same Dependency request.
|
||||
|
||||
def others_possible?
|
||||
@others_possible
|
||||
case @others_possible
|
||||
when true, false then
|
||||
@others_possible
|
||||
else
|
||||
not @others_possible.empty?
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -95,9 +115,18 @@ class Gem::DependencyResolver::ActivationRequest
|
|||
q.text ' for '
|
||||
q.pp @request
|
||||
|
||||
|
||||
q.breakable
|
||||
q.text ' (other possible)' if @others_possible
|
||||
case @others_possible
|
||||
when false then
|
||||
when true then
|
||||
q.breakable
|
||||
q.text 'others possible'
|
||||
else
|
||||
unless @others_possible.empty? then
|
||||
q.breakable
|
||||
q.text 'others '
|
||||
q.pp @others_possible.map { |s| s.full_name }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue