solve 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/solve/errors.rb +2 -1
- data/lib/solve/solver.rb +2 -2
- data/lib/solve/version.rb +1 -1
- 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: f8183623942ab701e9117e2912fd2fb4fefdfc19
|
4
|
+
data.tar.gz: a001a2bb59751962e18719575d3b59ff3192a753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 548d9980b3b6e1f32922abcc0da8fd5146cf02f220453d6633a57a30eb982a18198fb7f4e21f7cab995c208a61a55af4417dc7b7161f36d6e48a7c1c0fe2e8ee
|
7
|
+
data.tar.gz: b0009f814da7354eea4a7c0fc90b378fd477cc14ab6207c94b6782c1fe48b4ce349ba84831d36a4886dcfb233026edc4c2fe435eba04e5a63b555ba10a0f2bcd
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ A Ruby versioning constraint solver implementing [Semantic Versioning 2.0.0](htt
|
|
15
15
|
|
16
16
|
Create a new graph
|
17
17
|
|
18
|
-
graph = Graph.new
|
18
|
+
graph = Solve::Graph.new
|
19
19
|
|
20
20
|
Add an artifact to the graph
|
21
21
|
|
@@ -31,20 +31,20 @@ Dependencies can be chained, too
|
|
31
31
|
|
32
32
|
And now solve the graph with some demands
|
33
33
|
|
34
|
-
Solve.it!(graph, ['nginx', '>= 0.100.0'])
|
34
|
+
Solve.it!(graph, [['nginx', '>= 0.100.0']])
|
35
35
|
|
36
36
|
Or, if you want a topologically sorted solution
|
37
37
|
NOTE: This will raise Solve::Errors::UnsortableSolutionError if the solution contains a cycle (which can happen with ruby packages)
|
38
38
|
|
39
|
-
Solve.it!(graph, ['nginx', '>= 0.100.0'], sorted: true)
|
39
|
+
Solve.it!(graph, [['nginx', '>= 0.100.0']], sorted: true)
|
40
40
|
|
41
41
|
### Increasing the solver's timeout
|
42
42
|
|
43
|
-
By default the solver will wait
|
43
|
+
By default the solver will wait 30 seconds before giving up on finding a solution. Under certain conditions a graph may be too complicated to solve within the alotted time. To increase the timeout you can set the "SOLVE_TIMEOUT" environment variable to the amount of seconds desired.
|
44
44
|
|
45
|
-
$ export SOLVE_TIMEOUT=
|
45
|
+
$ export SOLVE_TIMEOUT=60
|
46
46
|
|
47
|
-
This will set the timeout to
|
47
|
+
This will set the timeout to 60 seconds instead of the default 30 seconds.
|
48
48
|
|
49
49
|
## Authors
|
50
50
|
|
data/lib/solve/errors.rb
CHANGED
@@ -43,7 +43,8 @@ module Solve
|
|
43
43
|
s << "#{@message}\n"
|
44
44
|
s << "Missing artifacts: #{missing_artifacts.join(',')}\n" unless missing_artifacts.empty?
|
45
45
|
unless constraints_excluding_all_artifacts.empty?
|
46
|
-
|
46
|
+
pretty = constraints_excluding_all_artifacts.map { |constraint| "(#{constraint[0]} #{constraint[1]})" }.join(',')
|
47
|
+
s << "Constraints that match no available version: #{pretty}\n"
|
47
48
|
end
|
48
49
|
s << "Demand that cannot be met: #{unsatisfiable_demand}\n" if unsatisfiable_demand
|
49
50
|
unless artifacts_with_no_satisfactory_version.empty?
|
data/lib/solve/solver.rb
CHANGED
@@ -10,7 +10,7 @@ module Solve
|
|
10
10
|
#
|
11
11
|
# @return [Integer]
|
12
12
|
def timeout
|
13
|
-
seconds =
|
13
|
+
seconds = 30 unless seconds = ENV["SOLVE_TIMEOUT"]
|
14
14
|
seconds.to_i * 1_000
|
15
15
|
end
|
16
16
|
end
|
@@ -146,7 +146,7 @@ module Solve
|
|
146
146
|
end
|
147
147
|
|
148
148
|
constrained_to_no_versions = e.constrained_to_no_versions.inject([]) do |list, constraint|
|
149
|
-
list << constraint.to_s
|
149
|
+
list << [constraint.package.name, constraint.constraint.to_s]
|
150
150
|
end
|
151
151
|
|
152
152
|
raise Solve::Errors::NoSolutionError.new(
|
data/lib/solve/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: semverse
|