kumogata 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWVlZDU1MjQ3Y2Y3NDk1Nzg5YmRiZTZjN2NkZjAyODY2NWNmY2NjYg==
4
+ ODhkMTUzNDVjOWU3YjNjMjNmZjFjMDQ5MDQ1ZGJmOWI5Y2MzMmQ4Ng==
5
5
  data.tar.gz: !binary |-
6
- MjBkOWE5MjJhZTRkY2I0MjExMTc0ODY3NGYzY2M5MGRhOTg4ZjQzOQ==
6
+ NDRhOWNlNzJiYzRhMTQyZDIwNmNkM2NjMTZiNTY0YmM3MTNlOWJmYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWNlZjUyZGRlNzJmYjc1MGFiYmU2M2U1ZDMwYTQyZGU5MzAwOWNjYTNlYmNi
10
- MTRmOGIwOTk3OGM2OTIxOTRjYmVmOWUwZWY2MWU4NDVhMDQ3NjlhZWYzZjVh
11
- MDU2NTM2ZGYwNjEwZGZiNzRiM2NhZjMyYmZhNjlhYmQ5NTM3YTc=
9
+ MjM3OWIzZTBjOWY3MjZlNzhmYWVjYTU4MmE1ODYxNGQ1NGVhM2ZkODhkNDQz
10
+ YjUyZmU1N2I1NWQ0NmVkZjE4MTJjYmRmYmYyMGM2ODA2MTNiYzgxOGMzMTQ0
11
+ NzFhZjhjZGU3NmI0M2MxMjViNmMzZjdiZmVlNzY0MzczNjBmMWI=
12
12
  data.tar.gz: !binary |-
13
- YjEwYzI0Zjc5ZGZlNDA4ZmI5Yzc0ZWVjMGE3Y2FkNmJjZmY0MGMwZGMwOGJj
14
- MmY2ZDdhNGM3MmQwZTY0ZTFlMDI5NzE4OTJiNjBkZjlmNzY0YTY3N2Y2ZmMx
15
- YzhkOWQ2ZDFkNzBlNTlmZDNiMzUxNzJiMmJlNWU1OTk4Yzk3MDM=
13
+ MzgyMjRmMTIwZjJmZGI1ZjJhMmQ5NjBhYzM5NzNjNTQ0MmJkMjE4NzliYmE0
14
+ YTRkZGVhMWJhMzUyNDc2NjdkNDdjNzA1NTVjZWJhYjVmMGU4ODhhNWFlZGM5
15
+ OGUyODE1ODdiNTJiYmUxM2Y3ZmZjYTYyNWE5YTc4M2Q2Yjc3YjU=
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Kumogata is a tool for [AWS CloudFormation](https://aws.amazon.com/cloudformation/).
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/kumogata.png?201403031512)](http://badge.fury.io/rb/kumogata)
6
- [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403031512)](https://drone.io/github.com/winebarrel/kumogata/latest)
5
+ [![Gem Version](https://badge.fury.io/rb/kumogata.png?201403031537)](http://badge.fury.io/rb/kumogata)
6
+ [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403031537)](https://drone.io/github.com/winebarrel/kumogata/latest)
7
7
 
8
8
  It can define a template in Ruby DSL, such as:
9
9
 
@@ -138,7 +138,7 @@ end
138
138
  {
139
139
  "Ref": "AWS::StackId"
140
140
  },
141
- "-r myEC2Instance --region ",
141
+ " -r myEC2Instance --region ",
142
142
  {
143
143
  "Ref": "AWS::Region"
144
144
  },
@@ -180,17 +180,23 @@ class Kumogata::Client
180
180
  data = data.flatten.select {|i| not i.nil? }
181
181
 
182
182
  if options[:strip]
183
+ prev_not_str = false
184
+
183
185
  data = data.map do |item|
184
186
  if item.kind_of?(String)
185
- item.split("\n").map {|i| i.gsub(/\A\s+/, "") }.join("\n")
187
+ item = item.split("\n").map {|i| i.gsub(/\A\s+/, "") }.join("\n")
188
+ item = " " + item if prev_not_str
189
+ prev_not_str = false
190
+ item
186
191
  else
192
+ prev_not_str = true
187
193
  item
188
194
  end
189
195
  end
190
196
  end
191
197
 
192
- if data.last.kind_of?(String) and data.last == ""
193
- data.last << "\n"
198
+ if data.last.kind_of?(String) and data.last.strip == ""
199
+ data.last.replace("\n")
194
200
  end
195
201
 
196
202
  unless data.last.kind_of?(String) and data.last =~ /\n\Z/
@@ -1,3 +1,3 @@
1
1
  module Kumogata
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
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.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara