toque 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toque/chef.rb +14 -5
- data/lib/toque/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f761384eb96137f039fca62a1392d589c551e24b
|
4
|
+
data.tar.gz: a1fdae68c2bac72044d822a0efa92ecf8b187529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b70c8223223cc0e57d6eb28ce4b8258f7d31911212555c657fe25aa926ae3fc09571f5219baf669dadcc50be1021aa2d480161fd128161939f6465f1efc5f7
|
7
|
+
data.tar.gz: d183c37658c21a9271305fa9880618f97a550d03ecbde72d11234f5ecbb7a9edbfc6b46e8eb3d863370b000d2860dc611f9d7961270b3a347c4014ff84dc8aac
|
data/lib/toque/chef.rb
CHANGED
@@ -123,11 +123,20 @@ module Toque
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def convert(hash)
|
126
|
-
hash.inject({}) do |
|
127
|
-
key, value = *
|
128
|
-
|
129
|
-
|
130
|
-
|
126
|
+
hash.inject({}) do |attributes, element|
|
127
|
+
key, value = *element
|
128
|
+
|
129
|
+
begin
|
130
|
+
value = value.call if value.respond_to? :call
|
131
|
+
value = convert value if value.is_a?(Hash)
|
132
|
+
value = nil if value.class.to_s.include? 'Capistrano'
|
133
|
+
attributes[key] = value unless value.nil?
|
134
|
+
rescue ::Capistrano::CommandError => error
|
135
|
+
logger.debug "Could not get the value of #{key}: #{error.message}"
|
136
|
+
nil
|
137
|
+
end
|
138
|
+
|
139
|
+
attributes
|
131
140
|
end
|
132
141
|
end
|
133
142
|
end
|
data/lib/toque/version.rb
CHANGED