chef_cap 0.1.2 → 0.1.3
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.
- data/lib/chef_cap/version.rb +1 -1
- data/recipes/lib/chef_cap_helper.rb +7 -3
- data/spec/chef_cap_helper_spec.rb +1 -0
- metadata +2 -2
data/lib/chef_cap/version.rb
CHANGED
@@ -6,13 +6,17 @@ class ChefCapHelper
|
|
6
6
|
|
7
7
|
def parse_hash(hash, prefix = nil)
|
8
8
|
hash.each do |key, value|
|
9
|
-
next if value.nil?
|
10
9
|
if value.is_a? Hash
|
11
10
|
parse_hash(value, [prefix, key].compact.join("_"))
|
12
11
|
else
|
13
12
|
key = [prefix, key].compact.join("_").to_sym
|
14
|
-
|
15
|
-
|
13
|
+
unless value.nil?
|
14
|
+
debug("Setting #{key.inspect} => #{value.inspect}")
|
15
|
+
ChefCapConfiguration.configuration.set key, value
|
16
|
+
else
|
17
|
+
debug("Unsetting #{key.inspect} => #{value.inspect}")
|
18
|
+
ChefCapConfiguration.configuration.unset key, value
|
19
|
+
end
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|