lono 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/lono/cli.rb +1 -0
- data/lib/lono/importer.rb +6 -4
- data/lib/lono/version.rb +1 -1
- data/spec/fixtures/my_project/config/templates/base/stacks.rb +2 -0
- data/spec/lib/lono_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e445627e2c6b9a69d5e13757ae29b8aca193c24d
|
4
|
+
data.tar.gz: 041cab4719d07cfc12dccc2abd0dbf2c60dd1e29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e488c0cc40fb927f028f876851ef10300ada4660d90f16f38737ca951499fa44be883e8d9eeb21a68013badda1c94f1946bcae74f9ee5452da43934bba0afb9
|
7
|
+
data.tar.gz: ae5a8c182ea3b47ae30b5ecf6da82f24b174f77868fa13cd61fa388f82076f7470aba031cf3fdb3126878ecfea48f0f798a5d8db3fc7402ee6da08c65365f13c
|
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
|
+
## [3.1.2]
|
7
|
+
- lono import: casing option: camelcase or dasherize
|
8
|
+
|
6
9
|
## [3.1.1]
|
7
10
|
- update lono import and new cli help
|
8
11
|
|
data/lib/lono/cli.rb
CHANGED
@@ -18,6 +18,7 @@ module Lono
|
|
18
18
|
long_desc Help.import
|
19
19
|
option :format, type: :string, default: "yaml", desc: "format for the final template"
|
20
20
|
option :project_root, default: ".", aliases: "-r", desc: "project root"
|
21
|
+
option :casing, default: "underscore", desc: "camelcase or underscore the template name"
|
21
22
|
def import(source)
|
22
23
|
Importer.new(source, options).run
|
23
24
|
end
|
data/lib/lono/importer.rb
CHANGED
@@ -13,8 +13,10 @@ class Lono::Importer
|
|
13
13
|
|
14
14
|
def run
|
15
15
|
download_template
|
16
|
-
add_template_definition
|
16
|
+
template_definition_path = add_template_definition
|
17
17
|
puts "Imported raw CloudFormation template and lono-fied it!"
|
18
|
+
puts "Template definition added to #{template_definition_path}."
|
19
|
+
puts "Template downloaded to #{dest_path}."
|
18
20
|
end
|
19
21
|
|
20
22
|
def download_template
|
@@ -29,7 +31,6 @@ class Lono::Importer
|
|
29
31
|
folder = File.dirname(dest_path)
|
30
32
|
FileUtils.mkdir_p(folder) unless File.exist?(folder)
|
31
33
|
IO.write(dest_path, result)
|
32
|
-
puts "Template downloaded to #{dest_path}."
|
33
34
|
end
|
34
35
|
|
35
36
|
# Add template definition to config/templates/base/stacks.rb.
|
@@ -42,7 +43,7 @@ class Lono::Importer
|
|
42
43
|
result = lines.join('')
|
43
44
|
IO.write(path, result)
|
44
45
|
end
|
45
|
-
|
46
|
+
path
|
46
47
|
end
|
47
48
|
|
48
49
|
def dest_path
|
@@ -50,7 +51,8 @@ class Lono::Importer
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def template_name
|
53
|
-
File.basename(@source, ".*")
|
54
|
+
name = File.basename(@source, ".*")
|
55
|
+
@options[:casing] == "camelcase" ? name.camelize : name.underscore.dasherize
|
54
56
|
end
|
55
57
|
|
56
58
|
private
|
data/lib/lono/version.rb
CHANGED
data/spec/lib/lono_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe Lono do
|
|
13
13
|
|
14
14
|
it "import should download template" do
|
15
15
|
out = execute("./bin/lono import spec/fixtures/raw_templates/aws-waf-security-automations.template #{@args}")
|
16
|
-
expect(out).to match /
|
16
|
+
expect(out).to match /Imported raw CloudFormation template/
|
17
17
|
end
|
18
18
|
end
|
19
19
|
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: 3.1.
|
4
|
+
version: 3.1.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-09-
|
11
|
+
date: 2017-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|