semantic_puppet 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/appveyor.yml +1 -0
- data/lib/semantic_puppet/dependency/graph_node.rb +12 -6
- data/lib/semantic_puppet/gem_version.rb +1 -1
- data/spec/unit/semantic_puppet/dependency/graph_node_spec.rb +10 -0
- data/spec/unit/semantic_puppet/dependency_spec.rb +9 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e37126b8cf6e3af3f6fb7f7e98ab38223bfd3466edd4eb1bbd99b20f5f4e22f6
|
4
|
+
data.tar.gz: 3f200910bfea3ee0d551670d3e35f943e3a64e82e3bcf5e280aec8ce29e292a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16b7f38f0211f02448d3f5bbcd2a880265a8980471cb40d389beb79f85baac2cff960e3a014ab3cf01b74b2b2047e19f7b7a74f6ecb97dc1d9c5230ffd0b2265
|
7
|
+
data.tar.gz: b58ccbd2a4cd948cc53201f9f9bc263e2d3d8b4a91f242849292a16867b156e610822c8adf5485b6b97f265a631963c802dec7e68f2483bd0566781b77848f30
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## 1.0.4 - 2021-06-08
|
6
|
+
- Remove dependency on SortedSet
|
7
|
+
- Add Ruby 3.0 to Travis and AppVeyor
|
8
|
+
|
5
9
|
## 1.0.3 - 2021-01-12
|
6
10
|
- List failed module install dependencies
|
7
11
|
- Add Ruby 2.7 to Travis and AppVeyor
|
data/appveyor.yml
CHANGED
@@ -33,10 +33,10 @@ module SemanticPuppet
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# @api internal
|
36
|
-
# @return [{ String =>
|
36
|
+
# @return [{ String => Array<GraphNode> }] the satisfactory
|
37
37
|
# dependency nodes
|
38
38
|
def dependencies
|
39
|
-
@_dependencies ||= Hash.new { |h, k| h[k] =
|
39
|
+
@_dependencies ||= Hash.new { |h, k| h[k] = Array.new }
|
40
40
|
end
|
41
41
|
|
42
42
|
# Adds the given dependency name to the list of dependencies.
|
@@ -99,11 +99,17 @@ module SemanticPuppet
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def << (nodes)
|
102
|
-
Array(nodes).
|
103
|
-
|
104
|
-
|
105
|
-
|
102
|
+
Array(nodes).group_by(&:name).each_pair do |name, nodes|
|
103
|
+
changed = false
|
104
|
+
next unless dependencies.key?(name)
|
105
|
+
|
106
|
+
nodes.each do |node|
|
107
|
+
if satisfies_dependency?(node)
|
108
|
+
dependencies[name] << node
|
109
|
+
changed = true
|
110
|
+
end
|
106
111
|
end
|
112
|
+
dependencies[name].sort! if changed
|
107
113
|
end
|
108
114
|
|
109
115
|
return self
|
@@ -68,6 +68,16 @@ describe SemanticPuppet::Dependency::GraphNode do
|
|
68
68
|
subject << bar3
|
69
69
|
expect(Array(subject.dependencies['bar'])).to be_empty
|
70
70
|
end
|
71
|
+
|
72
|
+
it 'sorts once the dependencies for a specific node' do
|
73
|
+
expect(subject.dependencies['bar']).to receive(:sort!).once
|
74
|
+
subject << [bar1, bar2]
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'sorts the dependencies for each addition to the same node' do
|
78
|
+
expect(subject.dependencies['bar']).to receive(:sort!).twice
|
79
|
+
subject << bar1 << bar2
|
80
|
+
end
|
71
81
|
end
|
72
82
|
|
73
83
|
describe '#satisfied' do
|
@@ -42,7 +42,10 @@ describe SemanticPuppet::Dependency do
|
|
42
42
|
context 'with one source' do
|
43
43
|
let(:source) { double('Source', :priority => 0) }
|
44
44
|
|
45
|
-
before
|
45
|
+
before do
|
46
|
+
SemanticPuppet::Dependency.clear_sources
|
47
|
+
SemanticPuppet::Dependency.add_source(source)
|
48
|
+
end
|
46
49
|
|
47
50
|
it 'queries the source for release information' do
|
48
51
|
expect(source).to receive(:fetch).with('module_name').and_return([])
|
@@ -90,8 +93,8 @@ describe SemanticPuppet::Dependency do
|
|
90
93
|
)
|
91
94
|
|
92
95
|
result = SemanticPuppet::Dependency.query('foo' => '1.0.0', 'bar' => '1.0.0')
|
93
|
-
expect(result.dependencies['foo']).to eql
|
94
|
-
expect(result.dependencies['bar']).to eql
|
96
|
+
expect(result.dependencies['foo']).to eql [foo]
|
97
|
+
expect(result.dependencies['bar']).to eql [bar]
|
95
98
|
end
|
96
99
|
|
97
100
|
it 'populates all returned ModuleReleases with related dependencies' do
|
@@ -102,9 +105,9 @@ describe SemanticPuppet::Dependency do
|
|
102
105
|
)
|
103
106
|
|
104
107
|
result = SemanticPuppet::Dependency.query('foo' => '1.0.0')
|
105
|
-
expect(result.dependencies['foo']).to eql
|
106
|
-
expect(foo.dependencies['bar']).to eql
|
107
|
-
expect(bar.dependencies['baz']).to eql
|
108
|
+
expect(result.dependencies['foo']).to eql [foo]
|
109
|
+
expect(foo.dependencies['bar']).to eql [bar]
|
110
|
+
expect(bar.dependencies['baz']).to eql [baz]
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|