method

handle_conflict

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: Resolver
handle_conflict(dep, existing) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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
Register or log in to add new notes.