lono 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -90,6 +90,14 @@ Here's how you would call it in the template.
90
90
  }
91
91
  ```
92
92
 
93
+ #### Breaking up config/lono.rb
94
+
95
+ If you have a lot of templates, the config/lono.rb file can get unwieldy long. You can break up the lono.rb file and put template defintions in the config/lono directory. Any file in this directory will be automatically loaded.
96
+
97
+ An example is in the spec/project folder:
98
+
99
+ * config/lono/api.rb
100
+
93
101
  ## Generate
94
102
 
95
103
  You can generate the CF templates by running:
data/lib/lono/dsl.rb CHANGED
@@ -12,6 +12,14 @@ module Lono
12
12
 
13
13
  def evaluate
14
14
  instance_eval(File.read(@path), @path)
15
+ load_subfolder
16
+ end
17
+
18
+ # load any templates defined in project/config/lono/*
19
+ def load_subfolder
20
+ Dir.glob("#{File.dirname(@path)}/lono/*").each do |path|
21
+ instance_eval(File.read(path), path)
22
+ end
15
23
  end
16
24
 
17
25
  def template(name, &block)
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,20 @@
1
+ template "prod-api-app.json" do
2
+ source "app.json.erb"
3
+ variables(
4
+ :env => 'prod',
5
+ :app => 'api',
6
+ :role => "app",
7
+ :ami => "ami-123",
8
+ :instance_type => "c1.xlarge",
9
+ :port => "80",
10
+ :high_threshold => "15",
11
+ :high_periods => "4",
12
+ :low_threshold => "5",
13
+ :low_periods => "10",
14
+ :max_size => "24",
15
+ :min_size => "6",
16
+ :down_adjustment => "-3",
17
+ :up_adjustment => "3",
18
+ :ssl_cert => "arn:aws:iam::12345:server-certificate/wildcard"
19
+ )
20
+ end
@@ -1,23 +1,3 @@
1
- template "prod-api-app.json" do
2
- source "app.json.erb"
3
- variables(
4
- :env => 'prod',
5
- :app => 'api',
6
- :role => "app",
7
- :ami => "ami-123",
8
- :instance_type => "c1.xlarge",
9
- :port => "80",
10
- :high_threshold => "15",
11
- :high_periods => "4",
12
- :low_threshold => "5",
13
- :low_periods => "10",
14
- :max_size => "24",
15
- :min_size => "6",
16
- :down_adjustment => "-3",
17
- :up_adjustment => "3",
18
- :ssl_cert => "arn:aws:iam::12345:server-certificate/wildcard"
19
- )
20
- end
21
1
  template "prod-br-app.json" do
22
2
  source "app.json.erb"
23
3
  variables(
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.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-11 00:00:00.000000000 Z
12
+ date: 2013-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -216,6 +216,7 @@ files:
216
216
  - lono.gemspec
217
217
  - spec/lib/lono_spec.rb
218
218
  - spec/project/config/lono.rb
219
+ - spec/project/config/lono/api.rb
219
220
  - spec/project/templates/app.json.erb
220
221
  - spec/project/templates/partial/host_record.json.erb
221
222
  - spec/project/templates/user_data/app.sh.erb
@@ -248,6 +249,7 @@ summary: Lono is a Cloud Formation Template ruby generator. Lono generates Clou
248
249
  test_files:
249
250
  - spec/lib/lono_spec.rb
250
251
  - spec/project/config/lono.rb
252
+ - spec/project/config/lono/api.rb
251
253
  - spec/project/templates/app.json.erb
252
254
  - spec/project/templates/partial/host_record.json.erb
253
255
  - spec/project/templates/user_data/app.sh.erb