app_archetype 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -1
- data/Gemfile.lock +75 -73
- data/README.md +17 -2
- data/app_archetype.gemspec +21 -21
- data/lib/app_archetype/generators.rb +3 -2
- data/lib/app_archetype/template/manifest.rb +17 -1
- data/lib/app_archetype/template_manager.rb +4 -6
- data/lib/app_archetype/version.rb +1 -1
- data/spec/app_archetype/cli_spec.rb +0 -131
- data/spec/app_archetype/commands/list_templates_spec.rb +1 -1
- data/spec/app_archetype/commands/print_template_variables_spec.rb +2 -2
- data/spec/app_archetype/template/manifest_spec.rb +31 -1
- metadata +86 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2b142bbc357dbbf5d4196ce7a4722a2a4f780e88a0afadd5da9f5de4c43bf1
|
4
|
+
data.tar.gz: 3f2f90d54ce3e3b2d9842c6c0410e1f7326432b281ba34b4a1fd14df3925b566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc28e914d6d02f31bb69b5953afdcfbe0296570b0bcad9b318ffbfb1da82c647ae22fb3da9e59407c2995b773c2e9719225b78e8319e106041c58a8e2a349634
|
7
|
+
data.tar.gz: cef1643531ef6f037ff1cfb5ec7de69c6861fad26783f8e1e2c61eb0cebca7a5d20f3b6498ee1353d8eab82f0944e2b172ca4dfe40d7c3b69c6528ece5457a2d
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
AllCops:
|
3
|
-
TargetRubyVersion: 2.
|
3
|
+
TargetRubyVersion: 2.6
|
4
4
|
|
5
5
|
Style/FrozenStringLiteralComment:
|
6
6
|
Enabled: false
|
@@ -33,3 +33,9 @@
|
|
33
33
|
|
34
34
|
Style/IfUnlessModifier:
|
35
35
|
Enabled: false
|
36
|
+
|
37
|
+
Style/GlobalStdStream:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/OptionalBooleanParameter:
|
41
|
+
Enabled: false
|
data/Gemfile.lock
CHANGED
@@ -1,39 +1,39 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
app_archetype (1.
|
5
|
-
cli-format
|
4
|
+
app_archetype (1.4.0)
|
5
|
+
cli-format
|
6
6
|
hashie
|
7
|
-
highline
|
8
|
-
json
|
9
|
-
json-schema
|
10
|
-
jsonnet
|
11
|
-
logger
|
12
|
-
os
|
13
|
-
ostruct
|
14
|
-
ruby-handlebars
|
15
|
-
thor
|
16
|
-
tty-prompt
|
17
|
-
tty-table
|
7
|
+
highline
|
8
|
+
json
|
9
|
+
json-schema
|
10
|
+
jsonnet
|
11
|
+
logger
|
12
|
+
os
|
13
|
+
ostruct
|
14
|
+
ruby-handlebars
|
15
|
+
thor
|
16
|
+
tty-prompt
|
17
|
+
tty-table
|
18
18
|
|
19
19
|
GEM
|
20
20
|
remote: https://rubygems.org/
|
21
21
|
specs:
|
22
|
-
activesupport (6.1.4.
|
22
|
+
activesupport (6.1.4.4)
|
23
23
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
24
24
|
i18n (>= 1.6, < 2)
|
25
25
|
minitest (>= 5.1)
|
26
26
|
tzinfo (~> 2.0)
|
27
27
|
zeitwerk (~> 2.3)
|
28
|
-
addressable (2.
|
28
|
+
addressable (2.8.0)
|
29
29
|
public_suffix (>= 2.0.2, < 5.0)
|
30
|
-
ast (2.4.
|
30
|
+
ast (2.4.2)
|
31
31
|
axiom-types (0.1.1)
|
32
32
|
descendants_tracker (~> 0.0.4)
|
33
33
|
ice_nine (~> 0.11.0)
|
34
34
|
thread_safe (~> 0.3, >= 0.3.1)
|
35
|
-
bump (0.
|
36
|
-
cli-format (0.2.
|
35
|
+
bump (0.10.0)
|
36
|
+
cli-format (0.2.1)
|
37
37
|
activesupport
|
38
38
|
text-table
|
39
39
|
zeitwerk
|
@@ -43,8 +43,8 @@ GEM
|
|
43
43
|
concurrent-ruby (1.1.9)
|
44
44
|
descendants_tracker (0.0.4)
|
45
45
|
thread_safe (~> 0.3, >= 0.3.1)
|
46
|
-
diff-lcs (1.
|
47
|
-
docile (1.
|
46
|
+
diff-lcs (1.5.0)
|
47
|
+
docile (1.4.0)
|
48
48
|
equalizer (0.0.11)
|
49
49
|
erubis (2.7.0)
|
50
50
|
flay (2.12.1)
|
@@ -56,9 +56,9 @@ GEM
|
|
56
56
|
path_expander (~> 1.0)
|
57
57
|
ruby_parser (~> 3.1, > 3.1.0)
|
58
58
|
sexp_processor (~> 4.8)
|
59
|
-
hashie (
|
59
|
+
hashie (5.0.0)
|
60
60
|
highline (2.0.3)
|
61
|
-
i18n (1.
|
61
|
+
i18n (1.9.1)
|
62
62
|
concurrent-ruby (~> 1.0)
|
63
63
|
ice_nine (0.11.2)
|
64
64
|
json (2.6.1)
|
@@ -69,14 +69,14 @@ GEM
|
|
69
69
|
kwalify (0.7.2)
|
70
70
|
launchy (2.5.0)
|
71
71
|
addressable (~> 2.7)
|
72
|
-
logger (1.
|
72
|
+
logger (1.5.0)
|
73
73
|
method_source (1.0.0)
|
74
74
|
mini_portile2 (2.7.1)
|
75
|
-
minitest (5.
|
75
|
+
minitest (5.15.0)
|
76
76
|
os (1.1.4)
|
77
|
-
ostruct (0.5.
|
78
|
-
parallel (1.
|
79
|
-
parser (
|
77
|
+
ostruct (0.5.3)
|
78
|
+
parallel (1.21.0)
|
79
|
+
parser (3.1.0.0)
|
80
80
|
ast (~> 2.4.1)
|
81
81
|
parslet (1.8.2)
|
82
82
|
pastel (0.8.0)
|
@@ -85,50 +85,48 @@ GEM
|
|
85
85
|
private_gem (1.1.4)
|
86
86
|
bundler (> 1.7, < 3.0)
|
87
87
|
thor
|
88
|
-
pry (0.
|
88
|
+
pry (0.14.1)
|
89
89
|
coderay (~> 1.1)
|
90
90
|
method_source (~> 1.0)
|
91
|
-
psych (3.1.0)
|
92
91
|
public_suffix (4.0.6)
|
93
|
-
rainbow (3.
|
94
|
-
rake (13.0.
|
95
|
-
reek (6.0
|
92
|
+
rainbow (3.1.1)
|
93
|
+
rake (13.0.6)
|
94
|
+
reek (6.1.0)
|
96
95
|
kwalify (~> 0.7.0)
|
97
|
-
parser (
|
98
|
-
psych (~> 3.1.0)
|
96
|
+
parser (~> 3.1.0)
|
99
97
|
rainbow (>= 2.0, < 4.0)
|
100
|
-
regexp_parser (
|
101
|
-
rexml (3.2.
|
102
|
-
rspec (3.
|
103
|
-
rspec-core (~> 3.
|
104
|
-
rspec-expectations (~> 3.
|
105
|
-
rspec-mocks (~> 3.
|
106
|
-
rspec-core (3.
|
107
|
-
rspec-support (~> 3.
|
108
|
-
rspec-expectations (3.
|
98
|
+
regexp_parser (2.2.0)
|
99
|
+
rexml (3.2.5)
|
100
|
+
rspec (3.10.0)
|
101
|
+
rspec-core (~> 3.10.0)
|
102
|
+
rspec-expectations (~> 3.10.0)
|
103
|
+
rspec-mocks (~> 3.10.0)
|
104
|
+
rspec-core (3.10.2)
|
105
|
+
rspec-support (~> 3.10.0)
|
106
|
+
rspec-expectations (3.10.2)
|
109
107
|
diff-lcs (>= 1.2.0, < 2.0)
|
110
|
-
rspec-support (~> 3.
|
111
|
-
rspec-mocks (3.
|
108
|
+
rspec-support (~> 3.10.0)
|
109
|
+
rspec-mocks (3.10.3)
|
112
110
|
diff-lcs (>= 1.2.0, < 2.0)
|
113
|
-
rspec-support (~> 3.
|
114
|
-
rspec-support (3.
|
115
|
-
rubocop (
|
111
|
+
rspec-support (~> 3.10.0)
|
112
|
+
rspec-support (3.10.3)
|
113
|
+
rubocop (1.25.1)
|
116
114
|
parallel (~> 1.10)
|
117
|
-
parser (>=
|
115
|
+
parser (>= 3.1.0.0)
|
118
116
|
rainbow (>= 2.2.2, < 4.0)
|
119
|
-
regexp_parser (>= 1.
|
117
|
+
regexp_parser (>= 1.8, < 3.0)
|
120
118
|
rexml
|
121
|
-
rubocop-ast (>=
|
119
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
122
120
|
ruby-progressbar (~> 1.7)
|
123
|
-
unicode-display_width (>= 1.4.0, <
|
124
|
-
rubocop-ast (
|
125
|
-
parser (>=
|
121
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
122
|
+
rubocop-ast (1.15.1)
|
123
|
+
parser (>= 3.0.1.1)
|
126
124
|
ruby-handlebars (0.4.0)
|
127
125
|
parslet (~> 1.6, >= 1.6.2)
|
128
|
-
ruby-progressbar (1.
|
129
|
-
ruby_parser (3.
|
130
|
-
sexp_processor (~> 4.
|
131
|
-
rubycritic (4.
|
126
|
+
ruby-progressbar (1.11.0)
|
127
|
+
ruby_parser (3.18.1)
|
128
|
+
sexp_processor (~> 4.16)
|
129
|
+
rubycritic (4.6.1)
|
132
130
|
flay (~> 2.8)
|
133
131
|
flog (~> 4.4)
|
134
132
|
launchy (>= 2.0.0)
|
@@ -139,18 +137,20 @@ GEM
|
|
139
137
|
simplecov (>= 0.17.0)
|
140
138
|
tty-which (~> 0.4.0)
|
141
139
|
virtus (~> 1.0)
|
142
|
-
sexp_processor (4.
|
143
|
-
simplecov (0.
|
140
|
+
sexp_processor (4.16.0)
|
141
|
+
simplecov (0.21.2)
|
144
142
|
docile (~> 1.1)
|
145
143
|
simplecov-html (~> 0.11)
|
144
|
+
simplecov_json_formatter (~> 0.1)
|
146
145
|
simplecov-html (0.12.3)
|
146
|
+
simplecov_json_formatter (0.1.3)
|
147
147
|
strings (0.2.1)
|
148
148
|
strings-ansi (~> 0.2)
|
149
149
|
unicode-display_width (>= 1.5, < 3.0)
|
150
150
|
unicode_utils (~> 1.4)
|
151
151
|
strings-ansi (0.2.0)
|
152
152
|
text-table (1.2.4)
|
153
|
-
thor (1.
|
153
|
+
thor (1.2.1)
|
154
154
|
thread_safe (0.3.6)
|
155
155
|
tty-color (0.6.0)
|
156
156
|
tty-cursor (0.7.1)
|
@@ -169,31 +169,33 @@ GEM
|
|
169
169
|
tty-which (0.4.2)
|
170
170
|
tzinfo (2.0.4)
|
171
171
|
concurrent-ruby (~> 1.0)
|
172
|
-
unicode-display_width (1.
|
172
|
+
unicode-display_width (2.1.0)
|
173
173
|
unicode_utils (1.4.0)
|
174
174
|
virtus (1.0.5)
|
175
175
|
axiom-types (~> 0.1)
|
176
176
|
coercible (~> 1.0)
|
177
177
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
178
178
|
equalizer (~> 0.0, >= 0.0.9)
|
179
|
+
webrick (1.7.0)
|
179
180
|
wisper (2.0.1)
|
180
|
-
yard (0.9.
|
181
|
-
|
181
|
+
yard (0.9.27)
|
182
|
+
webrick (~> 1.7.0)
|
183
|
+
zeitwerk (2.5.4)
|
182
184
|
|
183
185
|
PLATFORMS
|
184
186
|
ruby
|
185
187
|
|
186
188
|
DEPENDENCIES
|
187
189
|
app_archetype!
|
188
|
-
bump
|
189
|
-
private_gem
|
190
|
-
pry
|
191
|
-
rake
|
192
|
-
rspec
|
193
|
-
rubocop
|
194
|
-
rubycritic
|
195
|
-
simplecov
|
196
|
-
yard
|
190
|
+
bump
|
191
|
+
private_gem
|
192
|
+
pry
|
193
|
+
rake
|
194
|
+
rspec
|
195
|
+
rubocop
|
196
|
+
rubycritic
|
197
|
+
simplecov
|
198
|
+
yard
|
197
199
|
|
198
200
|
BUNDLED WITH
|
199
201
|
2.2.15
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ A standalone generator can be written using the standalone render method exposed
|
|
76
76
|
```ruby
|
77
77
|
#!/usr/bin/env ruby
|
78
78
|
|
79
|
-
|
79
|
+
require 'app_archetype'
|
80
80
|
|
81
81
|
puts 'CREATE NEW COMMAND'
|
82
82
|
|
@@ -85,6 +85,16 @@ manifest = AppArchetype.render_template(
|
|
85
85
|
template_name: 'command',
|
86
86
|
destination_path: File.expand_path(File.join(__dir__, '..'))
|
87
87
|
)
|
88
|
+
|
89
|
+
puts <<~NEXT_STEPS
|
90
|
+
✔ Command created
|
91
|
+
|
92
|
+
TODO:
|
93
|
+
NEXT_STEPS
|
94
|
+
|
95
|
+
manifest.next_steps.each do |step|
|
96
|
+
puts step
|
97
|
+
end
|
88
98
|
```
|
89
99
|
|
90
100
|
## Usage
|
@@ -126,7 +136,11 @@ Template manifests describe what should be done with a template at render time.
|
|
126
136
|
"type": "string",
|
127
137
|
"default": "bar"
|
128
138
|
}
|
129
|
-
}
|
139
|
+
},
|
140
|
+
"next_steps": [
|
141
|
+
"TODO:",
|
142
|
+
"Restart your machine"
|
143
|
+
]
|
130
144
|
}
|
131
145
|
```
|
132
146
|
|
@@ -134,6 +148,7 @@ Template manifests describe what should be done with a template at render time.
|
|
134
148
|
- `version` should be the version of the template
|
135
149
|
- `metadata.app_archetype` is information about the manifest for the app archetype gem. `metadata.app_archetype.version` is required, and must be less than the version of the currently installed gem.
|
136
150
|
- `variables` is an object of variable descriptions
|
151
|
+
- `next_steps` is an array of human readable instructions on what to do after the manifest has been applied
|
137
152
|
|
138
153
|
#### Variable Descriptions
|
139
154
|
|
data/app_archetype.gemspec
CHANGED
@@ -16,27 +16,27 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
-
spec.add_dependency 'cli-format'
|
19
|
+
spec.add_dependency 'cli-format'
|
20
20
|
spec.add_dependency 'hashie'
|
21
|
-
spec.add_dependency 'highline'
|
22
|
-
spec.add_dependency 'json'
|
23
|
-
spec.add_dependency 'jsonnet'
|
24
|
-
spec.add_dependency 'json-schema'
|
25
|
-
spec.add_dependency 'logger'
|
26
|
-
spec.add_dependency 'os'
|
27
|
-
spec.add_dependency 'ostruct'
|
28
|
-
spec.add_dependency 'ruby-handlebars'
|
29
|
-
spec.add_dependency 'thor'
|
30
|
-
spec.add_dependency 'tty-prompt'
|
31
|
-
spec.add_dependency 'tty-table'
|
21
|
+
spec.add_dependency 'highline'
|
22
|
+
spec.add_dependency 'json'
|
23
|
+
spec.add_dependency 'jsonnet'
|
24
|
+
spec.add_dependency 'json-schema'
|
25
|
+
spec.add_dependency 'logger'
|
26
|
+
spec.add_dependency 'os'
|
27
|
+
spec.add_dependency 'ostruct'
|
28
|
+
spec.add_dependency 'ruby-handlebars'
|
29
|
+
spec.add_dependency 'thor'
|
30
|
+
spec.add_dependency 'tty-prompt'
|
31
|
+
spec.add_dependency 'tty-table'
|
32
32
|
|
33
|
-
spec.add_development_dependency 'bump'
|
34
|
-
spec.add_development_dependency 'private_gem'
|
35
|
-
spec.add_development_dependency 'pry'
|
36
|
-
spec.add_development_dependency 'rake'
|
37
|
-
spec.add_development_dependency 'rspec'
|
38
|
-
spec.add_development_dependency 'rubocop'
|
39
|
-
spec.add_development_dependency 'rubycritic'
|
40
|
-
spec.add_development_dependency 'simplecov'
|
41
|
-
spec.add_development_dependency 'yard'
|
33
|
+
spec.add_development_dependency 'bump'
|
34
|
+
spec.add_development_dependency 'private_gem'
|
35
|
+
spec.add_development_dependency 'pry'
|
36
|
+
spec.add_development_dependency 'rake'
|
37
|
+
spec.add_development_dependency 'rspec'
|
38
|
+
spec.add_development_dependency 'rubocop'
|
39
|
+
spec.add_development_dependency 'rubycritic'
|
40
|
+
spec.add_development_dependency 'simplecov'
|
41
|
+
spec.add_development_dependency 'yard'
|
42
42
|
end
|
@@ -25,7 +25,8 @@ module AppArchetype
|
|
25
25
|
'version' => AppArchetype::VERSION
|
26
26
|
}
|
27
27
|
},
|
28
|
-
'variables' => DEFAULT_VARS
|
28
|
+
'variables' => DEFAULT_VARS,
|
29
|
+
'next_steps' => []
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
@@ -48,7 +49,7 @@ module AppArchetype
|
|
48
49
|
MD
|
49
50
|
end
|
50
51
|
|
51
|
-
class <<self
|
52
|
+
class << self
|
52
53
|
##
|
53
54
|
# Render empty template renders a manifest and template folder at
|
54
55
|
# the given path.
|
@@ -38,11 +38,14 @@ module AppArchetype
|
|
38
38
|
},
|
39
39
|
variables: {
|
40
40
|
type: 'object'
|
41
|
+
},
|
42
|
+
next_steps: {
|
43
|
+
type: 'array'
|
41
44
|
}
|
42
45
|
}
|
43
46
|
}.freeze
|
44
47
|
|
45
|
-
class <<self
|
48
|
+
class << self
|
46
49
|
##
|
47
50
|
# Creates a [AppArchetype::Template] from a manifest json so long as the
|
48
51
|
# manifest is compatible with this version of AppArchetype.
|
@@ -130,6 +133,19 @@ module AppArchetype
|
|
130
133
|
@data.metadata
|
131
134
|
end
|
132
135
|
|
136
|
+
##
|
137
|
+
# Next steps getter
|
138
|
+
#
|
139
|
+
# @return [String]
|
140
|
+
#
|
141
|
+
def next_steps
|
142
|
+
steps = @data.next_steps
|
143
|
+
|
144
|
+
return [] unless steps
|
145
|
+
|
146
|
+
steps
|
147
|
+
end
|
148
|
+
|
133
149
|
##
|
134
150
|
# Parent path of the manifest (working directory)
|
135
151
|
#
|
@@ -27,12 +27,10 @@ module AppArchetype
|
|
27
27
|
Dir.glob(
|
28
28
|
File.join(@template_dir, '**', 'manifest.json*')
|
29
29
|
).each do |manifest|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
next
|
35
|
-
end
|
30
|
+
@manifests << AppArchetype::Template::Manifest.new_from_file(manifest)
|
31
|
+
rescue StandardError
|
32
|
+
puts "WARN: `#{manifest}` is invalid, skipping"
|
33
|
+
next
|
36
34
|
end
|
37
35
|
end
|
38
36
|
|
@@ -361,134 +361,3 @@ RSpec.describe AppArchetype::CLI do
|
|
361
361
|
end
|
362
362
|
end
|
363
363
|
end
|
364
|
-
|
365
|
-
# RSpec.xdescribe AppArchetype::CLI do
|
366
|
-
# subject { described_class.new }
|
367
|
-
|
368
|
-
# describe '.manager' do
|
369
|
-
# let(:manager) { double }
|
370
|
-
# let(:template_dir) { 'path/to/templates' }
|
371
|
-
|
372
|
-
# before do
|
373
|
-
# allow(described_class).to receive(:template_dir).and_return(template_dir)
|
374
|
-
# allow(AppArchetype::TemplateManager).to receive(:new).and_return(manager)
|
375
|
-
|
376
|
-
# allow(manager).to receive(:load)
|
377
|
-
|
378
|
-
# @manager = described_class.manager
|
379
|
-
# end
|
380
|
-
|
381
|
-
# it 'creates a manager' do
|
382
|
-
# expect(AppArchetype::TemplateManager)
|
383
|
-
# .to have_received(:new)
|
384
|
-
# .with(template_dir)
|
385
|
-
|
386
|
-
# expect(manager).to have_received(:load)
|
387
|
-
# expect(@manager).to eq manager
|
388
|
-
# end
|
389
|
-
# end
|
390
|
-
|
391
|
-
# describe '.template_dir' do
|
392
|
-
# let(:env_template_dir) { 'path/to/templates' }
|
393
|
-
# let(:exist) { true }
|
394
|
-
|
395
|
-
# before do
|
396
|
-
# allow(ENV).to receive(:[])
|
397
|
-
# .with('ARCHETYPE_TEMPLATE_DIR')
|
398
|
-
# .and_return(env_template_dir)
|
399
|
-
|
400
|
-
# allow(File).to receive(:exist?).and_return(exist)
|
401
|
-
# end
|
402
|
-
|
403
|
-
# it 'returns template dir' do
|
404
|
-
# expect(described_class.template_dir).to eq env_template_dir
|
405
|
-
# end
|
406
|
-
|
407
|
-
# context 'when ARCHETYPE_TEMPLATE_DIR environment variable not set' do
|
408
|
-
# let(:env_template_dir) { nil }
|
409
|
-
|
410
|
-
# it 'raises environment not set error' do
|
411
|
-
# expect { described_class.template_dir }.to raise_error(
|
412
|
-
# RuntimeError,
|
413
|
-
# 'ARCHETYPE_TEMPLATE_DIR environment variable not set'
|
414
|
-
# )
|
415
|
-
# end
|
416
|
-
# end
|
417
|
-
|
418
|
-
# context 'when templates do not exist' do
|
419
|
-
# let(:exist) { false }
|
420
|
-
|
421
|
-
# it 'raises environment not set error' do
|
422
|
-
# expect { described_class.template_dir }.to raise_error(
|
423
|
-
# RuntimeError,
|
424
|
-
# "ARCHETYPE_TEMPLATE_DIR #{env_template_dir} does not exist"
|
425
|
-
# )
|
426
|
-
# end
|
427
|
-
# end
|
428
|
-
# end
|
429
|
-
|
430
|
-
# describe '.editor' do
|
431
|
-
# let(:env_editor) { 'ivm' }
|
432
|
-
# let(:exit_status) { 0 }
|
433
|
-
|
434
|
-
# before do
|
435
|
-
# allow(ENV).to receive(:[])
|
436
|
-
# .with('ARCHETYPE_EDITOR')
|
437
|
-
# .and_return(env_editor)
|
438
|
-
|
439
|
-
# allow(described_class).to receive(:`)
|
440
|
-
# allow($?).to receive(:exitstatus).and_return(exit_status)
|
441
|
-
# end
|
442
|
-
|
443
|
-
# it 'returns editor' do
|
444
|
-
# expect(described_class.editor).to eq env_editor
|
445
|
-
# end
|
446
|
-
|
447
|
-
# context 'when ARCHETYPE_EDITOR environment variable not set' do
|
448
|
-
# let(:env_editor) { nil }
|
449
|
-
|
450
|
-
# it 'raises environment not set error' do
|
451
|
-
# expect { described_class.editor }.to raise_error(
|
452
|
-
# RuntimeError,
|
453
|
-
# 'ARCHETYPE_EDITOR environment variable not set'
|
454
|
-
# )
|
455
|
-
# end
|
456
|
-
# end
|
457
|
-
|
458
|
-
# context 'when editor check does not pass' do
|
459
|
-
# let(:exit_status) { 1 }
|
460
|
-
|
461
|
-
# before do
|
462
|
-
# allow(AppArchetype::CLI).to receive(:print_warning)
|
463
|
-
# described_class.editor
|
464
|
-
# end
|
465
|
-
|
466
|
-
# it 'logs a warning' do
|
467
|
-
# expect(AppArchetype::CLI)
|
468
|
-
# .to have_received(:print_warning)
|
469
|
-
# .with(
|
470
|
-
# "WARN: Configured editor #{env_editor} is not installed correctly "\
|
471
|
-
# 'please check your configuration'
|
472
|
-
# )
|
473
|
-
# end
|
474
|
-
# end
|
475
|
-
# end
|
476
|
-
|
477
|
-
# describe '.exit_on_failure?' do
|
478
|
-
# it 'returns true' do
|
479
|
-
# expect(described_class.exit_on_failure?).to be true
|
480
|
-
# end
|
481
|
-
# end
|
482
|
-
|
483
|
-
# describe '#version' do
|
484
|
-
# before do
|
485
|
-
# allow(subject).to receive(:print_message)
|
486
|
-
# subject.version
|
487
|
-
# end
|
488
|
-
|
489
|
-
# it 'prints current version number' do
|
490
|
-
# expect(subject).to have_received(:print_message)
|
491
|
-
# .with(AppArchetype::VERSION)
|
492
|
-
# end
|
493
|
-
# end
|
494
|
-
# end
|
@@ -102,7 +102,7 @@ RSpec.describe AppArchetype::Commands::PrintTemplateVariables do
|
|
102
102
|
|
103
103
|
it 'prints manifest list table' do
|
104
104
|
expected_table = <<~TABLE
|
105
|
-
NAME DESCRIPTION DEFAULT
|
105
|
+
NAME DESCRIPTION DEFAULT#{' '}
|
106
106
|
#{variable_name} #{variable_description} #{variable_default}
|
107
107
|
TABLE
|
108
108
|
|
@@ -136,7 +136,7 @@ RSpec.describe AppArchetype::Commands::PrintTemplateVariables do
|
|
136
136
|
|
137
137
|
it 'prints manifest list table' do
|
138
138
|
expected_table = <<~TABLE
|
139
|
-
NAME DESCRIPTION DEFAULT
|
139
|
+
NAME DESCRIPTION DEFAULT#{' '}
|
140
140
|
#{variable_name} #{variable_description} #{variable_default}
|
141
141
|
TABLE
|
142
142
|
|
@@ -27,12 +27,21 @@ RSpec.describe AppArchetype::Template::Manifest do
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
end
|
30
|
+
|
31
|
+
let(:next_steps) do
|
32
|
+
[
|
33
|
+
'do something',
|
34
|
+
'do something else'
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
30
38
|
let(:content) do
|
31
39
|
{
|
32
40
|
'name' => manifest_name,
|
33
41
|
'version' => version,
|
34
42
|
'metadata' => app_archetype_meta,
|
35
|
-
'variables' => vars
|
43
|
+
'variables' => vars,
|
44
|
+
'next_steps' => next_steps
|
36
45
|
}.to_json
|
37
46
|
end
|
38
47
|
|
@@ -67,6 +76,27 @@ RSpec.describe AppArchetype::Template::Manifest do
|
|
67
76
|
expect(@parsed.variables)
|
68
77
|
.to be_a AppArchetype::Template::VariableManager
|
69
78
|
end
|
79
|
+
|
80
|
+
it 'has next steps' do
|
81
|
+
expect(@parsed.next_steps)
|
82
|
+
.to eq next_steps
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'when next steps is not defined' do
|
86
|
+
let(:content) do
|
87
|
+
{
|
88
|
+
'name' => manifest_name,
|
89
|
+
'version' => version,
|
90
|
+
'metadata' => app_archetype_meta,
|
91
|
+
'variables' => vars
|
92
|
+
}.to_json
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'returns empty array for next steps' do
|
96
|
+
expect(@parsed.next_steps)
|
97
|
+
.to eq []
|
98
|
+
end
|
99
|
+
end
|
70
100
|
end
|
71
101
|
|
72
102
|
context 'when manifest is from a later version of app archetype' do
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_archetype
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bigger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cli-format
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hashie
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,282 +42,282 @@ dependencies:
|
|
42
42
|
name: highline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jsonnet
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
75
|
+
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: json-schema
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: logger
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: os
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: ostruct
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
131
|
+
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
138
|
+
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: ruby-handlebars
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0
|
145
|
+
version: '0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0
|
152
|
+
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: thor
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: tty-prompt
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0
|
173
|
+
version: '0'
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0
|
180
|
+
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: tty-table
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0
|
187
|
+
version: '0'
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- - "
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0
|
194
|
+
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: bump
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0
|
201
|
+
version: '0'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - "
|
206
|
+
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0
|
208
|
+
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: private_gem
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
215
|
+
version: '0'
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
222
|
+
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: pry
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
|
-
- - "
|
227
|
+
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: '0
|
229
|
+
version: '0'
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
|
-
- - "
|
234
|
+
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: '0
|
236
|
+
version: '0'
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: rake
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- - "
|
241
|
+
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
243
|
+
version: '0'
|
244
244
|
type: :development
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- - "
|
248
|
+
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: '
|
250
|
+
version: '0'
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: rspec
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
|
-
- - "
|
255
|
+
- - ">="
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: '
|
257
|
+
version: '0'
|
258
258
|
type: :development
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
|
-
- - "
|
262
|
+
- - ">="
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: '
|
264
|
+
version: '0'
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: rubocop
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
268
268
|
requirements:
|
269
|
-
- - "
|
269
|
+
- - ">="
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version: '0
|
271
|
+
version: '0'
|
272
272
|
type: :development
|
273
273
|
prerelease: false
|
274
274
|
version_requirements: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
|
-
- - "
|
276
|
+
- - ">="
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version: '0
|
278
|
+
version: '0'
|
279
279
|
- !ruby/object:Gem::Dependency
|
280
280
|
name: rubycritic
|
281
281
|
requirement: !ruby/object:Gem::Requirement
|
282
282
|
requirements:
|
283
|
-
- - "
|
283
|
+
- - ">="
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version: '
|
285
|
+
version: '0'
|
286
286
|
type: :development
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
|
-
- - "
|
290
|
+
- - ">="
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version: '
|
292
|
+
version: '0'
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: simplecov
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
296
296
|
requirements:
|
297
|
-
- - "
|
297
|
+
- - ">="
|
298
298
|
- !ruby/object:Gem::Version
|
299
|
-
version: '0
|
299
|
+
version: '0'
|
300
300
|
type: :development
|
301
301
|
prerelease: false
|
302
302
|
version_requirements: !ruby/object:Gem::Requirement
|
303
303
|
requirements:
|
304
|
-
- - "
|
304
|
+
- - ">="
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version: '0
|
306
|
+
version: '0'
|
307
307
|
- !ruby/object:Gem::Dependency
|
308
308
|
name: yard
|
309
309
|
requirement: !ruby/object:Gem::Requirement
|
310
310
|
requirements:
|
311
|
-
- - "
|
311
|
+
- - ">="
|
312
312
|
- !ruby/object:Gem::Version
|
313
|
-
version: '0
|
313
|
+
version: '0'
|
314
314
|
type: :development
|
315
315
|
prerelease: false
|
316
316
|
version_requirements: !ruby/object:Gem::Requirement
|
317
317
|
requirements:
|
318
|
-
- - "
|
318
|
+
- - ">="
|
319
319
|
- !ruby/object:Gem::Version
|
320
|
-
version: '0
|
320
|
+
version: '0'
|
321
321
|
description:
|
322
322
|
email:
|
323
323
|
- andrew.bigger@gmail.com
|