molinillo 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 201374a6119011f4e8aad27f0c594fd27a210707
4
- data.tar.gz: d2ae554dca78b440d312ead38410706198eb2a2c
3
+ metadata.gz: f53e46c97a53227bf496401139787e902f29c31c
4
+ data.tar.gz: 4c702b61c8eb41ddbcb899579e226588ca6ea8c1
5
5
  SHA512:
6
- metadata.gz: 53c5b13bda9d0865e3d0b2d836325db2548757d9e145798401cbd59737e6378c30d46378c65a683742e0db8aa903629d002a839bacad78320ccf5dfd2e81f541
7
- data.tar.gz: bfc7c83391e307a8dbb03321c356cb300c75ad3e27c1ddda1ee207467dabe1089a8671f6c95f35de6b2a9cb4d4e5fe0d41a7bb68724254e38d3cbbc4defae685
6
+ metadata.gz: 531ffbe26a13d5c3d9883b4de8b0f5d01d3df2aeba3b6f6bfe5ebbbed06187f0594aab1532268894ad8e7f12bef790cc68ebc8e1ef0ebd2e86eac8f74c3a0941
7
+ data.tar.gz: 1323d5f6cad31427e8bf44e07237de6ee8f9c1f272ec3a2ad803cd33684f634f4d0f6d86013fc49c84c981bddf856638eab1dda7906a397712e9fb8854660a31
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Molinillo
3
3
  # The version of Molinillo.
4
- VERSION = '0.5.3'.freeze
4
+ VERSION = '0.5.4'.freeze
5
5
  end
@@ -194,18 +194,20 @@ module Molinillo
194
194
  def state_index_for_unwind
195
195
  current_requirement = requirement
196
196
  existing_requirement = requirement_for_existing_name(name)
197
- until current_requirement.nil?
198
- current_state = find_state_for(current_requirement)
199
- return states.index(current_state) if state_any?(current_state)
200
- current_requirement = parent_of(current_requirement)
197
+ index = -1
198
+ [current_requirement, existing_requirement].each do |r|
199
+ until r.nil?
200
+ current_state = find_state_for(r)
201
+ if state_any?(current_state)
202
+ current_index = states.index(current_state)
203
+ index = current_index if current_index > index
204
+ break
205
+ end
206
+ r = parent_of(r)
207
+ end
201
208
  end
202
209
 
203
- until existing_requirement.nil?
204
- existing_state = find_state_for(existing_requirement)
205
- return states.index(existing_state) if state_any?(existing_state)
206
- existing_requirement = parent_of(existing_requirement)
207
- end
208
- -1
210
+ index
209
211
  end
210
212
 
211
213
  # @return [Object] the requirement that led to `requirement` being added
@@ -242,6 +242,19 @@ module Molinillo
242
242
  expect(resolved.map(&:payload).map(&:to_s).sort).to eq(expected.sort)
243
243
  end
244
244
 
245
+ it 'can unwind when the conflict has a common parent' do
246
+ index = BundlerIndex.new('rubygems-2016-11-05')
247
+ @resolver = described_class.new(index, TestUI.new)
248
+ demands = [
249
+ VersionKit::Dependency.new('github-pages', '>= 0'),
250
+ ]
251
+ demands.each { |d| index.search_for(d) }
252
+
253
+ resolved = @resolver.resolve(demands, DependencyGraph.new)
254
+
255
+ expect(resolved.map(&:payload).map(&:to_s).sort).to include('github-pages (104.0.0)')
256
+ end
257
+
245
258
  it 'can resolve when swapping changes transitive dependencies' do
246
259
  index = TestIndex.new('restkit')
247
260
  def index.sort_dependencies(dependencies, activated, conflicts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: molinillo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel E. Giddins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-28 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler