binding_requirements_for_conflict(conflict)
private
@param [Conflict] conflict
@return [Array] minimal array of requirements
that would cause the passed
conflict to occur.
Show source
def binding_requirements_for_conflict(conflict)
return [conflict.requirement] if conflict.possibility.nil?
possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
return possible_binding_requirements if conflict.underlying_error
possibilities = search_for(conflict.requirement)
if binding_requirement_in_set?(nil, possible_binding_requirements, possibilities)
return [conflict.requirement, requirement_for_existing_name(name_for(conflict.requirement))].compact
end
binding_requirements = possible_binding_requirements.dup
possible_binding_requirements.reverse_each do |req|
next if req == conflict.requirement
unless binding_requirement_in_set?(req, binding_requirements, possibilities)
binding_requirements -= [req]
end
end
binding_requirements
end