lono 1.0.1 → 1.0.2

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: 106d4c92c775431a3051cc004dfe7725b2733b53
4
- data.tar.gz: b690d54d0f64f80807aabda7506b415685899c2c
3
+ metadata.gz: a9236c10e7fcf57b75bbbb57b7ad87ada43f7c1d
4
+ data.tar.gz: c453a06115c4263f8955c97e566c5a6261365195
5
5
  SHA512:
6
- metadata.gz: 2af3a0be29c29ed36cca3d399050405a4867b1a0a7ca0d61d35678216b4f319d4bea2917b31928809b199fb5ddb203c35c1a281f61f600f8888434a23094bcf6
7
- data.tar.gz: d7aa6c1712326065dc041b544219ddd85f4237ec0c15880bb28b80b3b2f6eab7470c0a18412ab830b423624c0795c1386698c216b5f989994690603ac86a72cb
6
+ metadata.gz: dae90a7b3e39be326fedd087551570cfb0b33ce5081befccfa53f14b6e04868735b6b2d1de5c2d463cf66e53ccbffa58e672fb5b730a73307a0f1d797622deb7
7
+ data.tar.gz: 0bd752bb836cc1567be6be4fb20ebdc8509f7ca068ab59905299ca828764b931f956523bedc8e8309ecec7aafcfed08e57d2bd647edd49b6fbe25d53a546db4d
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.2]
7
+ - remove blank lines from yaml output
8
+
6
9
  ## [1.0.1]
7
10
  - update starter project instance type allowed values
8
11
 
@@ -108,9 +108,15 @@ module Lono
108
108
  @options[:pretty] ? prettify(text) : text
109
109
  end
110
110
 
111
- # do not prettify yaml format because it removes the !Ref like CloudFormation notation
111
+ # Input text is either yaml or json.
112
+ # Do not prettify yaml format because it removes the !Ref like CloudFormation notation
112
113
  def prettify(text)
113
- @detected_format == "json" ? JSON.pretty_generate(JSON.parse(text)) : text
114
+ @detected_format == "json" ? JSON.pretty_generate(JSON.parse(text)) : remove_blank_lines(text)
115
+ end
116
+
117
+ # ERB templates leaves blank lines around, remove those lines
118
+ def remove_blank_lines(text)
119
+ text.split("\n").reject { |l| l.strip == '' }.join("\n") + "\n"
114
120
  end
115
121
 
116
122
  def ensure_parent_dir(path)
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-06 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake