solve 4.0.2 → 4.0.3

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
  SHA256:
3
- metadata.gz: 8d35515fd9119f6f451de5165554d57a092dfd615e59671003d4643a92861fee
4
- data.tar.gz: b94522b8ff10788398b7b17b4cdf7deae31a8d9b660f3eee492639ffa58a3309
3
+ metadata.gz: ad7362ff0af6c2c0fe2ad74f7e132e095711e849a5e090caa58011c3cb20202b
4
+ data.tar.gz: 1d0b9bc0ac655338c9fc5f01b2e71b84f6faea85a59a8c7fb723a1e529a63d87
5
5
  SHA512:
6
- metadata.gz: f58510bea564487561836be9df3918273439b3a4ae21ced8130a4f2d6f38a6b558d8269ea6ba9bd06dc86cd1cd574229936289f5c2d575bb3a201a040b67e39b
7
- data.tar.gz: 3d42f049c4e13b0059e114fe30873c93c01e0c8a8a42fbb473620a3536e9eebae7864dd6bfe5608feb23e0584a824a5e79275e8bc57e44a231c931f622671633
6
+ metadata.gz: 5ee08341dc55ef8714590e2d73210591b884e7fff470407fd0ae02948cd1727f632430023abaf681778ff6e320b5efd879d34cbc12d3cd733ab986c148a84390
7
+ data.tar.gz: f4a260fa3c8edcab43ad8e86a0bbab53bde44dad49a8c6d4ae1fa07c8a4bd81e5bd5f02222268a5174d7df82b0dcd803608c16f5733fe5213b99301429e79557
@@ -41,6 +41,7 @@ module Solve
41
41
  else
42
42
  engine_class.activate
43
43
  end
44
+
44
45
  @engine = selected_engine
45
46
  end
46
47
 
@@ -128,12 +128,12 @@ module Solve
128
128
 
129
129
  OPERATOR_TYPES = {
130
130
  "~>" => :approx,
131
- "~" => :approx,
131
+ "~" => :approx,
132
132
  ">=" => :greater_than_equal,
133
133
  "<=" => :less_than_equal,
134
- "=" => :equal,
135
- ">" => :greater_than,
136
- "<" => :less_than,
134
+ "=" => :equal,
135
+ ">" => :greater_than,
136
+ "<" => :less_than,
137
137
  }.freeze
138
138
 
139
139
  COMPARE_FUNS = {
@@ -145,7 +145,7 @@ module Solve
145
145
  equal: method(:compare_equal),
146
146
  }.freeze
147
147
 
148
- REGEXP = /^(#{OPERATOR_TYPES.keys.join('|')})\s?(.+)$/
148
+ REGEXP = /^(#{OPERATOR_TYPES.keys.join('|')})\s?(.+)$/.freeze
149
149
 
150
150
  attr_reader :operator
151
151
  attr_reader :major
@@ -47,14 +47,14 @@ module Solve
47
47
  def to_s
48
48
  s = ""
49
49
  s << "#{@message}\n"
50
- s << "Missing artifacts: #{missing_artifacts.join(',')}\n" unless missing_artifacts.empty?
50
+ s << "Missing artifacts: #{missing_artifacts.join(",")}\n" unless missing_artifacts.empty?
51
51
  unless constraints_excluding_all_artifacts.empty?
52
52
  pretty = constraints_excluding_all_artifacts.map { |constraint| "(#{constraint[0]} #{constraint[1]})" }.join(",")
53
53
  s << "Constraints that match no available version: #{pretty}\n"
54
54
  end
55
55
  s << "Demand that cannot be met: #{unsatisfiable_demand}\n" if unsatisfiable_demand
56
56
  unless artifacts_with_no_satisfactory_version.empty?
57
- s << "Artifacts for which there are conflicting dependencies: #{artifacts_with_no_satisfactory_version.join(',')}"
57
+ s << "Artifacts for which there are conflicting dependencies: #{artifacts_with_no_satisfactory_version.join(",")}"
58
58
  end
59
59
  s
60
60
  end
@@ -1,5 +1,5 @@
1
1
  require "set"
2
- require "solve/errors"
2
+ require_relative "errors"
3
3
  require_relative "solver/serializer"
4
4
 
5
5
  module Solve
@@ -102,12 +102,14 @@ module Solve
102
102
  # DepSelector timed out trying to find the solution. There may or may
103
103
  # not be a solution.
104
104
  raise Solve::Errors::NoSolutionError.new(
105
- "The dependency constraints could not be solved in the time allotted.")
105
+ "The dependency constraints could not be solved in the time allotted."
106
+ )
106
107
  rescue DepSelector::Exceptions::TimeBoundExceededNoSolution
107
108
  # DepSelector determined there wasn't a solution to the problem, then
108
109
  # timed out trying to determine which constraints cause the conflict.
109
110
  raise Solve::Errors::NoSolutionCauseUnknown.new(
110
- "There is a dependency conflict, but the solver could not determine the precise cause in the time allotted.")
111
+ "There is a dependency conflict, but the solver could not determine the precise cause in the time allotted."
112
+ )
111
113
  end
112
114
 
113
115
  # Maps demands to corresponding DepSelector::SolutionConstraint objects.
@@ -123,6 +125,7 @@ module Solve
123
125
  # already done, artifacts are added to the ds_graph as a necessary side effect.
124
126
  def all_artifacts
125
127
  return @all_artifacts if @all_artifacts
128
+
126
129
  populate_ds_graph!
127
130
  @all_artifacts
128
131
  end
@@ -182,7 +185,7 @@ module Solve
182
185
  end
183
186
 
184
187
  def build_sorted_solution(unsorted_solution)
185
- nodes = Hash.new
188
+ nodes = {}
186
189
  unsorted_solution.each do |name, version|
187
190
  nodes[name] = @graph.artifact(name, version).dependencies.map(&:name)
188
191
  end
@@ -171,8 +171,10 @@ module Solve
171
171
  def requirement_satisfied_by?(requirement, activated, spec)
172
172
  version = spec.version
173
173
  return false unless requirement.constraint.satisfies?(version)
174
+
174
175
  shared_possibility_versions = possibility_versions(requirement, activated)
175
176
  return false if !shared_possibility_versions.empty? && !shared_possibility_versions.include?(version)
177
+
176
178
  true
177
179
  end
178
180
 
@@ -261,7 +263,7 @@ module Solve
261
263
  end
262
264
 
263
265
  def build_sorted_solution(unsorted_solution)
264
- nodes = Hash.new
266
+ nodes = {}
265
267
  unsorted_solution.each do |name, version|
266
268
  nodes[name] = @graph.artifact(name, version).dependencies.map(&:name)
267
269
  end
@@ -1,5 +1,5 @@
1
1
  require "json"
2
- require "solve/graph"
2
+ require_relative "../graph"
3
3
 
4
4
  module Solve
5
5
 
@@ -1,3 +1,3 @@
1
1
  module Solve
2
- VERSION = "4.0.2".freeze
2
+ VERSION = "4.0.3".freeze
3
3
  end
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: 4.0.2
4
+ version: 4.0.3
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: 2018-12-10 00:00:00.000000000 Z
13
+ date: 2019-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: semverse
@@ -142,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.7.7
145
+ rubygems_version: 3.0.3
147
146
  signing_key:
148
147
  specification_version: 4
149
148
  summary: A Ruby version constraint solver implementing Semantic Versioning 2.0.0-rc.1