rubysmith 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +132 -43
- data/lib/rubysmith/builder.rb +7 -5
- data/lib/rubysmith/builders/abstract.rb +2 -2
- data/lib/rubysmith/builders/docker/ignore.rb +1 -1
- data/lib/rubysmith/cli/commands/build.rb +39 -39
- data/lib/rubysmith/configuration/defaults.yml +1 -0
- data/lib/rubysmith/container.rb +1 -0
- data/lib/rubysmith/extensions/bundler.rb +16 -4
- data/lib/rubysmith/extensions/pragmater.rb +2 -1
- data/lib/rubysmith/extensions/rubocop.rb +11 -7
- data/lib/rubysmith/extensions/tocer.rb +6 -3
- data/rubysmith.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 852415a9cd9eba19692d24330fb641cf6d19f039dbe1b90709e6c88881b844cf
|
4
|
+
data.tar.gz: 2d398b6d843ea06f0f9a6896b26eab8cc18caadcd2f6cc616a10609bbfaef907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 749891117987d624f28fef062d8b319df088a20c592b3fb17dd7ccc4ed1508a9841b7ca827c7073847bf8871a848c18feea57c364669e1240baf9f192c2c9c51
|
7
|
+
data.tar.gz: 5f9049b2774b91a3faab55f12fcd1fc1332425d514d8508f614ee18f8944fcdfc5dc2972ab737815b299d157159409329efe47d3b1ece6c87de7312cf0540cca
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -4,9 +4,12 @@
|
|
4
4
|
|
5
5
|
:bundler_inline_link: link:https://alchemists.io/articles/ruby_bundler_inline[Bundler Inline]
|
6
6
|
:development_containers_link: link:https://containers.dev[Development Containers]
|
7
|
+
:docker_alpine_ruby_link: link:https://alchemists.io/projects/docker-alpine-ruby[Docker Alpine Ruby]
|
7
8
|
:docker_link: link:https://www.docker.com[Docker]
|
8
9
|
:gemsmith_link: link:https://alchemists.io/projects/gemsmith[Gemsmith]
|
10
|
+
:runcom_link: link:https://alchemists.io/projects/runcom[Runcom]
|
9
11
|
:string_formats_link: link:https://docs.ruby-lang.org/en/3.3/format_specifications_rdoc.html[String Formats]
|
12
|
+
:xdg_link: link:https://alchemists.io/projects/xdg[XDG]
|
10
13
|
|
11
14
|
= Rubysmith
|
12
15
|
|
@@ -103,19 +106,16 @@ options, you can use `--no-*` prefixes. Example:
|
|
103
106
|
rubysmith build --name demo --no-debug --no-reek
|
104
107
|
----
|
105
108
|
|
106
|
-
With the above example, both Debug and Reek support would have been disabled when building the
|
107
|
-
`demo` project. Taking this a step further, you can also use the `--min` option to generate a
|
108
|
-
project with bare minimum of options. Example:
|
109
|
+
With the above example, both Debug and Reek support would have been disabled when building the `demo` project. Taking this a step further, you can also use the `--min` option to generate a project with bare minimum of options. Example:
|
109
110
|
|
110
111
|
[source,bash]
|
111
112
|
----
|
112
113
|
rubysmith build --name demo --min
|
113
114
|
----
|
114
115
|
|
115
|
-
The above is
|
116
|
+
The above is the same as building with _all options disabled_. This is handy in situations where you need to quickly script something up for sharing with others yet still want to avoid using a {bundler_inline_link} script so gem dependencies are not installed each time the code is run.
|
116
117
|
|
117
|
-
As shown earlier, you can combine options but be aware that order matters. Take the following, for
|
118
|
-
example, where both minimum and maximum options are used in conjunction with other options:
|
118
|
+
As shown earlier, you can combine options but be aware that order matters. Take the following, for example, where both minimum and maximum options are used in conjunction with other options:
|
119
119
|
|
120
120
|
[source,bash]
|
121
121
|
----
|
@@ -123,15 +123,9 @@ rubysmith build --name demo --min --zeitwerk
|
|
123
123
|
rubysmith build --name demo --max --no-debug
|
124
124
|
----
|
125
125
|
|
126
|
-
With the above examples, the first line will
|
127
|
-
line will _enable_ all options except Debug. This can be a handy way to build a new project with all
|
128
|
-
options either disabled or enabled with only a few select options modified. To have specific options
|
129
|
-
enabled/disabled _every time_ you build a new Ruby project, you can edit your global configuration
|
130
|
-
for making these settings permanent (see below for details).
|
126
|
+
With the above examples, the first line will _disable all options_ except Zeitwerk while the second line will _enable all options_ except Debug. This can be a handy way to build a new project with all options either disabled or enabled with only a few select options modified. To have specific options enabled/disabled _every time_, you can edit your global configuration for making these settings permanent (see below for details).
|
131
127
|
|
132
|
-
There is a lot of flexibility when building a new project through the various build options. I'll
|
133
|
-
walk you through each so you can better understand why you'd want to enable or disable any one of
|
134
|
-
them.
|
128
|
+
There is a lot of flexibility when building a new project through the various build options. I'll walk you through each so you can better understand why you'd want to enable or disable them.
|
135
129
|
|
136
130
|
===== Amazing Print
|
137
131
|
|
@@ -150,44 +144,66 @@ link:https://github.com/Shopify/bootsnap[Bootsnap] gem for improved performance.
|
|
150
144
|
The `--caliber` option allows you to build your project with the
|
151
145
|
link:https://alchemists.io/projects/caliber[Caliber] gem so you have an immediate working -- and
|
152
146
|
high quality -- link:https://docs.rubocop.org/rubocop[RuboCop] configuration. Read the Caliber
|
153
|
-
documentation for further customization.
|
147
|
+
documentation for further customization. This adds the following files when enabled:
|
148
|
+
|
149
|
+
....
|
150
|
+
├── bin
|
151
|
+
│ ├── rubocop
|
152
|
+
├── .config
|
153
|
+
│ └── rubocop
|
154
|
+
│ └── config.yml
|
155
|
+
....
|
154
156
|
|
155
157
|
===== Circle CI
|
156
158
|
|
157
159
|
The `--circle_ci` option allows you to build your project with link:https://circleci.com[Circle CI]
|
158
|
-
configured so you can get your project building as quickly as possible.
|
160
|
+
configured so you can get your project building as quickly as possible. This adds the following file when enabled:
|
161
|
+
|
162
|
+
....
|
163
|
+
├── .circleci
|
164
|
+
│ └── config.yml
|
165
|
+
....
|
159
166
|
|
160
167
|
===== Citation
|
161
168
|
|
162
169
|
The `--citation` option allows you to add a link:https://citation-file-format.github.io[citation]
|
163
170
|
file to your project so you can help the research community cite your work in their studies if your
|
164
|
-
project is used.
|
171
|
+
project is used. This adds the following file when enabled:
|
172
|
+
|
173
|
+
....
|
174
|
+
├── CITATION.cff
|
175
|
+
....
|
165
176
|
|
166
177
|
===== Community
|
167
178
|
|
168
179
|
The `--community` option allows you to link to your open source community, organization, or group
|
169
|
-
chat to help with community engagement of your work.
|
180
|
+
chat to help with community engagement of your work. The link is added to the `README` file when enabled.
|
170
181
|
|
171
182
|
===== Code of Conduct
|
172
183
|
|
173
184
|
The `--conduct` option allows you to link to your link:https://www.contributor-covenant.org[Code of
|
174
185
|
Conduct] to encourage good community participation. Regardless of whether you have a community or
|
175
|
-
not, the code of conduct is good to encourage in general.
|
186
|
+
not, the code of conduct is good to encourage in general. The link is added to the `README` file when enabled.
|
176
187
|
|
177
188
|
===== Console
|
178
189
|
|
179
190
|
The `--console` option allows you to add a `console` script for local development. So instead of
|
180
191
|
typing `irb`, you can type `bin/console` and get an IRB session with all of your project's code
|
181
|
-
loaded.
|
192
|
+
loaded. This adds the following file when enabled:
|
193
|
+
|
194
|
+
....
|
195
|
+
├── bin
|
196
|
+
│ ├── console
|
197
|
+
....
|
182
198
|
|
183
199
|
===== Contributions
|
184
200
|
|
185
201
|
The `--contributions` option allows you to link to contributing documentation so people know to
|
186
|
-
contribute back to your work.
|
202
|
+
contribute back to your work. The link is added to the `README` file when enabled.
|
187
203
|
|
188
204
|
===== Developer Certificate of Origin
|
189
205
|
|
190
|
-
The `--dcoo` option allows to you add link:https://developercertificate.org[Developer Certificate of Origin] documentation so all contributors are aware of how their contributions are applied in terms of ownership, copyright, and licensing.
|
206
|
+
The `--dcoo` option allows to you add link:https://developercertificate.org[Developer Certificate of Origin] documentation so all contributors are aware of how their contributions are applied in terms of ownership, copyright, and licensing. The link is added to the `README` file when enabled.
|
191
207
|
|
192
208
|
ℹ️ This is disabled by default but will be enabled by default in the next major version.
|
193
209
|
|
@@ -199,17 +215,41 @@ much more.
|
|
199
215
|
|
200
216
|
===== Docker
|
201
217
|
|
202
|
-
The `--docker` option allows you add {docker_link} to your project so you can build and deploy
|
218
|
+
The `--docker` option allows you add {docker_link} to your project so you can build and deploy a production image of your software. When enabled, these files will appear in your project:
|
219
|
+
|
220
|
+
....
|
221
|
+
├── bin
|
222
|
+
│ ├── docker
|
223
|
+
│ │ ├── build # Use to build your production image for local use.
|
224
|
+
│ │ ├── console # Use to interact with your production image.
|
225
|
+
│ │ └── entrypoint # Conditionally enables jemalloc support.
|
226
|
+
├── .dockerignore # Defines the files/folders Docker should ignore.
|
227
|
+
├── Dockerfile # Defines how to build your production image.
|
228
|
+
....
|
203
229
|
|
204
230
|
===== Development Containers
|
205
231
|
|
206
|
-
The `--devcontainer` option allows you add {development_containers_link} support to your project so you can develop locally by running your project within a {docker_link} container.
|
232
|
+
The `--devcontainer` option allows you add {development_containers_link} support to your project so you can develop locally by running your project within a {docker_link} container. When enabled, these files will be added to your project:
|
233
|
+
|
234
|
+
....
|
235
|
+
├── .devcontainer
|
236
|
+
│ ├── compose.yaml # Your Docker Compose configuration.
|
237
|
+
│ ├── devcontainer.json # Your Developer Container configuration.
|
238
|
+
│ └── Dockerfile # The steps for building your development environment.
|
239
|
+
....
|
240
|
+
|
241
|
+
ℹ️ The `Dockerfile` uses the {docker_alpine_ruby_link} base image so you have a small but functional image. This base image can be easily be swapped out with a base image you prefer.
|
207
242
|
|
208
243
|
===== Funding
|
209
244
|
|
210
245
|
The `--funding` option allows you add a link:https://github.com[GitHub] funding configuration to
|
211
246
|
your project so you can attract link:https://docs.github.com/en/sponsors[sponsors]. This option
|
212
|
-
doesn't require use of the `--git_hub` option but is encouraged.
|
247
|
+
doesn't require use of the `--git_hub` option but is encouraged. This adds the following file when enabled:
|
248
|
+
|
249
|
+
....
|
250
|
+
├── .github
|
251
|
+
│ ├── FUNDING.yml
|
252
|
+
....
|
213
253
|
|
214
254
|
===== Git
|
215
255
|
|
@@ -218,11 +258,23 @@ The `--git` option allows you add link:https://git-scm.com[Git] repository suppo
|
|
218
258
|
===== GitHub
|
219
259
|
|
220
260
|
The `--git_hub` option allows you add link:https://github.com[GitHub] templates to your project for
|
221
|
-
issues and pull requests.
|
261
|
+
issues and pull requests. This adds the following fhile when enabled:
|
262
|
+
|
263
|
+
....
|
264
|
+
├── .github
|
265
|
+
│ ├── ISSUE_TEMPLATE.md
|
266
|
+
│ └── PULL_REQUEST_TEMPLATE.md
|
267
|
+
....
|
222
268
|
|
223
269
|
===== GitHub CI
|
224
270
|
|
225
|
-
The `--git_hub_ci` option allows you to build your project with link:https://docs.github.com/en/actions[GitHub Actions] configured so you can get your project building as quickly as possible.
|
271
|
+
The `--git_hub_ci` option allows you to build your project with link:https://docs.github.com/en/actions[GitHub Actions] configured so you can get your project building as quickly as possible. This adds the following file when enabled:
|
272
|
+
|
273
|
+
....
|
274
|
+
├── .github
|
275
|
+
│ ├── workflows
|
276
|
+
│ │ └── ci.yml
|
277
|
+
....
|
226
278
|
|
227
279
|
===== Git Lint
|
228
280
|
|
@@ -247,17 +299,23 @@ The `--license` option ensures you build your project with a license.
|
|
247
299
|
|
248
300
|
===== Maximum
|
249
301
|
|
250
|
-
The `--max` option allows you to build your project with
|
251
|
-
to build a new project
|
302
|
+
The `--max` option allows you to build your project with _all options enabled_. This is a quick way
|
303
|
+
to build a new project without having to pick and choose.
|
252
304
|
|
253
305
|
===== Minimum
|
254
306
|
|
255
|
-
The `--min` option allows you to build your project with
|
307
|
+
The `--min` option allows you to build your project with _all options disabled_. This is a quick way to build a new project with the bare minimum of support which is a one step above reaching for a {bundler_inline_link} script.
|
256
308
|
|
257
309
|
===== Rake
|
258
310
|
|
259
311
|
The `--rake` option allows you to add the link:https://github.com/ruby/rake[Rake] gem for quickly
|
260
|
-
crafting build scripts.
|
312
|
+
crafting build scripts. This adds the following files to your project:
|
313
|
+
|
314
|
+
....
|
315
|
+
├── bin
|
316
|
+
│ ├── rake
|
317
|
+
├── Rakefile
|
318
|
+
....
|
261
319
|
|
262
320
|
===== Readme
|
263
321
|
|
@@ -266,7 +324,7 @@ The `--readme` option allows you to add README documentation to your project.
|
|
266
324
|
===== Reek
|
267
325
|
|
268
326
|
The `--reek` option allows you add the link:https://github.com/troessner/reek[Reek] gem to your
|
269
|
-
project for code smell and code quality support.
|
327
|
+
project for code smell and code quality support. This adds the `.reek.yml` configuration to your project.
|
270
328
|
|
271
329
|
===== Refinements
|
272
330
|
|
@@ -277,7 +335,19 @@ Ruby core objects without monkey patching your code.
|
|
277
335
|
===== RSpec
|
278
336
|
|
279
337
|
The `--rspec` option allows you add the link:https://rspec.info[RSpec] gem to your project for
|
280
|
-
defining your project specifications and have a framework for testing your code.
|
338
|
+
defining your project specifications and have a framework for testing your code. This adds the following files to your project:
|
339
|
+
|
340
|
+
....
|
341
|
+
├── bin
|
342
|
+
│ ├── rspec
|
343
|
+
├── spec
|
344
|
+
│ ├── lib
|
345
|
+
│ │ └── <your project name>_spec.rb
|
346
|
+
│ ├── support
|
347
|
+
│ │ └── shared_contexts
|
348
|
+
│ │ └── temp_dir.rb
|
349
|
+
│ └── spec_helper.rb
|
350
|
+
....
|
281
351
|
|
282
352
|
===== Repl Type Completor (RTC)
|
283
353
|
|
@@ -286,13 +356,17 @@ The `--rtc` option allows you add the link:https://github.com/ruby/repl_type_com
|
|
286
356
|
===== Setup
|
287
357
|
|
288
358
|
The `--setup` option allows you to configure you project with automated setup instructions so anyone
|
289
|
-
new to your project can quickly get started by running the `bin/setup` script.
|
359
|
+
new to your project can quickly get started by running the `bin/setup` script. This adds the following file to your project:
|
360
|
+
|
361
|
+
....
|
362
|
+
│ └── setup
|
363
|
+
....
|
290
364
|
|
291
365
|
===== SimpleCov
|
292
366
|
|
293
367
|
The `--simple_cov` option allows you add the
|
294
368
|
link:https://github.com/simplecov-ruby/simplecov[SimpleCov] gem to your project to provide full
|
295
|
-
analysis of
|
369
|
+
analysis of your project's code quality and/or find code that is unused.
|
296
370
|
|
297
371
|
===== Versions
|
298
372
|
|
@@ -313,8 +387,7 @@ This gem can be configured via a global configuration:
|
|
313
387
|
$HOME/.config/rubysmith/configuration.yml
|
314
388
|
....
|
315
389
|
|
316
|
-
It can also be configured via
|
317
|
-
variables. The default configuration is as follows:
|
390
|
+
It can also be configured via {xdg_link}/{runcom_link} environment variables. The default configuration is as follows:
|
318
391
|
|
319
392
|
[source,yaml]
|
320
393
|
----
|
@@ -358,6 +431,7 @@ build:
|
|
358
431
|
versions: true
|
359
432
|
zeitwerk: true
|
360
433
|
citation:
|
434
|
+
affiliation: "%<organization_label>s"
|
361
435
|
message: Please use the following metadata when citing this project in your work.
|
362
436
|
documentation:
|
363
437
|
format: "adoc"
|
@@ -387,11 +461,11 @@ repository:
|
|
387
461
|
uri: https://github.com
|
388
462
|
----
|
389
463
|
|
390
|
-
By customizing your configuration, you can change Rubysmith's default behavior when building projects. This is a great way to define your own specialized settings other than what is
|
464
|
+
By customizing your configuration, you can change Rubysmith's default behavior when building projects. This is a great way to define your own specialized settings other than what is provided by default. This is also a handy way to provide additional information needed for some of the build options.
|
391
465
|
|
392
466
|
You'll also notice some of the values use {string_formats_link} which means you can use any fully qualified key as a string specifier for supported keys like those found in the `author` and `project` sections.
|
393
467
|
|
394
|
-
|
468
|
+
Each section of the configuration is explained below.
|
395
469
|
|
396
470
|
==== Author
|
397
471
|
|
@@ -404,6 +478,7 @@ author:
|
|
404
478
|
email: jsmith@example.com
|
405
479
|
family_name: Smith
|
406
480
|
given_name: Jill
|
481
|
+
author_uri: # Requires being supplied.
|
407
482
|
----
|
408
483
|
|
409
484
|
If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
|
@@ -421,15 +496,23 @@ this project.
|
|
421
496
|
|
422
497
|
This section allows you to configure your link:https://orcid.org[ORCID]
|
423
498
|
link:https://citation-file-format.github.io[citation] information used by the research community.
|
424
|
-
|
499
|
+
[source,yaml]
|
500
|
+
----
|
501
|
+
citation:
|
502
|
+
affiliation: # Defaults to organization label (see above).
|
503
|
+
message: # Defaults to supplied message (see above).
|
504
|
+
orcid: # Defaults to https://orcid.org/ when no ID is supplied.
|
505
|
+
----
|
506
|
+
|
507
|
+
Your author, project, and license information will be used when building this file.
|
425
508
|
|
426
509
|
==== Documentation
|
427
510
|
|
428
511
|
Use this section to define the kind of documentation you want generated for your project. The
|
429
512
|
following options are available:
|
430
513
|
|
431
|
-
* `adoc
|
432
|
-
* `md
|
514
|
+
* `adoc`: Uses link:https://asciidoctor.org[ASCII Doc] format.
|
515
|
+
* `md`: Uses link:https://daringfireball.net/projects/markdown[Markdown] format.
|
433
516
|
|
434
517
|
==== License
|
435
518
|
|
@@ -520,7 +603,13 @@ As for the `version` key, this defines the default version of newly created proj
|
|
520
603
|
|
521
604
|
==== Repository
|
522
605
|
|
523
|
-
Your
|
606
|
+
Your repository handle is the handle you setup when creating your account (i.e. `+https://github.com/<your_handle>+`). This information is used for template, funding, and/or URI construction purposes. These are the defaults but you'll want to customize to reflect the service you are using:
|
607
|
+
|
608
|
+
``` yaml
|
609
|
+
repository:
|
610
|
+
handle: undefined
|
611
|
+
uri: https://github.com
|
612
|
+
```
|
524
613
|
|
525
614
|
== Development
|
526
615
|
|
data/lib/rubysmith/builder.rb
CHANGED
@@ -34,7 +34,7 @@ module Rubysmith
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def delete
|
37
|
-
|
37
|
+
log_info "Deleting: #{relative_build_path}"
|
38
38
|
build_path.delete
|
39
39
|
self
|
40
40
|
end
|
@@ -52,7 +52,7 @@ module Rubysmith
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def make_path
|
55
|
-
|
55
|
+
log_info "Making: #{relative_build_path}"
|
56
56
|
build_path.make_path
|
57
57
|
self
|
58
58
|
end
|
@@ -76,7 +76,7 @@ module Rubysmith
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def render
|
79
|
-
|
79
|
+
log_info "Rendering: #{relative_build_path}"
|
80
80
|
|
81
81
|
pathway.start_path.read.then do |content|
|
82
82
|
build_path.make_ancestors.write renderer.call(content)
|
@@ -92,7 +92,7 @@ module Rubysmith
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def run *command
|
95
|
-
|
95
|
+
log_info "Running: #{command}"
|
96
96
|
execute(*command)
|
97
97
|
self
|
98
98
|
rescue StandardError => error
|
@@ -100,7 +100,7 @@ module Rubysmith
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def touch
|
103
|
-
|
103
|
+
log_info "Touching: #{relative_build_path}"
|
104
104
|
build_path.deep_touch
|
105
105
|
self
|
106
106
|
end
|
@@ -132,6 +132,8 @@ module Rubysmith
|
|
132
132
|
|
133
133
|
def pathway = settings.pathway
|
134
134
|
|
135
|
+
def log_info(message) = logger.info { message }
|
136
|
+
|
135
137
|
def log_debug(message) = logger.debug { message }
|
136
138
|
|
137
139
|
def log_error(message) = logger.error { message }
|
@@ -4,10 +4,10 @@ module Rubysmith
|
|
4
4
|
module Builders
|
5
5
|
# Provides default implementation from which builders can inherit from.
|
6
6
|
class Abstract
|
7
|
-
include Import[:settings]
|
7
|
+
include Import[:settings, :logger]
|
8
8
|
|
9
9
|
def initialize(builder: Builder, **)
|
10
|
-
@builder = builder
|
10
|
+
@builder = -> settings, **keywords { builder.new settings, logger:, **keywords }
|
11
11
|
super(**)
|
12
12
|
end
|
13
13
|
|
@@ -12,44 +12,44 @@ module Rubysmith
|
|
12
12
|
|
13
13
|
# Order is important.
|
14
14
|
BUILDERS = [
|
15
|
-
Builders::Init
|
16
|
-
Builders::Core
|
17
|
-
Builders::Version
|
18
|
-
Builders::Documentation::Readme
|
19
|
-
Builders::Documentation::Citation
|
20
|
-
Builders::Documentation::License
|
21
|
-
Builders::Documentation::Version
|
22
|
-
Builders::Git::Setup
|
23
|
-
Builders::Git::Ignore
|
24
|
-
Builders::Git::Safe
|
25
|
-
Builders::Bundler
|
26
|
-
Builders::Rake::Binstub
|
27
|
-
Builders::Rake::Configuration
|
28
|
-
Builders::Console
|
29
|
-
Builders::CircleCI
|
30
|
-
Builders::Setup
|
31
|
-
Builders::GitHub::Template
|
32
|
-
Builders::GitHub::Funding
|
33
|
-
Builders::GitHub::CI
|
34
|
-
Builders::Guard
|
35
|
-
Builders::Reek
|
36
|
-
Builders::RSpec::Binstub
|
37
|
-
Builders::RSpec::Context
|
38
|
-
Builders::RSpec::Helper
|
39
|
-
Builders::Caliber
|
40
|
-
Builders::DevContainer::Dockerfile
|
41
|
-
Builders::DevContainer::Compose
|
42
|
-
Builders::DevContainer::Configuration
|
43
|
-
Builders::Docker::Build
|
44
|
-
Builders::Docker::Console
|
45
|
-
Builders::Docker::Entrypoint
|
46
|
-
Builders::Docker::File
|
47
|
-
Builders::Docker::Ignore
|
48
|
-
Extensions::Bundler
|
49
|
-
Extensions::Pragmater
|
50
|
-
Extensions::Tocer
|
51
|
-
Extensions::Rubocop
|
52
|
-
Builders::Git::Commit
|
15
|
+
Builders::Init,
|
16
|
+
Builders::Core,
|
17
|
+
Builders::Version,
|
18
|
+
Builders::Documentation::Readme,
|
19
|
+
Builders::Documentation::Citation,
|
20
|
+
Builders::Documentation::License,
|
21
|
+
Builders::Documentation::Version,
|
22
|
+
Builders::Git::Setup,
|
23
|
+
Builders::Git::Ignore,
|
24
|
+
Builders::Git::Safe,
|
25
|
+
Builders::Bundler,
|
26
|
+
Builders::Rake::Binstub,
|
27
|
+
Builders::Rake::Configuration,
|
28
|
+
Builders::Console,
|
29
|
+
Builders::CircleCI,
|
30
|
+
Builders::Setup,
|
31
|
+
Builders::GitHub::Template,
|
32
|
+
Builders::GitHub::Funding,
|
33
|
+
Builders::GitHub::CI,
|
34
|
+
Builders::Guard,
|
35
|
+
Builders::Reek,
|
36
|
+
Builders::RSpec::Binstub,
|
37
|
+
Builders::RSpec::Context,
|
38
|
+
Builders::RSpec::Helper,
|
39
|
+
Builders::Caliber,
|
40
|
+
Builders::DevContainer::Dockerfile,
|
41
|
+
Builders::DevContainer::Compose,
|
42
|
+
Builders::DevContainer::Configuration,
|
43
|
+
Builders::Docker::Build,
|
44
|
+
Builders::Docker::Console,
|
45
|
+
Builders::Docker::Entrypoint,
|
46
|
+
Builders::Docker::File,
|
47
|
+
Builders::Docker::Ignore,
|
48
|
+
Extensions::Bundler,
|
49
|
+
Extensions::Pragmater,
|
50
|
+
Extensions::Tocer,
|
51
|
+
Extensions::Rubocop,
|
52
|
+
Builders::Git::Commit
|
53
53
|
].freeze
|
54
54
|
|
55
55
|
handle "build"
|
@@ -99,7 +99,7 @@ module Rubysmith
|
|
99
99
|
|
100
100
|
def call
|
101
101
|
log_info "Building project skeleton: #{settings.project_name}..."
|
102
|
-
builders.each(
|
102
|
+
builders.each { |builder| builder.new(settings:, logger:).call }
|
103
103
|
log_info "Project skeleton complete!"
|
104
104
|
end
|
105
105
|
|
data/lib/rubysmith/container.rb
CHANGED
@@ -22,6 +22,7 @@ module Rubysmith
|
|
22
22
|
.add_transformer(Configuration::Transformers::TemplateRoot.new)
|
23
23
|
.add_transformer(:root, :target_root)
|
24
24
|
.add_transformer(:format, :author_uri)
|
25
|
+
.add_transformer(:format, :citation_affiliation)
|
25
26
|
.add_transformer(:format, :project_uri_community)
|
26
27
|
.add_transformer(:format, :project_uri_conduct)
|
27
28
|
.add_transformer(:format, :project_uri_contributions)
|
@@ -9,7 +9,7 @@ module Rubysmith
|
|
9
9
|
module Extensions
|
10
10
|
# Ensures gem dependencies are installed.
|
11
11
|
class Bundler
|
12
|
-
include Import[:settings]
|
12
|
+
include Import[:settings, :logger]
|
13
13
|
|
14
14
|
using Refinements::IO
|
15
15
|
using Refinements::Pathname
|
@@ -20,6 +20,17 @@ module Rubysmith
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def call
|
23
|
+
logger.info { "Installing gem dependencies..." }
|
24
|
+
install
|
25
|
+
rescue ::Bundler::HTTPError
|
26
|
+
log_error
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
attr_reader :client
|
32
|
+
|
33
|
+
def install
|
23
34
|
settings.project_root.change_dir do
|
24
35
|
client.start %w[install --quiet]
|
25
36
|
STDOUT.squelch { client.start %w[lock --add-platform x86_64-linux --update] }
|
@@ -28,9 +39,10 @@ module Rubysmith
|
|
28
39
|
true
|
29
40
|
end
|
30
41
|
|
31
|
-
|
32
|
-
|
33
|
-
|
42
|
+
def log_error
|
43
|
+
logger.error { "Unable to install gem dependencies. Is your network stable?" }
|
44
|
+
false
|
45
|
+
end
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
@@ -7,7 +7,7 @@ module Rubysmith
|
|
7
7
|
module Extensions
|
8
8
|
# Ensures project skeleton has pragmas.
|
9
9
|
class Pragmater
|
10
|
-
include Import[:settings]
|
10
|
+
include Import[:settings, :logger]
|
11
11
|
|
12
12
|
using Refinements::Pathname
|
13
13
|
|
@@ -37,6 +37,7 @@ module Rubysmith
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def call
|
40
|
+
logger.info { "Adding frozen string literal pragmas..." }
|
40
41
|
settings.project_root.change_dir { client.call }
|
41
42
|
true
|
42
43
|
end
|
@@ -8,7 +8,7 @@ module Rubysmith
|
|
8
8
|
module Extensions
|
9
9
|
# Ensures project skeleton adheres to style guide.
|
10
10
|
class Rubocop
|
11
|
-
include Import[:settings]
|
11
|
+
include Import[:settings, :logger]
|
12
12
|
|
13
13
|
using Refinements::IO
|
14
14
|
using Refinements::Pathname
|
@@ -19,18 +19,22 @@ module Rubysmith
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def call
|
22
|
-
|
23
|
-
|
24
|
-
project_root.change_dir do
|
25
|
-
STDOUT.squelch { client.run ["--autocorrect-all", project_root.to_s] }
|
26
|
-
end
|
27
|
-
|
22
|
+
logger.info { "Running RuboCop autocorrect..." }
|
23
|
+
autocorrect
|
28
24
|
true
|
29
25
|
end
|
30
26
|
|
31
27
|
private
|
32
28
|
|
33
29
|
attr_reader :client
|
30
|
+
|
31
|
+
def autocorrect
|
32
|
+
project_root = settings.project_root
|
33
|
+
|
34
|
+
project_root.change_dir do
|
35
|
+
STDOUT.squelch { client.run ["--autocorrect-all", project_root.to_s] }
|
36
|
+
end
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
@@ -8,7 +8,7 @@ module Rubysmith
|
|
8
8
|
module Extensions
|
9
9
|
# Ensures project skeleton documentation has table of content.
|
10
10
|
class Tocer
|
11
|
-
include Import[:settings]
|
11
|
+
include Import[:settings, :logger]
|
12
12
|
|
13
13
|
using Refinements::Pathname
|
14
14
|
|
@@ -18,15 +18,18 @@ module Rubysmith
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def call
|
21
|
-
return false unless settings.build_readme
|
21
|
+
return false unless settings.build_readme && settings.markdown?
|
22
22
|
|
23
|
-
|
23
|
+
logger.info { "Adding table of contents..." }
|
24
|
+
upsert
|
24
25
|
true
|
25
26
|
end
|
26
27
|
|
27
28
|
private
|
28
29
|
|
29
30
|
attr_reader :client
|
31
|
+
|
32
|
+
def upsert = settings.project_root.change_dir { client.call }
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
data/rubysmith.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-08-
|
38
|
+
date: 2024-08-22 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
metadata.gz.sig
CHANGED
Binary file
|