lono 0.4.0 → 0.4.1

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: beee9469d60a5a00f7e155dc2d8564ae63fe40f2
4
- data.tar.gz: 92b0863abac2d2cef840d96f9a119847df5e8496
3
+ metadata.gz: 718e48960a1c3a862ff214236f1ca2a41e086074
4
+ data.tar.gz: 3d88df2849d2d0c140e1484bfd441de14cf9c477
5
5
  SHA512:
6
- metadata.gz: 1aa6268aaf19d0d26d26076f164bff2753611150124dd1a7865bc4b20b167a43fdffecf24dfaf6ae1ffad42fd3f2591a877a37616c68b04f80827e4ebc460620
7
- data.tar.gz: b18cf6fbc929256fff760c419fdc9abbac3df2ae275e9c1cd61c73a2ff744b11071a965a97b150e072be1b7657680121227a367c0c2528e738ad8ab7ff263cb4
6
+ metadata.gz: 028ceea2ac8e288fe9fbd4c720edd7ab21852b368b3d4b27ce30d523c1aaaf08722ceae4e9d6161f15d7382e4044d739015be252663f5283b3315497da364783
7
+ data.tar.gz: a726a5be3d63491b8af498a626b5e4322c9cb2c1453535f9511a90b6bba1fdc89e30a4bd14a52d28751510a407c9138a2502ea5f3416c030e189af816bcfb7fc
data/README.md CHANGED
@@ -78,7 +78,9 @@ Here's how you would call it in the template.
78
78
  "Fn::Base64": {
79
79
  "Fn::Join": [
80
80
  "",
81
- <%= user_data('db.sh.erb') %>
81
+ [
82
+ <%= user_data('db.sh.erb') %>
83
+ ]
82
84
  ]
83
85
  }
84
86
  ```
data/lib/lono/template.rb CHANGED
@@ -44,7 +44,9 @@ module Lono
44
44
  result.split("\n").each do |line|
45
45
  output += transform(line)
46
46
  end
47
- output.to_json
47
+ json = output.to_json
48
+ json[0] = '' # remove first char: [
49
+ json.chop! # remove last char: ]
48
50
  end
49
51
 
50
52
  def ref(name)
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -233,8 +233,10 @@
233
233
  "Fn::Base64": {
234
234
  "Fn::Join": [
235
235
  "",
236
- <% script = @user_data_script || 'app.sh.erb' %>
237
- <%= user_data(script) %>
236
+ [
237
+ <% script = @user_data_script || 'app.sh.erb' %>
238
+ <%= user_data(script) %>
239
+ ]
238
240
  ]
239
241
  }
240
242
  }
@@ -33,7 +33,10 @@
33
33
  "Fn::Base64": {
34
34
  "Fn::Join": [
35
35
  "",
36
- <%= user_data('db.sh.erb', :vartest => 'foo') %>
36
+ [
37
+ <%= user_data('db.sh.erb', :vartest => 'foo') %>,
38
+ <%= user_data('db2.sh.erb') %>
39
+ ]
37
40
  ]
38
41
  }
39
42
  }
@@ -0,0 +1,2 @@
1
+ DB2=test
2
+ DB2A=hello
@@ -106,6 +106,14 @@ describe Lono do
106
106
  user_data.should include("VARTEST=foo\n")
107
107
  end
108
108
 
109
+ it "should include multiple user_data scripts" do
110
+ raw = IO.read("#{@project}/output/prod-api-redis.json")
111
+ json = JSON.load(raw)
112
+ json['Description'].should == "Api redis"
113
+ user_data = json['Resources']['server']['Properties']['UserData']['Fn::Base64']['Fn::Join'][1]
114
+ user_data.should include("DB2=test\n")
115
+ end
116
+
109
117
  it "should generate db template" do
110
118
  raw = IO.read("#{@project}/output/prod-api-redis.json")
111
119
  json = JSON.load(raw)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -200,6 +200,7 @@ files:
200
200
  - lib/starter_project/templates/partial/server.json.erb
201
201
  - lib/starter_project/templates/user_data/app.sh.erb
202
202
  - lib/starter_project/templates/user_data/db.sh.erb
203
+ - lib/starter_project/templates/user_data/db2.sh.erb
203
204
  - lib/starter_project/templates/user_data/ruby_script.rb.erb
204
205
  - lono.gemspec
205
206
  - spec/fixtures/cfn.json