diff options
author | Homu <homu@barosl.com> | 2016-04-30 12:39:06 +0900 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-04-30 02:04:04 -0500 |
commit | 0c8a516e61fb0ca6cec34e7b3663d95e29c8bb23 (patch) | |
tree | ad5e3b73aaefcbaea7c4c7804c1f5350f513bc16 | |
parent | c75caa0d8050d18cc43dac05c98ca8945206e49d (diff) | |
download | bundler-0c8a516e61fb0ca6cec34e7b3663d95e29c8bb23.tar.gz |
Auto merge of #4490 - bundler:seg-molinillo-0.4.5, r=segiddins
Update vendored Molinillo to 0.4.5
Closes https://github.com/bundler/bundler/issues/4484.
See https://github.com/CocoaPods/Molinillo/releases/0.4.5.
4 files changed, 18 insertions, 12 deletions
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb index d57ad18919..8f416d54a6 100644 --- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb @@ -16,7 +16,7 @@ module Bundler::Molinillo include TSort # @visibility private - alias_method :tsort_each_node, :each + alias tsort_each_node each # @visibility private def tsort_each_child(vertex, &block) @@ -184,7 +184,7 @@ module Bundler::Molinillo # @return [Boolean] whether the vertex is considered a root vertex attr_accessor :root - alias_method :root?, :root + alias root? root # Initializes a vertex with the given name and payload. # @param [String] name see {#name} @@ -262,7 +262,7 @@ module Bundler::Molinillo payload == other.payload end - alias_method :eql?, :== + alias eql? == # @return [Fixnum] a hash for the vertex based upon its {#name} def hash @@ -276,7 +276,7 @@ module Bundler::Molinillo equal?(other) || successors.any? { |v| v.path_to?(other) } end - alias_method :descendent?, :path_to? + alias descendent? path_to? # Is there a path from `other` to `self` following edges in the # dependency graph? @@ -285,7 +285,7 @@ module Bundler::Molinillo other.path_to?(self) end - alias_method :is_reachable_from?, :ancestor? + alias is_reachable_from? ancestor? end end end diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb b/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb index 6b71c77157..f904bd0814 100644 --- a/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +++ b/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb @@ -26,7 +26,7 @@ module Bundler::Molinillo def message sources = required_by.map { |r| "`#{r}`" }.join(' and ') message = "Unable to find a specification for `#{dependency}`" - message << " depended upon by #{sources}" unless sources.empty? + message += " depended upon by #{sources}" unless sources.empty? message end end diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb index 3f4ba13de2..5e88b2b3a1 100644 --- a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +++ b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Bundler::Molinillo # The version of Bundler::Molinillo. - VERSION = '0.4.3'.freeze + VERSION = '0.4.5'.freeze end diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb index ddafc2b77c..14ce8702f9 100644 --- a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +++ b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb @@ -131,7 +131,7 @@ module Bundler::Molinillo specification_provider.send(instance_method, *args, &block) rescue NoSuchDependencyError => error if state - vertex = activated.vertex_named(name_for error.dependency) + vertex = activated.vertex_named(name_for(error.dependency)) error.required_by += vertex.incoming_edges.map { |e| e.origin.name } error.required_by << name_for_explicit_dependency_source unless vertex.explicit_requirements.empty? end @@ -345,7 +345,7 @@ module Bundler::Molinillo vertex = swapped.vertex_named(name) vertex.payload = possibility return unless vertex.requirements. - all? { |r| requirement_satisfied_by?(r, swapped, possibility) } + all? { |r| requirement_satisfied_by?(r, swapped, possibility) } return unless new_spec_satisfied? actual_vertex = activated.vertex_named(name) actual_vertex.payload = possibility @@ -363,7 +363,13 @@ module Bundler::Molinillo if !dep_names.include?(succ.name) && !succ.root? && succ.predecessors.to_a == [vertex] debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" } activated.detach_vertex_named(succ.name) - requirements.delete_if { |r| name_for(r) == succ.name } + + all_successor_names = succ.recursive_successors.map(&:name) + + requirements.delete_if do |requirement| + requirement_name = name_for(requirement) + (requirement_name == succ.name) || all_successor_names.include?(requirement_name) + end end end end @@ -420,14 +426,14 @@ module Bundler::Molinillo debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" } nested_dependencies.each { |d| activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d) } - push_state_for_requirements(requirements + nested_dependencies, nested_dependencies.size > 0) + push_state_for_requirements(requirements + nested_dependencies, !nested_dependencies.empty?) end # Pushes a new {DependencyState} that encapsulates both existing and new # requirements # @param [Array] new_requirements # @return [void] - def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated.dup) + def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated) new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort new_requirement = new_requirements.shift new_name = new_requirement ? name_for(new_requirement) : '' |