cloudformation-ruby-dsl 0.4.11 → 0.4.12
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b89f992d041a66fac78a11afd099ace363ae6c
|
4
|
+
data.tar.gz: d70726355a5e57afc2efc67823578159da150e3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c66d35817b955ef46ab6d8fc96e859af62ac1c044bf419202f525baddf542f37805adb4cd6fadd6b7fbebdf3f8da0ea99d51fa582c9c0ada90b52cbbffd3e8c
|
7
|
+
data.tar.gz: 04c800f473523eb221ef9be31fd211470d96c9eb9934d8f7a89a5de4be00db99aa45056ebbb89349026b92acc334e0435a22f1a85e4bf9c470039f443d86a3f3
|
@@ -20,15 +20,10 @@ unless RUBY_VERSION >= '1.9'
|
|
20
20
|
end
|
21
21
|
|
22
22
|
require 'rubygems'
|
23
|
-
require 'csv'
|
24
23
|
require 'json'
|
25
24
|
require 'yaml'
|
26
25
|
require 'erb'
|
27
|
-
|
28
|
-
# A custom converter to replace the String "(nil)" with NilClass
|
29
|
-
CSV::Converters[:nil_to_nil] = lambda do |field|
|
30
|
-
field && field == '(nil)' ? nil : field
|
31
|
-
end
|
26
|
+
require 'xmlsimple'
|
32
27
|
|
33
28
|
############################# Command-line and "cfn-cmd" Support
|
34
29
|
|
@@ -205,9 +200,16 @@ def cfn_cmd(template)
|
|
205
200
|
exit(true)
|
206
201
|
end
|
207
202
|
|
203
|
+
def extract_kv_string(hash, prefix='')
|
204
|
+
key = "#{prefix}Key"
|
205
|
+
value = "#{prefix}Value"
|
206
|
+
hash["member"].map {|a| "#{a[key]}=#{a[value]}" }.join(';') rescue ''
|
207
|
+
end
|
208
|
+
|
208
209
|
def exec_describe_stack cfn_options_string
|
209
|
-
|
210
|
-
|
210
|
+
xml_data = exec_capture_stdout("cfn-cmd cfn-describe-stacks #{cfn_options_string} --show-xml")
|
211
|
+
xml = XmlSimple.xml_in(xml_data, :ForceArray => false)["DescribeStacksResult"]["Stacks"]["member"]
|
212
|
+
{ "TAGS" => extract_kv_string(xml["Tags"]), "PARAMETERS" => extract_kv_string(xml["Parameters"], "Parameter") }
|
211
213
|
end
|
212
214
|
|
213
215
|
def exec_capture_stdout command
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformation-ruby-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Smith
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2015-03-
|
18
|
+
date: 2015-03-31 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: detabulator
|
@@ -45,6 +45,20 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: xml-simple
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
48
62
|
description: Ruby DSL library that provides a wrapper around the cfn-cmd.
|
49
63
|
email:
|
50
64
|
- Shawn.Smith@bazaarvoice.com
|