knife-inspect 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/HISTORY.md +7 -0
- data/lib/health_inspector/checklists/base.rb +1 -0
- data/lib/health_inspector/checklists/data_bag_items.rb +1 -0
- data/lib/health_inspector/checklists/roles.rb +0 -1
- data/lib/health_inspector/pairing.rb +7 -7
- data/lib/health_inspector/version.rb +1 -1
- data/spec/spec_helper.rb +15 -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: c914c55c5bab76001d767fb579b224e41b440476
|
4
|
+
data.tar.gz: 837f0149b53a1c26a4966eace58a4be204e65992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60e89b16ba9c72e8ebd04415fc6f7f582af5c7d939bfb6cec4a22ab1fe79d4b7b9cdcb90389403a8b69d6e3fb75aca0d82c9d0fd968011c5271b08840dbd0304
|
7
|
+
data.tar.gz: 0cd0462d49ac645f86f5c51c481779e6404f4a0de981b51fb54b884828f1a036a18b40ad0c93dee51bc38170c3c450f710906449b3d8d294f0b27fb84f4d49bf
|
data/.travis.yml
CHANGED
data/HISTORY.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.11.0 ( 2014-10-27 )
|
2
|
+
|
3
|
+
* Bug fix: recursive diff would stop if two keys were identical between local
|
4
|
+
and server ([#23][#23])
|
5
|
+
|
6
|
+
|
1
7
|
## 0.10.0 ( 2014-10-13 )
|
2
8
|
|
3
9
|
* Feature: Support cookbooks that only have a `metadata.json` file but no
|
@@ -157,3 +163,4 @@ instead.
|
|
157
163
|
[#25]: https://github.com/bmarini/knife-inspect/issues/25
|
158
164
|
[#5]: https://github.com/bmarini/knife-inspect/issues/5
|
159
165
|
[#27]: https://github.com/bmarini/knife-inspect/issues/27
|
166
|
+
[#23]: https://github.com/bmarini/knife-inspect/issues/23
|
@@ -53,13 +53,13 @@ module HealthInspector
|
|
53
53
|
|
54
54
|
def recursive_diff(original, other)
|
55
55
|
(original.keys + other.keys).uniq.reduce({}) do |memo, key|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
56
|
+
unless original[key] == other[key]
|
57
|
+
if original[key].is_a?(Hash) && other[key].is_a?(Hash)
|
58
|
+
diff = recursive_diff(original[key], other[key])
|
59
|
+
memo[key] = diff unless diff.empty?
|
60
|
+
else
|
61
|
+
memo[key] = { 'server' => original[key], 'local' => other[key] }
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
memo
|
data/spec/spec_helper.rb
CHANGED
@@ -97,6 +97,21 @@ RSpec.shared_examples 'a chef model that can be represented in json' do
|
|
97
97
|
expect(pairing.errors.first).to eq(expected_errors)
|
98
98
|
end
|
99
99
|
|
100
|
+
it 'detects differences when the other keys are identical' do
|
101
|
+
pairing.server = { 'name' => 'bar', 'foo' => { 'bar' => { 'fizz' => 'buzz' } } }
|
102
|
+
pairing.local = { 'name' => 'bar', 'foo' => { 'baz' => { 'fizz' => 'buzz' } } }
|
103
|
+
pairing.validate
|
104
|
+
|
105
|
+
expect(pairing.errors).not_to be_empty
|
106
|
+
expected_errors = {
|
107
|
+
'foo' => {
|
108
|
+
'bar' => { 'server' => { 'fizz' => 'buzz' }, 'local' => nil },
|
109
|
+
'baz' => { 'server' => nil, 'local' => { 'fizz' => 'buzz' } }
|
110
|
+
}
|
111
|
+
}
|
112
|
+
expect(pairing.errors.first).to eq(expected_errors)
|
113
|
+
end
|
114
|
+
|
100
115
|
it 'detects if an item is the same' do
|
101
116
|
pairing.server = { 'foo' => 'bar' }
|
102
117
|
pairing.local = { 'foo' => 'bar' }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-inspect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Karékinian
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|