solve 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/README.md +8 -7
- data/lib/solve.rb +10 -29
- data/lib/solve/artifact.rb +91 -52
- data/lib/solve/constraint.rb +109 -24
- data/lib/solve/demand.rb +26 -17
- data/lib/solve/dependency.rb +15 -1
- data/lib/solve/errors.rb +23 -20
- data/lib/solve/gem_version.rb +1 -1
- data/lib/solve/graph.rb +76 -84
- data/lib/solve/solver.rb +246 -0
- data/lib/solve/solver/constraint_row.rb +17 -0
- data/lib/solve/solver/constraint_table.rb +27 -0
- data/lib/solve/solver/variable.rb +41 -0
- data/lib/solve/solver/variable_table.rb +50 -0
- data/lib/solve/version.rb +53 -16
- data/solve.gemspec +2 -3
- data/spec/acceptance/solutions_spec.rb +81 -8
- data/spec/unit/solve/artifact_spec.rb +73 -49
- data/spec/unit/solve/constraint_spec.rb +36 -30
- data/spec/unit/solve/demand_spec.rb +22 -13
- data/spec/unit/solve/dependency_spec.rb +15 -0
- data/spec/unit/solve/graph_spec.rb +98 -142
- data/spec/unit/solve/solver_spec.rb +302 -0
- data/spec/unit/solve/version_spec.rb +110 -0
- metadata +42 -96
- data/lib/solve/core_ext.rb +0 -3
- data/lib/solve/core_ext/kernel.rb +0 -33
data/lib/solve/core_ext.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# From ActiveSupport: https://github.com/rails/rails/blob/c2c8ef57d6f00d1c22743dc43746f95704d67a95/activesupport/lib/active_support/core_ext/kernel/reporting.rb#L39
|
2
|
-
|
3
|
-
require 'rbconfig'
|
4
|
-
|
5
|
-
module Kernel
|
6
|
-
# Silences any stream for the duration of the block.
|
7
|
-
#
|
8
|
-
# silence_stream(STDOUT) do
|
9
|
-
# puts 'This will never be seen'
|
10
|
-
# end
|
11
|
-
#
|
12
|
-
# puts 'But this will'
|
13
|
-
def silence_stream(stream)
|
14
|
-
old_stream = stream.dup
|
15
|
-
stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
|
16
|
-
stream.sync = true
|
17
|
-
yield
|
18
|
-
ensure
|
19
|
-
stream.reopen(old_stream)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Silences both STDOUT and STDERR, even for subprocesses.
|
23
|
-
#
|
24
|
-
# quietly { system 'bundle install' }
|
25
|
-
#
|
26
|
-
def quietly
|
27
|
-
silence_stream(STDOUT) do
|
28
|
-
silence_stream(STDERR) do
|
29
|
-
yield
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|