lono 6.1.4 → 6.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5e716a5067fea74e53aa4431a798004481ac433a50622c8d057f8e61cca3056
4
- data.tar.gz: a40280ee2f07061ff6b491003cc56b43f0c7d409a7baafffdd242055d0abe2eb
3
+ metadata.gz: 451cabbd35459ee59695b80d3838756d978115b76e8439fab63f4e4bf5ad2e15
4
+ data.tar.gz: b73359e119a5ff577e237aa71a569f60be31291cfa5e65be022245cac34d4f4a
5
5
  SHA512:
6
- metadata.gz: '0294336987fb917fa74c100db0ae88a8822b9f2e487130f1e7a6e16953b5c0b1e0d373a708ec4f25ed7174c6a0435792a960d945bc41dfa59c2bfc4077286616'
7
- data.tar.gz: 769b99a41dffa596d00f29510e6412b4f1741f8068549179f2fba48e1de5782090e48cb0def97597f8c048b4c66517743079a8b152438c6355cfb14655a4d1a6
6
+ metadata.gz: 91e5c867855bac062ea0d937e709b2cd1c25b659a39e051034731e34cbc85ba37ae66220f924e92183d69f27fb9b40f304837ed66fb203267714aa69f3ebb588
7
+ data.tar.gz: cf30a279629efc794e20beab973a925b58c6bf7f8b5ed7be8d26e613643ab7e66a0ae7ade72ce3c53a0a0e3cfad7b83f60d6ca4286376c95311f226d33903488
data/CHANGELOG.md CHANGED
@@ -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
+ ## [6.1.5]
7
+ - #23 improve blueprint starter project and add --no-demo option
8
+
6
9
  ## [6.1.4]
7
10
  - #22 tags helper: return nil if @tags not set and using variable mode
8
11
 
@@ -12,10 +12,11 @@ class Lono::Blueprint
12
12
  def self.cli_options
