kumogata 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 699cf1064cdba018c12f33fdab0a1553ce09b825
4
- data.tar.gz: 67dc4a38f8b968e275101c9bce0ac16aaac5de44
3
+ metadata.gz: 89a07962772e36a298e010d43823ef2e029ce423
4
+ data.tar.gz: 67bf0688c0afeb066d381e6c74b94a80245701d3
5
5
  SHA512:
6
- metadata.gz: 9cab413eeab9541e08b459ff2117ea2bb2cd6f848c6caf5f47a5bc7d79c9850ea50720eefa2f6b29a2f22945f55b4cd40c20399ea4f911f7a5bef9d819be9b24
7
- data.tar.gz: f6ed042485c55d443d736b3c02619f9e90c23422d7538f9fe199dd888d6e530e7cb2dde49bf06d9e4f71ad8ebc226df9e6b676cd7da93e2f3c84b8e1213f8bff
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
- [![Gem Version](https://badge.fury.io/rb/kumogata.png?201404231500)](http://badge.fury.io/rb/kumogata)
9
- [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201404231500)](https://drone.io/github.com/winebarrel/kumogata/latest)
8
+ [![Gem Version](https://badge.fury.io/rb/kumogata.png?201404231520)](http://badge.fury.io/rb/kumogata)
9
+ [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201404231520)](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["PublicIp"].gsub!('.', '_')
424
- # PublicIp: XXX.XXX.XXX.XXX => XXX-XXX-XXX-XXX
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'
@@ -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
- filter_outputs(template, outputs)
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
- filter_outputs(template, outputs)
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
@@ -1,3 +1,3 @@
1
1
  module Kumogata
2
- VERSION = '0.4.13'
2
+ VERSION = '0.4.14'
3
3
  end
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.13
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