lono 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Guardfile CHANGED
@@ -5,5 +5,6 @@
5
5
  guard 'rspec' do
6
6
  watch(%r{^spec/.+_spec\.rb$})
7
7
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
8
+ watch(%r{^lib/.*/(.+)\.rb$}) { |m| "spec/lib/lono_spec.rb" }
8
9
  # watch('spec/spec_helper.rb') { "spec" }
9
10
  end
data/README.md CHANGED
@@ -20,6 +20,52 @@ $ lono generate
20
20
 
21
21
  This generates the templates that have been defined in config/lono.rb.
22
22
 
23
+ The example starter config/lono.rb looks like this:
24
+
25
+ ```ruby
26
+ template "prod-api-app.json" do
27
+ source "app.json.erb"
28
+ variables(
29
+ :env => 'prod',
30
+ :app => 'api',
31
+ :role => "app",
32
+ :ami => "ami-123",
33
+ :instance_type => "c1.xlarge",
34
+ :port => "80",
35
+ :high_threshold => "15",
36
+ :high_periods => "4",
37
+ :low_threshold => "5",
38
+ :low_periods => "10",
39
+ :max_size => "24",
40
+ :min_size => "6",
41
+ :down_adjustment => "-3",
42
+ :up_adjustment => "3",
43
+ :ssl_cert => "arn:aws:iam::12345:server-certificate/wildcard"
44
+ )
45
+ end
46
+ template "prod-br-app.json" do
47
+ source "app.json.erb"
48
+ variables(
49
+ :env => "prod",
50
+ :app => 'br',
51
+ :role => "app",
52
+ :ami => "ami-456",
53
+ :instance_type => "m1.medium",
54
+ :port => "80",
55
+ :high_threshold => "35",
56
+ :high_periods => "4",
57
+ :low_threshold => "20",
58
+ :low_periods => "2",
59
+ :max_size => "6",
60
+ :min_size => "3",
61
+ :down_adjustment => "-1",
62
+ :up_adjustment => "2"
63
+ )
64
+ end
65
+ ```
66
+
67
+ The example ERB template file is in templates/app.json.erb.
68
+
23
69
  <pre>
24
70
  $ guard
25
71
  </pre>
@@ -1,4 +1,5 @@
1
1
  require 'erb'
2
+ require 'json'
2
3
 
3
4
  module Lono
4
5
  class DSL
@@ -30,7 +31,8 @@ module Lono
30
31
  @results.each do |name,json|
31
32
  path = "#{output_path}/#{name}"
32
33
  puts " #{path}" if options[:verbose]
33
- File.open(path, 'w') {|f| f.write(json) }
34
+ pretty_json = JSON.pretty_generate(JSON.parse(json))
35
+ File.open(path, 'w') {|f| f.write(pretty_json) }
34
36
  end
35
37
  end
36
38
 
@@ -2,7 +2,7 @@ module Lono
2
2
  class Task
3
3
  def self.init(options={})
4
4
  project_root = options[:project_root] || '.'
5
- puts "Settin up lono project" unless options[:quiet]
5
+ puts "Setting up lono project" unless options[:quiet]
6
6
  %w[Guardfile config/lono.rb templates/app.json.erb].each do |name|
7
7
  source = File.expand_path("../../files/#{name}", __FILE__)
8
8
  dirname = File.dirname(name)
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.1
4
+ version: 0.1.2
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: 2012-12-06 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -227,18 +227,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
227
  - - ! '>='
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
- segments:
231
- - 0
232
- hash: -4363914420099746603
233
230
  required_rubygems_version: !ruby/object:Gem::Requirement
234
231
  none: false
235
232
  requirements:
236
233
  - - ! '>='
237
234
  - !ruby/object:Gem::Version
238
235
  version: '0'
239
- segments:
240
- - 0
241
- hash: -4363914420099746603
242
236
  requirements: []
243
237
  rubyforge_project:
244
238
  rubygems_version: 1.8.24