kumogata 0.4.13 → 0.4.14
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/README.md +4 -4
- data/lib/kumogata.rb +1 -0
- data/lib/kumogata/client.rb +4 -10
- data/lib/kumogata/outputs_filter.rb +14 -0
- data/lib/kumogata/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89a07962772e36a298e010d43823ef2e029ce423
|
4
|
+
data.tar.gz: 67bf0688c0afeb066d381e6c74b94a80245701d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7961c01c5eb7801d951db8eb5dd85d0994a5ef41b2c6ab8cf33bcea6dcc201a37e7b3e280983eefa163ec83a2570def941a3651fd4708485634ca9531d9d776
|
7
|
+
data.tar.gz: 6a6db09a4e72a0db4e5f7b65af69741ec459f2a2e55494c403d9f02c9853bd66f484b1a55bd1ce33e16e3a06603ed650be3009645bf1a87a3913d8816087c975
|
data/README.md
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
Kumogata is a tool for [AWS CloudFormation](https://aws.amazon.com/cloudformation/).
|
7
7
|
|
8
|
-
[](http://badge.fury.io/rb/kumogata)
|
9
|
+
[](https://drone.io/github.com/winebarrel/kumogata/latest)
|
10
10
|
|
11
11
|
It can define a template in Ruby DSL, such as:
|
12
12
|
|
@@ -420,8 +420,8 @@ Outputs do
|
|
420
420
|
end
|
421
421
|
|
422
422
|
_outputs_filter do |output|
|
423
|
-
outputs["
|
424
|
-
#
|
423
|
+
outputs["MyPublicIp"].gsub!('.', '_')
|
424
|
+
# MyPublicIp: XXX.XXX.XXX.XXX => XXX-XXX-XXX-XXX
|
425
425
|
end
|
426
426
|
|
427
427
|
_post do
|
data/lib/kumogata.rb
CHANGED
@@ -31,6 +31,7 @@ require 'kumogata/ext/coderay_ext'
|
|
31
31
|
require 'kumogata/ext/json_ext'
|
32
32
|
require 'kumogata/ext/string_ext'
|
33
33
|
require 'kumogata/logger'
|
34
|
+
require 'kumogata/outputs_filter'
|
34
35
|
require 'kumogata/post_processing'
|
35
36
|
require 'kumogata/string_stream'
|
36
37
|
require 'kumogata/utils'
|
data/lib/kumogata/client.rb
CHANGED
@@ -3,6 +3,7 @@ class Kumogata::Client
|
|
3
3
|
@options = options
|
4
4
|
@options = Hashie::Mash.new(@options) unless @options.kind_of?(Hashie::Mash)
|
5
5
|
@cloud_formation = AWS::CloudFormation.new
|
6
|
+
@outputs_filter = Kumogata::OutputsFilter.new(@options)
|
6
7
|
@post_processing = Kumogata::PostProcessing.new(@options)
|
7
8
|
end
|
8
9
|
|
@@ -15,7 +16,7 @@ class Kumogata::Client
|
|
15
16
|
add_encryption_password(template)
|
16
17
|
|
17
18
|
outputs = create_stack(template, stack_name)
|
18
|
-
|
19
|
+
@outputs_filter.filter!(outputs)
|
19
20
|
@post_processing.run(:create, outputs)
|
20
21
|
|
21
22
|
outputs
|
@@ -59,7 +60,7 @@ class Kumogata::Client
|
|
59
60
|
add_encryption_password(template)
|
60
61
|
|
61
62
|
outputs = update_stack(template, stack_name)
|
62
|
-
|
63
|
+
@outputs_filter.filter!(outputs)
|
63
64
|
@post_processing.run(:update, outputs)
|
64
65
|
|
65
66
|
outputs
|
@@ -200,6 +201,7 @@ class Kumogata::Client
|
|
200
201
|
:filename => path_or_url,
|
201
202
|
})
|
202
203
|
|
204
|
+
@outputs_filter.fetch!(template)
|
203
205
|
@post_processing.fetch!(template)
|
204
206
|
|
205
207
|
return template
|
@@ -624,12 +626,4 @@ EOS
|
|
624
626
|
raise "1 validation error detected: Value '#{stack_name}' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*"
|
625
627
|
end
|
626
628
|
end
|
627
|
-
|
628
|
-
def filter_outputs(template, outputs)
|
629
|
-
if (_outputs_filter = template.delete(:_outputs_filter))
|
630
|
-
_outputs_filter.call(outputs)
|
631
|
-
end
|
632
|
-
|
633
|
-
return outputs
|
634
|
-
end
|
635
629
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Kumogata::OutputsFilter
|
2
|
+
def initialize(options)
|
3
|
+
@options = options
|
4
|
+
end
|
5
|
+
|
6
|
+
def fetch!(template)
|
7
|
+
@filter = template.delete(:_outputs_filter)
|
8
|
+
end
|
9
|
+
|
10
|
+
def filter!(outputs)
|
11
|
+
@filter.call(outputs) if @filter
|
12
|
+
return outputs
|
13
|
+
end
|
14
|
+
end
|
data/lib/kumogata/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumogata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -258,6 +258,7 @@ files:
|
|
258
258
|
- lib/kumogata/ext/json_ext.rb
|
259
259
|
- lib/kumogata/ext/string_ext.rb
|
260
260
|
- lib/kumogata/logger.rb
|
261
|
+
- lib/kumogata/outputs_filter.rb
|
261
262
|
- lib/kumogata/post_processing.rb
|
262
263
|
- lib/kumogata/pre_processing.rb
|
263
264
|
- lib/kumogata/string_stream.rb
|