Skip to content

Commit

Permalink
Auto merge of #1714 - rubygems:seg-molinillo-0.5.1, r=indirect
Browse files Browse the repository at this point in the history
Update vendored Molinillo to 0.5.1

# Description:

See https://github.com/CocoaPods/Molinillo/releases/0.5.1

# Tasks:

- [ ] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends
- [ ] [Squash commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
  • Loading branch information
homu authored and segiddins committed Sep 26, 2016
1 parent ccb9c33 commit 7da8bf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Gem::Resolver::Molinillo
# The version of Gem::Resolver::Molinillo.
VERSION = '0.5.0'.freeze
VERSION = '0.5.1'.freeze
end
10 changes: 8 additions & 2 deletions lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
Expand Up @@ -184,6 +184,8 @@ def unwind_for_conflict
raise VersionConflict.new(c) unless state
activated.rewind_to(sliced_states.first || :initial_state) if sliced_states
state.conflicts = c
index = states.size - 1
@parent_of.reject! { |_, i| i >= index }
end
end

Expand All @@ -209,7 +211,10 @@ def state_index_for_unwind
# @return [Object] the requirement that led to `requirement` being added
# to the list of requirements.
def parent_of(requirement)
@parent_of[requirement]
return unless requirement
return unless index = @parent_of[requirement]
return unless parent_state = @states[index]
parent_state.requirement
end

# @return [Object] the requirement that led to a version of a possibility
Expand Down Expand Up @@ -418,7 +423,8 @@ def require_nested_dependencies_for(activated_spec)
debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
nested_dependencies.each do |d|
activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d)
@parent_of[d] = requirement
parent_index = states.size - 1
@parent_of[d] ||= parent_index
end

push_state_for_requirements(requirements + nested_dependencies, !nested_dependencies.empty?)
Expand Down

0 comments on commit 7da8bf6

Please sign in to comment.