rubysmith 0.16.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.adoc +207 -155
- data/README.adoc +340 -94
- data/lib/rubysmith/builder.rb +1 -2
- data/lib/rubysmith/builders/bundler.rb +7 -11
- data/lib/rubysmith/builders/circle_ci.rb +8 -2
- data/lib/rubysmith/builders/console.rb +8 -2
- data/lib/rubysmith/builders/core.rb +7 -3
- data/lib/rubysmith/builders/documentation/{change.rb → citation.rb} +8 -8
- data/lib/rubysmith/builders/documentation/license.rb +9 -4
- data/lib/rubysmith/builders/documentation/readme.rb +12 -18
- data/lib/rubysmith/builders/documentation/{contribution.rb → version.rb} +10 -5
- data/lib/rubysmith/builders/git/commit.rb +3 -1
- data/lib/rubysmith/builders/git/setup.rb +2 -1
- data/lib/rubysmith/builders/git_hub.rb +8 -3
- data/lib/rubysmith/builders/guard.rb +9 -3
- data/lib/rubysmith/builders/rake.rb +8 -3
- data/lib/rubysmith/builders/reek.rb +7 -2
- data/lib/rubysmith/builders/rspec/context.rb +8 -2
- data/lib/rubysmith/builders/rspec/helper.rb +8 -2
- data/lib/rubysmith/builders/rubocop.rb +34 -0
- data/lib/rubysmith/builders/setup.rb +8 -2
- data/lib/rubysmith/cli/actions/build.rb +10 -12
- data/lib/rubysmith/cli/actions/config.rb +4 -2
- data/lib/rubysmith/cli/actions/publish.rb +21 -0
- data/lib/rubysmith/cli/parser.rb +31 -0
- data/lib/rubysmith/cli/parsers/build.rb +80 -45
- data/lib/rubysmith/cli/parsers/core.rb +14 -10
- data/lib/rubysmith/cli/shell.rb +22 -15
- data/lib/rubysmith/configuration/content.rb +170 -0
- data/lib/rubysmith/configuration/defaults.yml +88 -0
- data/lib/rubysmith/configuration/enhancers/current_time.rb +24 -0
- data/lib/rubysmith/configuration/enhancers/git_email.rb +31 -0
- data/lib/rubysmith/configuration/enhancers/git_hub_user.rb +31 -0
- data/lib/rubysmith/configuration/enhancers/git_user.rb +33 -0
- data/lib/rubysmith/configuration/loader.rb +48 -0
- data/lib/rubysmith/container.rb +1 -1
- data/lib/rubysmith/extensions/bundler.rb +30 -0
- data/lib/rubysmith/extensions/milestoner.rb +35 -0
- data/lib/rubysmith/extensions/pragmater.rb +35 -0
- data/lib/rubysmith/extensions/rubocop.rb +29 -0
- data/lib/rubysmith/extensions/tocer.rb +37 -0
- data/lib/rubysmith/identity.rb +1 -1
- data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +1 -4
- data/lib/rubysmith/templates/%project_name%/.rubocop.yml.erb +2 -0
- data/lib/rubysmith/templates/%project_name%/CITATION.cff.erb +16 -0
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +12 -9
- data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.adoc.erb +214 -0
- data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.md.erb +214 -0
- data/lib/rubysmith/templates/%project_name%/README.adoc.erb +20 -21
- data/lib/rubysmith/templates/%project_name%/README.md.erb +20 -21
- data/lib/rubysmith/templates/%project_name%/VERSIONS.adoc.erb +5 -0
- data/lib/rubysmith/templates/%project_name%/VERSIONS.md.erb +5 -0
- data/lib/rubysmith/templates/%project_name%/bin/rubocop.erb +0 -1
- data.tar.gz.sig +0 -0
- metadata +54 -38
- metadata.gz.sig +3 -2
- data/lib/rubysmith/builders/documentation/conduct.rb +0 -32
- data/lib/rubysmith/builders/pragma.rb +0 -32
- data/lib/rubysmith/builders/rubocop/formatter.rb +0 -31
- data/lib/rubysmith/builders/rubocop/setup.rb +0 -31
- data/lib/rubysmith/cli/configuration/content.rb +0 -97
- data/lib/rubysmith/cli/configuration/defaults.yml +0 -46
- data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +0 -26
- data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +0 -33
- data/lib/rubysmith/cli/configuration/enhancers/version.rb +0 -26
- data/lib/rubysmith/cli/configuration/loader.rb +0 -46
- data/lib/rubysmith/cli/parsers/assembler.rb +0 -32
- data/lib/rubysmith/cli/parsers.rb +0 -11
- data/lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb +0 -5
- data/lib/rubysmith/templates/%project_name%/CHANGES.md.erb +0 -5
- data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb +0 -114
- data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.md.erb +0 -115
- data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.adoc.erb +0 -22
- data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.md.erb +0 -22
@@ -1,33 +1,43 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "refinements/structs"
|
4
|
+
|
3
5
|
module Rubysmith
|
4
6
|
module CLI
|
5
7
|
module Parsers
|
6
8
|
# Handles parsing of Command Line Interface (CLI) build options.
|
7
9
|
class Build
|
10
|
+
using Refinements::Structs
|
11
|
+
|
8
12
|
def self.call(...) = new(...).call
|
9
13
|
|
10
|
-
def initialize
|
14
|
+
def initialize configuration = Container[:configuration],
|
15
|
+
client: Parser::CLIENT,
|
16
|
+
container: Container
|
17
|
+
@configuration = configuration
|
11
18
|
@client = client
|
12
19
|
@container = container
|
13
20
|
end
|
14
21
|
|
15
22
|
def call arguments = []
|
16
23
|
client.separator "\nBUILD OPTIONS:\n"
|
17
|
-
|
18
|
-
|
24
|
+
collate
|
25
|
+
client.parse arguments
|
26
|
+
configuration
|
19
27
|
end
|
20
28
|
|
21
29
|
private
|
22
30
|
|
23
|
-
attr_reader :client, :container
|
31
|
+
attr_reader :configuration, :client, :container
|
32
|
+
|
33
|
+
def collate = private_methods.sort.grep(/add_/).each { |method| __send__ method }
|
24
34
|
|
25
35
|
def add_amazing_print
|
26
36
|
client.on(
|
27
37
|
"--[no-]amazing_print",
|
28
38
|
"Add Amazing Print gem. #{default __method__}."
|
29
39
|
) do |value|
|
30
|
-
configuration.build_amazing_print
|
40
|
+
configuration.merge! build_amazing_print: value
|
31
41
|
end
|
32
42
|
end
|
33
43
|
|
@@ -36,16 +46,7 @@ module Rubysmith
|
|
36
46
|
"--[no-]bundler-leak",
|
37
47
|
"Add Bundler Leak gem. #{default __method__}."
|
38
48
|
) do |value|
|
39
|
-
configuration.build_bundler_leak
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def add_changes
|
44
|
-
client.on(
|
45
|
-
"--[no-]changes",
|
46
|
-
"Add CHANGES documentation. #{default __method__}."
|
47
|
-
) do |value|
|
48
|
-
configuration.build_changes = value
|
49
|
+
configuration.merge! build_bundler_leak: value
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
@@ -54,16 +55,16 @@ module Rubysmith
|
|
54
55
|
"--[no-]console",
|
55
56
|
"Add console script. #{default __method__}."
|
56
57
|
) do |value|
|
57
|
-
configuration.build_console
|
58
|
+
configuration.merge! build_console: value
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
61
62
|
def add_contributions
|
62
63
|
client.on(
|
63
64
|
"--[no-]contributions",
|
64
|
-
"Add
|
65
|
+
"Add contributions documentation. #{default __method__}."
|
65
66
|
) do |value|
|
66
|
-
configuration.build_contributions
|
67
|
+
configuration.merge! build_contributions: value
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
@@ -72,16 +73,43 @@ module Rubysmith
|
|
72
73
|
"--[no-]circle_ci",
|
73
74
|
"Add Circle CI configuration and badge. #{default __method__}."
|
74
75
|
) do |value|
|
75
|
-
configuration.build_circle_ci
|
76
|
+
configuration.merge! build_circle_ci: value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_citation
|
81
|
+
client.on(
|
82
|
+
"--[no-]citation",
|
83
|
+
"Add citation documentation. #{default __method__}."
|
84
|
+
) do |value|
|
85
|
+
configuration.merge! build_citation: value
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def add_community
|
90
|
+
client.on(
|
91
|
+
"--[no-]community",
|
92
|
+
"Add community documentation. #{default __method__}."
|
93
|
+
) do |value|
|
94
|
+
configuration.merge! build_community: value
|
76
95
|
end
|
77
96
|
end
|
78
97
|
|
79
98
|
def add_conduct
|
80
99
|
client.on(
|
81
100
|
"--[no-]conduct",
|
82
|
-
"Add
|
101
|
+
"Add code of conduct documentation. #{default __method__}."
|
102
|
+
) do |value|
|
103
|
+
configuration.merge! build_conduct: value
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def add_dead_end
|
108
|
+
client.on(
|
109
|
+
"--[no-]dead_end",
|
110
|
+
"Add Dead End gem. #{default __method__}."
|
83
111
|
) do |value|
|
84
|
-
configuration.
|
112
|
+
configuration.merge! build_dead_end: value
|
85
113
|
end
|
86
114
|
end
|
87
115
|
|
@@ -90,7 +118,7 @@ module Rubysmith
|
|
90
118
|
"--[no-]debug",
|
91
119
|
"Add Debug gem. #{default __method__}."
|
92
120
|
) do |value|
|
93
|
-
configuration.build_debug
|
121
|
+
configuration.merge! build_debug: value
|
94
122
|
end
|
95
123
|
end
|
96
124
|
|
@@ -99,7 +127,7 @@ module Rubysmith
|
|
99
127
|
"--[no-]git",
|
100
128
|
"Add Git. #{default __method__}."
|
101
129
|
) do |value|
|
102
|
-
configuration.build_git
|
130
|
+
configuration.merge! build_git: value
|
103
131
|
end
|
104
132
|
end
|
105
133
|
|
@@ -108,7 +136,7 @@ module Rubysmith
|
|
108
136
|
"--[no-]git_hub",
|
109
137
|
"Add GitHub templates. #{default __method__}."
|
110
138
|
) do |value|
|
111
|
-
configuration.build_git_hub
|
139
|
+
configuration.merge! build_git_hub: value
|
112
140
|
end
|
113
141
|
end
|
114
142
|
|
@@ -117,7 +145,7 @@ module Rubysmith
|
|
117
145
|
"--[no-]git-lint",
|
118
146
|
"Add Git Lint gem. #{default __method__}."
|
119
147
|
) do |value|
|
120
|
-
configuration.build_git_lint
|
148
|
+
configuration.merge! build_git_lint: value
|
121
149
|
end
|
122
150
|
end
|
123
151
|
|
@@ -126,16 +154,16 @@ module Rubysmith
|
|
126
154
|
"--[no-]guard",
|
127
155
|
"Add Guard gem. #{default __method__}."
|
128
156
|
) do |value|
|
129
|
-
configuration.build_guard
|
157
|
+
configuration.merge! build_guard: value
|
130
158
|
end
|
131
159
|
end
|
132
160
|
|
133
161
|
def add_license
|
134
162
|
client.on(
|
135
163
|
"--[no-]license",
|
136
|
-
"Add
|
164
|
+
"Add license documentation. #{default __method__}."
|
137
165
|
) do |value|
|
138
|
-
configuration.build_license
|
166
|
+
configuration.merge! build_license: value
|
139
167
|
end
|
140
168
|
end
|
141
169
|
|
@@ -143,8 +171,8 @@ module Rubysmith
|
|
143
171
|
client.on(
|
144
172
|
"--max",
|
145
173
|
"Use maximum/enabled options. #{default __method__}."
|
146
|
-
) do
|
147
|
-
configuration.maximize.
|
174
|
+
) do
|
175
|
+
configuration.merge!(**configuration.maximize.to_h)
|
148
176
|
end
|
149
177
|
end
|
150
178
|
|
@@ -152,8 +180,8 @@ module Rubysmith
|
|
152
180
|
client.on(
|
153
181
|
"--min",
|
154
182
|
"Use minimum/disabled options. #{default __method__}."
|
155
|
-
) do
|
156
|
-
configuration.minimize.
|
183
|
+
) do
|
184
|
+
configuration.merge!(**configuration.minimize.to_h)
|
157
185
|
end
|
158
186
|
end
|
159
187
|
|
@@ -162,16 +190,16 @@ module Rubysmith
|
|
162
190
|
"--[no-]rake",
|
163
191
|
"Add Rake gem. #{default __method__}."
|
164
192
|
) do |value|
|
165
|
-
configuration.build_rake
|
193
|
+
configuration.merge! build_rake: value
|
166
194
|
end
|
167
195
|
end
|
168
196
|
|
169
197
|
def add_readme
|
170
198
|
client.on(
|
171
199
|
"--[no-]readme",
|
172
|
-
"Add
|
200
|
+
"Add readme documentation. #{default __method__}."
|
173
201
|
) do |value|
|
174
|
-
configuration.build_readme
|
202
|
+
configuration.merge! build_readme: value
|
175
203
|
end
|
176
204
|
end
|
177
205
|
|
@@ -180,7 +208,7 @@ module Rubysmith
|
|
180
208
|
"--[no-]reek",
|
181
209
|
"Add Reek gem. #{default __method__}."
|
182
210
|
) do |value|
|
183
|
-
configuration.build_reek
|
211
|
+
configuration.merge! build_reek: value
|
184
212
|
end
|
185
213
|
end
|
186
214
|
|
@@ -189,7 +217,7 @@ module Rubysmith
|
|
189
217
|
"--[no-]refinements",
|
190
218
|
"Add Refinements gem. #{default __method__}."
|
191
219
|
) do |value|
|
192
|
-
configuration.build_refinements
|
220
|
+
configuration.merge! build_refinements: value
|
193
221
|
end
|
194
222
|
end
|
195
223
|
|
@@ -198,16 +226,16 @@ module Rubysmith
|
|
198
226
|
"--[no-]rspec",
|
199
227
|
"Add RSpec gem. #{default __method__}."
|
200
228
|
) do |value|
|
201
|
-
configuration.build_rspec
|
229
|
+
configuration.merge! build_rspec: value
|
202
230
|
end
|
203
231
|
end
|
204
232
|
|
205
233
|
def add_rubocop
|
206
234
|
client.on(
|
207
235
|
"--[no-]rubocop",
|
208
|
-
"Add
|
236
|
+
"Add RuboCop gems. #{default __method__}."
|
209
237
|
) do |value|
|
210
|
-
configuration.build_rubocop
|
238
|
+
configuration.merge! build_rubocop: value
|
211
239
|
end
|
212
240
|
end
|
213
241
|
|
@@ -216,7 +244,7 @@ module Rubysmith
|
|
216
244
|
"--[no-]setup",
|
217
245
|
"Add setup script. #{default __method__}."
|
218
246
|
) do |value|
|
219
|
-
configuration.build_setup
|
247
|
+
configuration.merge! build_setup: value
|
220
248
|
end
|
221
249
|
end
|
222
250
|
|
@@ -225,7 +253,16 @@ module Rubysmith
|
|
225
253
|
"--[no-]simple_cov",
|
226
254
|
"Add SimpleCov gem. #{default __method__}."
|
227
255
|
) do |value|
|
228
|
-
configuration.build_simple_cov
|
256
|
+
configuration.merge! build_simple_cov: value
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
def add_versions
|
261
|
+
client.on(
|
262
|
+
"--[no-]versions",
|
263
|
+
"Add version history. #{default __method__}."
|
264
|
+
) do |value|
|
265
|
+
configuration.merge! build_versions: value
|
229
266
|
end
|
230
267
|
end
|
231
268
|
|
@@ -234,7 +271,7 @@ module Rubysmith
|
|
234
271
|
"--[no-]zeitwerk",
|
235
272
|
"Add Zeitwerk gem. #{default __method__}."
|
236
273
|
) do |value|
|
237
|
-
configuration.build_zeitwerk
|
274
|
+
configuration.merge! build_zeitwerk: value
|
238
275
|
end
|
239
276
|
end
|
240
277
|
|
@@ -246,8 +283,6 @@ module Rubysmith
|
|
246
283
|
.then { |colored_boolean| "Default: #{colored_boolean}" }
|
247
284
|
end
|
248
285
|
|
249
|
-
def configuration = container[__method__]
|
250
|
-
|
251
286
|
def colorizer = container[__method__]
|
252
287
|
end
|
253
288
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "rubysmith/identity"
|
4
3
|
require "refinements/structs"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -12,21 +11,22 @@ module Rubysmith
|
|
12
11
|
|
13
12
|
def self.call(...) = new(...).call
|
14
13
|
|
15
|
-
def initialize
|
14
|
+
def initialize configuration = Container[:configuration], client: Parser::CLIENT
|
15
|
+
@configuration = configuration
|
16
16
|
@client = client
|
17
|
-
@container = container
|
18
17
|
end
|
19
18
|
|
20
19
|
def call arguments = []
|
21
20
|
client.banner = "#{Identity::LABEL} - #{Identity::SUMMARY}"
|
22
21
|
client.separator "\nUSAGE:\n"
|
23
22
|
collate
|
24
|
-
|
23
|
+
client.parse arguments
|
24
|
+
configuration
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
attr_reader :
|
29
|
+
attr_reader :configuration, :client
|
30
30
|
|
31
31
|
def collate = private_methods.sort.grep(/add_/).each { |method| __send__ method }
|
32
32
|
|
@@ -35,7 +35,7 @@ module Rubysmith
|
|
35
35
|
"--config ACTION",
|
36
36
|
%i[edit view],
|
37
37
|
"Manage gem configuration: edit or view." do |action|
|
38
|
-
configuration.action_config
|
38
|
+
configuration.merge! action_config: action
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,19 +45,23 @@ module Rubysmith
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
def add_publish
|
49
|
+
client.on "-p", "--publish VERSION", "Publish project." do |version|
|
50
|
+
configuration.merge! action_publish: true, project_version: version
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
48
54
|
def add_version
|
49
55
|
client.on "-v", "--version", "Show gem version." do
|
50
|
-
configuration.action_version
|
56
|
+
configuration.merge! action_version: true
|
51
57
|
end
|
52
58
|
end
|
53
59
|
|
54
60
|
def add_help
|
55
61
|
client.on "-h", "--help", "Show this message." do
|
56
|
-
configuration.action_help
|
62
|
+
configuration.merge! action_help: true
|
57
63
|
end
|
58
64
|
end
|
59
|
-
|
60
|
-
def configuration = container[__method__]
|
61
65
|
end
|
62
66
|
end
|
63
67
|
end
|
data/lib/rubysmith/cli/shell.rb
CHANGED
@@ -1,43 +1,50 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "milestoner"
|
4
|
+
|
3
5
|
module Rubysmith
|
4
6
|
module CLI
|
5
7
|
# The main Command Line Interface (CLI) object.
|
6
8
|
class Shell
|
7
|
-
ACTIONS = {
|
9
|
+
ACTIONS = {
|
10
|
+
config: Actions::Config.new,
|
11
|
+
build: Actions::Build.new,
|
12
|
+
publish: Actions::Publish.new
|
13
|
+
}.freeze
|
8
14
|
|
9
|
-
def initialize parser:
|
15
|
+
def initialize parser: Parser.new, actions: ACTIONS, container: Container
|
10
16
|
@parser = parser
|
11
17
|
@actions = actions
|
12
18
|
@container = container
|
13
19
|
end
|
14
20
|
|
15
21
|
def call arguments = []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
in action_version: true then logger.info configuration.version
|
20
|
-
else usage
|
21
|
-
end
|
22
|
+
perform parser.call(arguments)
|
23
|
+
rescue OptionParser::ParseError, Milestoner::Error => error
|
24
|
+
logger.error { error.message }
|
22
25
|
end
|
23
26
|
|
24
27
|
private
|
25
28
|
|
26
29
|
attr_reader :parser, :actions, :container
|
27
30
|
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
def perform configuration
|
32
|
+
case configuration
|
33
|
+
in action_config: Symbol => action then config action
|
34
|
+
in action_build: true then build configuration
|
35
|
+
in action_publish: true then publish configuration
|
36
|
+
in action_version: true then logger.info Identity::VERSION_LABEL
|
37
|
+
else usage
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
def config(action) = actions.fetch(__method__).call(action)
|
35
42
|
|
36
|
-
def build = actions.fetch(__method__).call
|
43
|
+
def build(configuration) = actions.fetch(__method__).call(configuration)
|
37
44
|
|
38
|
-
def
|
45
|
+
def publish(configuration) = actions.fetch(__method__).call(configuration)
|
39
46
|
|
40
|
-
def
|
47
|
+
def usage = logger.unknown(parser.to_s)
|
41
48
|
|
42
49
|
def logger = container[__method__]
|
43
50
|
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
4
|
+
require "refinements/arrays"
|
5
|
+
require "refinements/strings"
|
6
|
+
require "refinements/structs"
|
7
|
+
|
8
|
+
module Rubysmith
|
9
|
+
# rubocop:disable Metrics/ModuleLength
|
10
|
+
module Configuration
|
11
|
+
# Defines the common configuration content for use throughout the gem.
|
12
|
+
Content = Struct.new(
|
13
|
+
:action_build,
|
14
|
+
:action_config,
|
15
|
+
:action_help,
|
16
|
+
:action_publish,
|
17
|
+
:action_version,
|
18
|
+
:author_email,
|
19
|
+
:author_family_name,
|
20
|
+
:author_given_name,
|
21
|
+
:author_url,
|
22
|
+
:build_amazing_print,
|
23
|
+
:build_bundler_leak,
|
24
|
+
:build_circle_ci,
|
25
|
+
:build_citation,
|
26
|
+
:build_cli,
|
27
|
+
:build_community,
|
28
|
+
:build_conduct,
|
29
|
+
:build_console,
|
30
|
+
:build_contributions,
|
31
|
+
:build_dead_end,
|
32
|
+
:build_debug,
|
33
|
+
:build_git,
|
34
|
+
:build_git_hub,
|
35
|
+
:build_git_lint,
|
36
|
+
:build_guard,
|
37
|
+
:build_license,
|
38
|
+
:build_maximum,
|
39
|
+
:build_minimum,
|
40
|
+
:build_rake,
|
41
|
+
:build_readme,
|
42
|
+
:build_reek,
|
43
|
+
:build_refinements,
|
44
|
+
:build_rspec,
|
45
|
+
:build_rubocop,
|
46
|
+
:build_security,
|
47
|
+
:build_setup,
|
48
|
+
:build_simple_cov,
|
49
|
+
:build_versions,
|
50
|
+
:build_zeitwerk,
|
51
|
+
:citation_affiliation,
|
52
|
+
:citation_message,
|
53
|
+
:citation_orcid,
|
54
|
+
:documentation_format,
|
55
|
+
:extensions_milestoner_documentation_format,
|
56
|
+
:extensions_milestoner_prefixes,
|
57
|
+
:extensions_milestoner_sign,
|
58
|
+
:extensions_pragmater_comments,
|
59
|
+
:extensions_pragmater_includes,
|
60
|
+
:extensions_tocer_includes,
|
61
|
+
:extensions_tocer_label,
|
62
|
+
:git_hub_user,
|
63
|
+
:license_label,
|
64
|
+
:license_name,
|
65
|
+
:license_version,
|
66
|
+
:now,
|
67
|
+
:project_name,
|
68
|
+
:project_url_community,
|
69
|
+
:project_url_conduct,
|
70
|
+
:project_url_contributions,
|
71
|
+
:project_url_download,
|
72
|
+
:project_url_home,
|
73
|
+
:project_url_issues,
|
74
|
+
:project_url_license,
|
75
|
+
:project_url_security,
|
76
|
+
:project_url_source,
|
77
|
+
:project_url_versions,
|
78
|
+
:project_version,
|
79
|
+
:target_root,
|
80
|
+
:template_path,
|
81
|
+
:template_roots,
|
82
|
+
keyword_init: true
|
83
|
+
) do
|
84
|
+
using Refinements::Arrays
|
85
|
+
using Refinements::Strings
|
86
|
+
using Refinements::Structs
|
87
|
+
|
88
|
+
def initialize *arguments
|
89
|
+
super
|
90
|
+
|
91
|
+
self[:template_roots] ||= [Pathname(__dir__).join("../templates")]
|
92
|
+
self[:target_root] ||= Pathname.pwd
|
93
|
+
freeze
|
94
|
+
end
|
95
|
+
|
96
|
+
def add_template_roots paths
|
97
|
+
Array(paths).map { |path| Pathname path }
|
98
|
+
.including(template_roots)
|
99
|
+
.then { |roots| dup.merge! template_roots: roots }
|
100
|
+
end
|
101
|
+
|
102
|
+
def maximize = update_build_options(true)
|
103
|
+
|
104
|
+
def minimize = update_build_options(false)
|
105
|
+
|
106
|
+
def author_name = [author_given_name, author_family_name].compress.join(" ")
|
107
|
+
|
108
|
+
def license_label_version = [license_label, license_version].compress.join("-")
|
109
|
+
|
110
|
+
def project_label = project_name.titleize
|
111
|
+
|
112
|
+
def project_class = project_name.camelcase
|
113
|
+
|
114
|
+
def project_root = target_root.join(project_name)
|
115
|
+
|
116
|
+
def project_path = project_name.snakecase
|
117
|
+
|
118
|
+
def computed_project_url_community = format_url(__method__)
|
119
|
+
|
120
|
+
def computed_project_url_conduct = format_url(__method__)
|
121
|
+
|
122
|
+
def computed_project_url_contributions = format_url(__method__)
|
123
|
+
|
124
|
+
def computed_project_url_download = format_url(__method__)
|
125
|
+
|
126
|
+
def computed_project_url_home = format_url(__method__)
|
127
|
+
|
128
|
+
def computed_project_url_issues = format_url(__method__)
|
129
|
+
|
130
|
+
def computed_project_url_license = format_url(__method__)
|
131
|
+
|
132
|
+
def computed_project_url_security = format_url(__method__)
|
133
|
+
|
134
|
+
def computed_project_url_source = format_url(__method__)
|
135
|
+
|
136
|
+
def computed_project_url_versions = format_url(__method__)
|
137
|
+
|
138
|
+
def ascii_doc? = documentation_format == "adoc"
|
139
|
+
|
140
|
+
def markdown? = documentation_format == "md"
|
141
|
+
|
142
|
+
def pathway
|
143
|
+
Pathway[start_root: template_root, start_path: template_path, end_root: target_root]
|
144
|
+
end
|
145
|
+
|
146
|
+
def template_root
|
147
|
+
template_roots.map(&:expand_path)
|
148
|
+
.find { |path| path.join(String(template_path)).exist? }
|
149
|
+
end
|
150
|
+
|
151
|
+
private
|
152
|
+
|
153
|
+
def format_url kind
|
154
|
+
kind.to_s
|
155
|
+
.sub("computed_", "")
|
156
|
+
.then { |method| public_send method }
|
157
|
+
.then { |url| String url }
|
158
|
+
.then { |url| url.sub "%project_name%", project_name }
|
159
|
+
end
|
160
|
+
|
161
|
+
def update_build_options value
|
162
|
+
to_h.select { |key, _value| key.start_with? "build_" }
|
163
|
+
.transform_values { value }
|
164
|
+
.then { |attributes| dup.merge!(**attributes, build_minimum: !value) }
|
165
|
+
.freeze
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
# rubocop:enable Metrics/ModuleLength
|
170
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
:author:
|
2
|
+
:email:
|
3
|
+
:family_name:
|
4
|
+
:given_name:
|
5
|
+
:url:
|
6
|
+
:build:
|
7
|
+
:amazing_print: true
|
8
|
+
:bundler_leak: true
|
9
|
+
:circle_ci: false
|
10
|
+
:citation: true
|
11
|
+
:cli: false
|
12
|
+
:community: false
|
13
|
+
:conduct: true
|
14
|
+
:console: true
|
15
|
+
:contributions: true
|
16
|
+
:dead_end: true
|
17
|
+
:debug: true
|
18
|
+
:git: true
|
19
|
+
:git_hub: false
|
20
|
+
:git_lint: true
|
21
|
+
:guard: true
|
22
|
+
:license: true
|
23
|
+
:maximum: false
|
24
|
+
:minimum: false
|
25
|
+
:rake: true
|
26
|
+
:readme: true
|
27
|
+
:reek: true
|
28
|
+
:refinements: true
|
29
|
+
:rspec: true
|
30
|
+
:rubocop: true
|
31
|
+
:security: true
|
32
|
+
:setup: true
|
33
|
+
:simple_cov: true
|
34
|
+
:versions: true
|
35
|
+
:zeitwerk: true
|
36
|
+
:citation:
|
37
|
+
:affiliation:
|
38
|
+
:message: Please use the following metadata when citing this project in your work.
|
39
|
+
:orcid:
|
40
|
+
:documentation:
|
41
|
+
:format: "adoc"
|
42
|
+
:extensions:
|
43
|
+
:milestoner:
|
44
|
+
:documentation:
|
45
|
+
:format: "md"
|
46
|
+
:prefixes:
|
47
|
+
- Fixed
|
48
|
+
- Added
|
49
|
+
- Updated
|
50
|
+
- Removed
|
51
|
+
- Refactored
|
52
|
+
:sign: false
|
53
|
+
:pragmater:
|
54
|
+
:comments:
|
55
|
+
- "# frozen_string_literal: true"
|
56
|
+
:includes:
|
57
|
+
- "**/*.gemspec"
|
58
|
+
- "**/*.rake"
|
59
|
+
- "**/*.rb"
|
60
|
+
- "**/*bin/console"
|
61
|
+
- "**/*bin/guard"
|
62
|
+
- "**/*bin/rubocop"
|
63
|
+
- "**/*Gemfile"
|
64
|
+
- "**/*Guardfile"
|
65
|
+
- "**/*Rakefile"
|
66
|
+
:tocer:
|
67
|
+
:includes:
|
68
|
+
- "README.md"
|
69
|
+
:label: "## Table of Contents"
|
70
|
+
:git_hub:
|
71
|
+
:user:
|
72
|
+
:license:
|
73
|
+
:label: Hippocratic
|
74
|
+
:name: hippocratic
|
75
|
+
:version: 3.0
|
76
|
+
:project:
|
77
|
+
:url:
|
78
|
+
:community:
|
79
|
+
:conduct:
|
80
|
+
:contributions:
|
81
|
+
:download:
|
82
|
+
:home:
|
83
|
+
:issues:
|
84
|
+
:license:
|
85
|
+
:security:
|
86
|
+
:source:
|
87
|
+
:versions:
|
88
|
+
:version: 0.0.0
|