method
handle_conflict
v2_1_10 -
Show latest stable
- Class:
Gem::Resolver
handle_conflict(dep, existing)public
No documentation available.
# File lib/rubygems/resolver.rb, line 194
def handle_conflict(dep, existing) # :nodoc:
# There is a conflict! We return the conflict object which will be seen by
# the caller and be handled at the right level.
# If the existing activation indicates that there are other possibles for
# it, then issue the conflict on the dependency for the activation itself.
# Otherwise, if there was a requester, issue it on the requester's
# request itself.
# Finally, if the existing request has no requester (toplevel) unwind to
# it anyway.
if existing.others_possible?
conflict =
Gem::Resolver::Conflict.new dep, existing
elsif dep.requester
depreq = dep.requester.request
conflict =
Gem::Resolver::Conflict.new depreq, existing, dep
elsif existing.request.requester.nil?
conflict =
Gem::Resolver::Conflict.new dep, existing
else
raise Gem::DependencyError, "Unable to figure out how to unwind conflict"
end
@conflicts << conflict unless @conflicts.include? conflict
return conflict
end