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 +4 -4
- data/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/molinillo/resolution.rb +12 -10
- data/spec/resolver_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f53e46c97a53227bf496401139787e902f29c31c
|
4
|
+
data.tar.gz: 4c702b61c8eb41ddbcb899579e226588ca6ea8c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 531ffbe26a13d5c3d9883b4de8b0f5d01d3df2aeba3b6f6bfe5ebbbed06187f0594aab1532268894ad8e7f12bef790cc68ebc8e1ef0ebd2e86eac8f74c3a0941
|
7
|
+
data.tar.gz: 1323d5f6cad31427e8bf44e07237de6ee8f9c1f272ec3a2ad803cd33684f634f4d0f6d86013fc49c84c981bddf856638eab1dda7906a397712e9fb8854660a31
|
data/lib/molinillo/resolution.rb
CHANGED
@@ -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
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
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
|
-
|
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
|
data/spec/resolver_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|