13
13
  [
14
14
  [:bundle, type: :boolean, default: true, desc: "Runs bundle install on the project"],
15
+ [:demo, type: :boolean, default: true, desc: "Include demo template"],
15
16
  [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."],
16
17
  [:from_new, type: :boolean, desc: "Called from `lono new` command."],
17
- [:project_name, default: '', desc: "Only used with from_new internally"],
18
18
  [:import, type: :boolean, desc: "Flag for lono code import"],
19
+ [:project_name, default: '', desc: "Only used with from_new internally"],
19
20
  [:type, default: "dsl", desc: "Blueprint type: dsl or erb"],
20
21
  ]
21
22
  end
@@ -43,6 +44,11 @@ class Lono::Blueprint
43
44
  end
44
45
  end
45
46
 
47
+ def set_variables
48
+ @demo = @options[:demo]
49
+ @demo = false if ENV["LONO_ORG"] # overrides --demo CLI option
50
+ end
51
+
46
52
  def create_project
47
53
  puts "=> Creating new blueprint called #{blueprint_name}."
48
54
  directory ".", "#{@cwd}/#{blueprint_name}"
@@ -50,7 +56,13 @@ class Lono::Blueprint
50
56
 
51
57
  def create_app_folder
52
58
  return if @options[:import]
53
- directory "../blueprint_types/#{@options[:type]}", "#{@cwd}/#{blueprint_name}"
59
+
60
+ if @demo
61
+ directory "../blueprint_types/#{@options[:type]}", "#{@cwd}/#{blueprint_name}"
62
+ else
63
+ empty_directory "#{@cwd}/#{blueprint_name}/app/templates"
64
+ create_file "#{@cwd}/#{blueprint_name}/app/templates/#{blueprint_name}.rb"
65
+ end
54
66
  end
55
67
 
56
68
  def create_empty_directories
@@ -60,6 +72,7 @@ class Lono::Blueprint
60
72
  end
61
73
 
62
74
  def create_starter_configs
75
+ return unless @demo
63
76
  return if @options[:import]
64
77
 
65
78
  if options[:from_new] # lono new command
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "6.1.4"
2
+ VERSION = "6.1.5"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
 
10
10
  spec.summary = "Write a short summary because it's required." # TODO: Change me
11
11
  spec.description = "Write a longer description or delete this line." # TODO: Change me
12
- spec.homepage = "https://github.com/USER/<%= blueprint_name %>" # TODO: Change me
12
+ spec.homepage = "<%= ENV['LONO_ORG'] || "https://github.com/USER" %>/<%= blueprint_name %>"
13
13
  spec.license = "<%= ENV['LONO_LICENSE'] || 'MIT' %>"
14
14
 
15
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.metadata["allowed_push_host"] = "<%= ENV['LONO_ALLOWED_PUSH_HOST'] || "TODO: Set to 'http://mygemserver.com'"%>"
19
19
 
20
20
  spec.metadata["homepage_uri"] = spec.homepage
21
- <% if ENV['LONO_SOURCE_CODE_ORG'] -%>
22
- spec.metadata["source_code_uri"] = "<%= ENV['LONO_SOURCE_CODE_ORG'] %>/<%= blueprint_name %>"
23
- spec.metadata["changelog_uri"] = "<%= ENV['LONO_SOURCE_CODE_ORG'] %>/<%= blueprint_name %>/blob/master/CHANGELOG.md"
21
+ <% if ENV['LONO_ORG'] -%>
22
+ spec.metadata["source_code_uri"] = "<%= ENV['LONO_ORG'] %>/<%= blueprint_name %>"
23
+ spec.metadata["changelog_uri"] = "<%= ENV['LONO_ORG'] %>/<%= blueprint_name %>/blob/master/CHANGELOG.md"
24
24
  <% else -%>
25
25
  spec.metadata["source_code_uri"] = "https://github.com/user/repo" # TODO: Change me
26
26
  spec.metadata["changelog_uri"] = "https://github.com/user/repo/blob/master/CHANGELOG.md" # TODO: Change me
@@ -0,0 +1,33 @@
1
+ # Blueprint: <%= blueprint_name %>
2
+
3
+ ## Usage
4
+
5
+ 1. Configure: configs/<%= blueprint_name %> values
6
+ 2. Deploy
7
+
8
+ ## Configure
9
+
10
+ First you want to configure the `configs/<%= blueprint_name %>` [config files](https://lono.cloud/docs/core/configs/). You can use [lono seed](https://lono.cloud/reference/lono-seed/) to configure starter values quickly.
11
+
12
+ LONO_ENV=development lono seed <%= blueprint_name %>
13
+
14
+ For additional environments:
15
+
16
+ LONO_ENV=production lono seed <%= blueprint_name %>
17
+
18
+ The generated files in `config/<%= blueprint_name %>` folder look something like this:
19
+
20
+ configs/<%= blueprint_name %>/
21
+ ├── params
22
+ │ ├── development.txt
23
+ │ └── production.txt
24
+ └── variables
25
+ ├── development.rb
26
+ └── production.rb
27
+
28
+ ## Deploy
29
+
30
+ Use the [lono cfn deploy](http://lono.cloud/reference/lono-cfn-deploy/) command to deploy. Example:
31
+
32
+ LONO_ENV=development lono cfn deploy <%= blueprint_name %>-development --blueprint <%= blueprint_name %> --sure
33
+ LONO_ENV=production lono cfn deploy <%= blueprint_name %>-production --blueprint <%= blueprint_name %> --sure
@@ -1,3 +1,6 @@
1
+ <% if ENV['LONO_ORG'] -%>
2
+ ENV['gem_push']='no'
3
+ <% end -%>
1
4
  require "bundler/gem_tasks"
2
5
  require "rspec/core/rake_task"
3
6
 
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: 6.1.4
4
+ version: 6.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -585,8 +585,8 @@ files:
585
585
  - lib/templates/blueprint/.meta/config.yml.tt
586
586
  - lib/templates/blueprint/CHANGELOG.md
587
587
  - lib/templates/blueprint/Gemfile
588
- - lib/templates/blueprint/README.md
589
- - lib/templates/blueprint/Rakefile
588
+ - lib/templates/blueprint/README.md.tt
589
+ - lib/templates/blueprint/Rakefile.tt
590
590
  - lib/templates/blueprint/seed/configs.rb
591
591
  - lib/templates/blueprint_configs/configs/%blueprint_name%/params/development.txt
592
592
  - lib/templates/blueprint_configs/configs/%blueprint_name%/params/production.txt
@@ -1,37 +0,0 @@
1
- # Blueprint Starter README
2
-
3
- ## Usage
4
-
5
- 1. Configure: configs/BLUEPRINT values
6
- 2. Deploy blueprint
7
-
8
- ## Configure
9
-
10
- First you want to configure the `configs/BLUEPRINT/params` and `configs/BLUEPRINT/variables` files.
11
-
12
- If the blueprint has implemented it, you can use `lono seed` to quickly configure starter values for these `config/BLUEPRINT` files.
13
-
14
- LONO_ENV=development lono seed BLUEPRINT --args key1:value1 key2:value2
15
-
16
- To additional environments:
17
-
18
- LONO_ENV=production lono seed BLUEPRINT --args key1:value1 key2:value2
19
-
20
- The generated files in `config/BLUEPRINT` folder look something like this:
21
-
22
- configs/BLUEPRINT/
23
- ├── params
24
- │ ├── development.txt
25
- │ └── production.txt
26
- └── variables
27
- ├── development.rb
28
- └── production.rb
29
-
30
- The PARAM depends on how the blueprint was authored. The PARAM conventionally defaults to BLUEPRINT.
31
-
32
- ## Deploy
33
-
34
- Use the [lono cfn deploy](http://lono.cloud/reference/lono-cfn-deploy/) command to deploy. Example:
35
-
36
- LONO_ENV=development lono cfn deploy BLUEPRINT-development --blueprint BLUEPRINT --iam
37
- LONO_ENV=production lono cfn deploy BLUEPRINT-production --blueprint BLUEPRINT --iam