rubysmith 7.2.0 → 7.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +218 -47
  4. data/lib/rubysmith/builder.rb +7 -5
  5. data/lib/rubysmith/builders/abstract.rb +2 -2
  6. data/lib/rubysmith/builders/bundler.rb +1 -1
  7. data/lib/rubysmith/builders/dev_container/compose.rb +22 -0
  8. data/lib/rubysmith/builders/dev_container/configuration.rb +22 -0
  9. data/lib/rubysmith/builders/dev_container/dockerfile.rb +22 -0
  10. data/lib/rubysmith/builders/docker/build.rb +24 -0
  11. data/lib/rubysmith/builders/docker/console.rb +24 -0
  12. data/lib/rubysmith/builders/docker/entrypoint.rb +24 -0
  13. data/lib/rubysmith/builders/docker/file.rb +21 -0
  14. data/lib/rubysmith/builders/docker/ignore.rb +21 -0
  15. data/lib/rubysmith/cli/actions/bootsnap.rb +22 -0
  16. data/lib/rubysmith/cli/actions/circle_ci.rb +1 -1
  17. data/lib/rubysmith/cli/actions/dcoo.rb +22 -0
  18. data/lib/rubysmith/cli/actions/dev_container.rb +22 -0
  19. data/lib/rubysmith/cli/actions/docker.rb +22 -0
  20. data/lib/rubysmith/cli/actions/funding.rb +1 -1
  21. data/lib/rubysmith/cli/actions/git_hub.rb +1 -1
  22. data/lib/rubysmith/cli/actions/git_hub_ci.rb +1 -1
  23. data/lib/rubysmith/cli/actions/maximum.rb +1 -1
  24. data/lib/rubysmith/cli/actions/minimum.rb +1 -1
  25. data/lib/rubysmith/cli/commands/build.rb +45 -33
  26. data/lib/rubysmith/configuration/contract.rb +6 -0
  27. data/lib/rubysmith/configuration/defaults.yml +6 -0
  28. data/lib/rubysmith/configuration/model.rb +8 -0
  29. data/lib/rubysmith/container.rb +2 -0
  30. data/lib/rubysmith/extensions/bundler.rb +16 -4
  31. data/lib/rubysmith/extensions/pragmater.rb +16 -2
  32. data/lib/rubysmith/extensions/rubocop.rb +11 -7
  33. data/lib/rubysmith/extensions/tocer.rb +8 -4
  34. data/lib/rubysmith/templates/%project_name%/.devcontainer/Dockerfile.erb +1 -0
  35. data/lib/rubysmith/templates/%project_name%/.devcontainer/compose.yaml.erb +35 -0
  36. data/lib/rubysmith/templates/%project_name%/.devcontainer/devcontainer.json.erb +17 -0
  37. data/lib/rubysmith/templates/%project_name%/.dockerignore.erb +36 -0
  38. data/lib/rubysmith/templates/%project_name%/.github/workflows/ci.yml.erb +5 -0
  39. data/lib/rubysmith/templates/%project_name%/Dockerfile.erb +60 -0
  40. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +3 -0
  41. data/lib/rubysmith/templates/%project_name%/LICENSE-fair.adoc.erb +75 -0
  42. data/lib/rubysmith/templates/%project_name%/LICENSE-fair.md.erb +75 -0
  43. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +4 -0
  44. data/lib/rubysmith/templates/%project_name%/README.md.erb +4 -0
  45. data/lib/rubysmith/templates/%project_name%/bin/docker/build.erb +15 -0
  46. data/lib/rubysmith/templates/%project_name%/bin/docker/console.erb +14 -0
  47. data/lib/rubysmith/templates/%project_name%/bin/docker/entrypoint.erb +8 -0
  48. data/lib/rubysmith.rb +1 -0
  49. data/rubysmith.gemspec +1 -1
  50. data.tar.gz.sig +0 -0
  51. metadata +24 -2
  52. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9fdd8d0d5d95ffa934cc1530482d7be79e42d5ed191657a8bcd2d5a32156603
4
- data.tar.gz: 91540e827a5d4a19ddee56f73070d6ab51a300109d3e293aabf7a01921bae108
3
+ metadata.gz: 852415a9cd9eba19692d24330fb641cf6d19f039dbe1b90709e6c88881b844cf
4
+ data.tar.gz: 2d398b6d843ea06f0f9a6896b26eab8cc18caadcd2f6cc616a10609bbfaef907
5
5
  SHA512:
6
- metadata.gz: ce755310287dcb66dc60075580d96cd98f88a56c83f3f230bddda9ddd53be759871fd52c849ee4a4eea2cbdcc0ee628f827cd82fc82fb8d0abd907f1fee1d5af
7
- data.tar.gz: 2e35bec0244e5d15ae4c50ec6a9504587855709e217011217731034c05f0c4a4a6da54a25c92ddfd8f0989588c41fd4cc111b75e94efb8579bc4c415bd9ee3b7
6
+ metadata.gz: 749891117987d624f28fef062d8b319df088a20c592b3fb17dd7ccc4ed1508a9841b7ca827c7073847bf8871a848c18feea57c364669e1240baf9f192c2c9c51
7
+ data.tar.gz: 5f9049b2774b91a3faab55f12fcd1fc1332425d514d8508f614ee18f8944fcdfc5dc2972ab737815b299d157159409329efe47d3b1ece6c87de7312cf0540cca
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -2,9 +2,14 @@
2
2
  :toclevels: 5
3
3
  :figure-caption!:
4
4
 
5
- :gemsmith_link: link:https://alchemists.io/projects/gemsmith[Gemsmith]
6
5
  :bundler_inline_link: link:https://alchemists.io/articles/ruby_bundler_inline[Bundler Inline]
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]
8
+ :docker_link: link:https://www.docker.com[Docker]
9
+ :gemsmith_link: link:https://alchemists.io/projects/gemsmith[Gemsmith]
10
+ :runcom_link: link:https://alchemists.io/projects/runcom[Runcom]
7
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]
8
13
 
9
14
  = Rubysmith
10
15
 
@@ -26,6 +31,8 @@ toc::[]
26
31
  * Supports link:https://orcid.org[Citations (ORCID)].
27
32
  * Supports console script for local development.
28
33
  * Supports link:https://github.com/ruby/debug[Debug].
34
+ * Supports {development_containers_link}.
35
+ * Supports {docker_link}.
29
36
  * Supports link:https://git-scm.com[Git].
30
37
  * Supports link:https://github.com[GitHub].
31
38
  * Supports link:https://alchemists.io/projects/git-lint[Git Lint].
@@ -46,6 +53,7 @@ toc::[]
46
53
  ** Security
47
54
  ** Code of Conduct
48
55
  ** Contributions
56
+ ** Developer Certificate of Origin
49
57
  ** Communities
50
58
 
51
59
  == Requirements
@@ -98,19 +106,16 @@ options, you can use `--no-*` prefixes. Example:
98
106
  rubysmith build --name demo --no-debug --no-reek
99
107
  ----
100
108
 
101
- With the above example, both Debug and Reek support would have been disabled when building the
102
- `demo` project. Taking this a step further, you can also use the `--min` option to generate a
103
- 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:
104
110
 
105
111
  [source,bash]
106
112
  ----
107
113
  rubysmith build --name demo --min
108
114
  ----
109
115
 
110
- The above is essentially 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
+ 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.
111
117
 
112
- As shown earlier, you can combine options but be aware that order matters. Take the following, for
113
- 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:
114
119
 
115
120
  [source,bash]
116
121
  ----
@@ -118,15 +123,9 @@ rubysmith build --name demo --min --zeitwerk
118
123
  rubysmith build --name demo --max --no-debug
119
124
  ----
120
125
 
121
- With the above examples, the first line will _disable_ all options except Zeitwerk while the second
122
- line will _enable_ all options except Debug. This can be a handy way to build a new project with all
123
- options either disabled or enabled with only a few select options modified. To have specific options
124
- enabled/disabled _every time_ you build a new Ruby project, you can edit your global configuration
125
- 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).
126
127
 
127
- There is a lot of flexibility when building a new project through the various build options. I'll
128
- walk you through each so you can better understand why you'd want to enable or disable any one of
129
- 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.
130
129
 
131
130
  ===== Amazing Print
132
131
 
@@ -135,45 +134,78 @@ link:https://github.com/amazing-print/amazing_print[Amazing Print] gem for debug
135
134
  a handy debugging tool when inspecting your Ruby objects and printing details in a quick to read
136
135
  format.
137
136
 
137
+ ===== Bootsnap
138
+
139
+ The `--bootsnap` option allows you to build your project with the
140
+ link:https://github.com/Shopify/bootsnap[Bootsnap] gem for improved performance. This is best used for pure, non-gem, Ruby projects and/or web applications in general.
141
+
138
142
  ===== Caliber
139
143
 
140
144
  The `--caliber` option allows you to build your project with the
141
145
  link:https://alchemists.io/projects/caliber[Caliber] gem so you have an immediate working -- and
142
146
  high quality -- link:https://docs.rubocop.org/rubocop[RuboCop] configuration. Read the Caliber
143
- 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
+ ....
144
156
 
145
157
  ===== Circle CI
146
158
 
147
159
  The `--circle_ci` option allows you to build your project with link:https://circleci.com[Circle CI]
148
- 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
+ ....
149
166
 
150
167
  ===== Citation
151
168
 
152
169
  The `--citation` option allows you to add a link:https://citation-file-format.github.io[citation]
153
170
  file to your project so you can help the research community cite your work in their studies if your
154
- project is used.
171
+ project is used. This adds the following file when enabled:
172
+
173
+ ....
174
+ ├── CITATION.cff
175
+ ....
155
176
 
156
177
  ===== Community
157
178
 
158
179
  The `--community` option allows you to link to your open source community, organization, or group
159
- 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.
160
181
 
161
182
  ===== Code of Conduct
162
183
 
163
184
  The `--conduct` option allows you to link to your link:https://www.contributor-covenant.org[Code of
164
185
  Conduct] to encourage good community participation. Regardless of whether you have a community or
165
- 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.
166
187
 
167
188
  ===== Console
168
189
 
169
190
  The `--console` option allows you to add a `console` script for local development. So instead of
170
191
  typing `irb`, you can type `bin/console` and get an IRB session with all of your project's code
171
- loaded.
192
+ loaded. This adds the following file when enabled:
193
+
194
+ ....
195
+ ├── bin
196
+ │ ├── console
197
+ ....
172
198
 
173
199
  ===== Contributions
174
200
 
175
201
  The `--contributions` option allows you to link to contributing documentation so people know to
176
- contribute back to your work.
202
+ contribute back to your work. The link is added to the `README` file when enabled.
203
+
204
+ ===== Developer Certificate of Origin
205
+
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.
207
+
208
+ ℹ️ This is disabled by default but will be enabled by default in the next major version.
177
209
 
178
210
  ===== Debug
179
211
 
@@ -181,11 +213,43 @@ The `--debug` option allows you add the link:https://github.com/ruby/debug[Debug
181
213
  project for debugging your code by setting breakpoints, remotely connecting to running code, and
182
214
  much more.
183
215
 
216
+ ===== Docker
217
+
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
+ ....
229
+
230
+ ===== Development Containers
231
+
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.
242
+
184
243
  ===== Funding
185
244
 
186
245
  The `--funding` option allows you add a link:https://github.com[GitHub] funding configuration to
187
246
  your project so you can attract link:https://docs.github.com/en/sponsors[sponsors]. This option
188
- 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
+ ....
189
253
 
190
254
  ===== Git
191
255
 
@@ -194,11 +258,23 @@ The `--git` option allows you add link:https://git-scm.com[Git] repository suppo
194
258
  ===== GitHub
195
259
 
196
260
  The `--git_hub` option allows you add link:https://github.com[GitHub] templates to your project for
197
- 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
+ ....
198
268
 
199
269
  ===== GitHub CI
200
270
 
201
- 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
+ ....
202
278
 
203
279
  ===== Git Lint
204
280
 
@@ -223,17 +299,23 @@ The `--license` option ensures you build your project with a license.
223
299
 
224
300
  ===== Maximum
225
301
 
226
- The `--max` option allows you to build your project with _all_ options _enabled_. This is a quick way
227
- to build a new project with all options enabled without having to pick and choose.
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.
228
304
 
229
305
  ===== Minimum
230
306
 
231
- 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.
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.
232
308
 
233
309
  ===== Rake
234
310
 
235
311
  The `--rake` option allows you to add the link:https://github.com/ruby/rake[Rake] gem for quickly
236
- crafting build scripts.
312
+ crafting build scripts. This adds the following files to your project:
313
+
314
+ ....
315
+ ├── bin
316
+ │ ├── rake
317
+ ├── Rakefile
318
+ ....
237
319
 
238
320
  ===== Readme
239
321
 
@@ -242,7 +324,7 @@ The `--readme` option allows you to add README documentation to your project.
242
324
  ===== Reek
243
325
 
244
326
  The `--reek` option allows you add the link:https://github.com/troessner/reek[Reek] gem to your
245
- 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.
246
328
 
247
329
  ===== Refinements
248
330
 
@@ -253,7 +335,19 @@ Ruby core objects without monkey patching your code.
253
335
  ===== RSpec
254
336
 
255
337
  The `--rspec` option allows you add the link:https://rspec.info[RSpec] gem to your project for
256
- 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
+ ....
257
351
 
258
352
  ===== Repl Type Completor (RTC)
259
353
 
@@ -262,13 +356,17 @@ The `--rtc` option allows you add the link:https://github.com/ruby/repl_type_com
262
356
  ===== Setup
263
357
 
264
358
  The `--setup` option allows you to configure you project with automated setup instructions so anyone
265
- 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
+ ....
266
364
 
267
365
  ===== SimpleCov
268
366
 
269
367
  The `--simple_cov` option allows you add the
270
368
  link:https://github.com/simplecov-ruby/simplecov[SimpleCov] gem to your project to provide full
271
- analysis of what your quality of code is for the project.
369
+ analysis of your project's code quality and/or find code that is unused.
272
370
 
273
371
  ===== Versions
274
372
 
@@ -289,8 +387,7 @@ This gem can be configured via a global configuration:
289
387
  $HOME/.config/rubysmith/configuration.yml
290
388
  ....
291
389
 
292
- It can also be configured via link:https://alchemists.io/projects/xdg[XDG] environment
293
- 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:
294
391
 
295
392
  [source,yaml]
296
393
  ----
@@ -299,6 +396,7 @@ author:
299
396
  uri: "%<organization_uri>s/team/%<author_handle>s"
300
397
  build:
301
398
  amazing_print: true
399
+ bootsnap: false
302
400
  caliber: true
303
401
  circle_ci: false
304
402
  citation: true
@@ -307,7 +405,10 @@ build:
307
405
  conduct: true
308
406
  console: true
309
407
  contributions: true
408
+ dcoo: false
310
409
  debug: true
410
+ devcontainer: false
411
+ docker: false
311
412
  funding: false
312
413
  git: true
313
414
  git_hub: false
@@ -330,6 +431,7 @@ build:
330
431
  versions: true
331
432
  zeitwerk: true
332
433
  citation:
434
+ affiliation: "%<organization_label>s"
333
435
  message: Please use the following metadata when citing this project in your work.
334
436
  documentation:
335
437
  format: "adoc"
@@ -344,6 +446,7 @@ project:
344
446
  community: "%<organization_uri>s/community"
345
447
  conduct: "%<organization_uri>s/policies/code_of_conduct"
346
448
  contributions: "%<organization_uri>s/policies/contributions"
449
+ dcoo: "%<organization_uri>s/policies/developer_certificate_of_origin"
347
450
  download: "https://rubygems.org/gems/%<project_name>s"
348
451
  funding: "%<repository_uri>s/sponsors/%<repository_handle>s"
349
452
  home: "%<organization_uri>s/projects/%<project_name>s"
@@ -358,11 +461,11 @@ repository:
358
461
  uri: https://github.com
359
462
  ----
360
463
 
361
- 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 provide for you by default. This is also a handy way to provide additional information needed for some of the build options.
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.
362
465
 
363
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.
364
467
 
365
- The next sections will walk you through each configuration so you can learn more.
468
+ Each section of the configuration is explained below.
366
469
 
367
470
  ==== Author
368
471
 
@@ -375,6 +478,7 @@ author:
375
478
  email: jsmith@example.com
376
479
  family_name: Smith
377
480
  given_name: Jill
481
+ author_uri: # Requires being supplied.
378
482
  ----
379
483
 
380
484
  If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
@@ -392,29 +496,88 @@ this project.
392
496
 
393
497
  This section allows you to configure your link:https://orcid.org[ORCID]
394
498
  link:https://citation-file-format.github.io[citation] information used by the research community.
395
- You should definitely fill this in. Your author information, detailed above, will also be used when building this file.
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.
396
508
 
397
509
  ==== Documentation
398
510
 
399
511
  Use this section to define the kind of documentation you want generated for your project. The
400
512
  following options are available:
401
513
 
402
- * `adoc` - Uses link:https://asciidoctor.org[ASCII Doc] format.
403
- * `md` - Uses link:https://asciidoctor.org[Markdown] format.
514
+ * `adoc`: Uses link:https://asciidoctor.org[ASCII Doc] format.
515
+ * `md`: Uses link:https://daringfireball.net/projects/markdown[Markdown] format.
404
516
 
405
517
  ==== License
406
518
 
407
- Use this section to define the license you want to use for your project. The following are available:
519
+ Use this section to define the license you want to use for your project. When picking a license, you can supply the appropriate `label` and `version` in addition to the `name`. The `name` is the only value you _can't_ customize. The following details all supported licenses.
520
+
521
+ ===== Apache
408
522
 
409
- * `apache`: Uses the link:https://www.apache.org/licenses/LICENSE-2.0[Apache] license.
410
- * `hippocratic`: Uses the link:https://firstdonoharm.dev[Hippocratic] license.
411
- * `mit`: Uses the link:https://mit-license.org[MIT] license.
523
+ To use the link:https://www.apache.org/licenses/LICENSE-2.0[Apache] license, apply this configuration:
412
524
 
413
- When picking a license, you can also supply the appropriate label and version in addition to the name.
525
+ [source,yaml]
526
+ ----
527
+ license:
528
+ label: "Apache"
529
+ name: "apache"
530
+ version: "2.0"
531
+ ----
532
+
533
+ ===== Fair Source
534
+
535
+ To use the link:https://fsl.software[Fair Source] license, apply this configuration:
536
+
537
+ [source,yaml]
538
+ ----
539
+ license:
540
+ label: "Fair Source"
541
+ name: "fair"
542
+ version: "FSL-1.1-Apache-2.0"
543
+ ----
544
+
545
+ ===== Hippocratic
546
+
547
+ To use the link:https://firstdonoharm.dev[Hippocratic] license, apply this configuration:
548
+
549
+ [source,yaml]
550
+ ----
551
+ license:
552
+ label: "Hippocratic"
553
+ name: "hippocratic"
554
+ version: "2.1"
555
+ ----
556
+
557
+ ℹ️ This is the default license unless you customize.
558
+
559
+ ===== MIT
560
+
561
+ To use the link:https://mit-license.org[MIT] license, apply this configuration:
562
+
563
+ [source,yaml]
564
+ ----
565
+ license:
566
+ label: "MIT"
567
+ name: "mit"
568
+ version: ""
569
+ ----
414
570
 
415
571
  ==== Organization
416
572
 
417
- Use this section to define URI information that points to your organization. This is useful for information that isn't project specific but related to all projects within your organization. You'll want to customize this URI especially for documentation purposes.
573
+ Use this section to define organization specific information. This is useful for information that isn't project specific but related to all projects within your organization. You'll want -- highly recommended -- to supply configuration details. For example, here's what a fictional organization might look like:
574
+
575
+ [source,yaml]
576
+ ----
577
+ organization:
578
+ label: ACME
579
+ uri: https://acme.io
580
+ ----
418
581
 
419
582
  ==== Project
420
583
 
@@ -440,7 +603,13 @@ As for the `version` key, this defines the default version of newly created proj
440
603
 
441
604
  ==== Repository
442
605
 
443
- Your repisotry 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.
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
+ ```
444
613
 
445
614
  == Development
446
615
 
@@ -477,6 +646,8 @@ bin/rake
477
646
 
478
647
  == link:https://alchemists.io/policies/contributions[Contributions]
479
648
 
649
+ == link:https://alchemists.io/policies/developer_certificate_of_origin[Developer Certificate of Origin]
650
+
480
651
  == link:https://alchemists.io/projects/rubysmith/versions[Versions]
481
652
 
482
653
  == link:https://alchemists.io/community[Community]
@@ -34,7 +34,7 @@ module Rubysmith
34
34
  end
35
35
 
36
36
  def delete
37
- log_debug "Deleting: #{relative_build_path}"
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
- log_debug "Creating path: #{relative_build_path}"
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
- log_debug "Rendering: #{relative_build_path}"
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
- log_debug "Running: #{command}"
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
- log_debug "Touching: #{relative_build_path}"
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
 
@@ -13,7 +13,7 @@ module Rubysmith
13
13
  .render
14
14
  .replace(/\n\s+group/, "\n\ngroup")
15
15
  .replace(/\n\s+gem/, "\n gem")
16
- .replace(/ (?=.+(refinements|zeitwerk))/, "")
16
+ .replace(/ (?=.+(bootsnap|refinements|zeitwerk))/, "")
17
17
  .replace(/(\n+|\s+)end/, "\nend")
18
18
  .replace(/\n\ngroup :(quality|development|test|tools) do\nend/, "")
19
19
  .replace(/org"\n+/, "org\"\n\n")
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/struct"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module DevContainer
8
+ # Builds Docker Compose configuration for container.
9
+ class Compose < Abstract
10
+ using Refinements::Struct
11
+
12
+ def call
13
+ return false unless settings.build_devcontainer
14
+
15
+ path = "%project_name%/.devcontainer/compose.yaml.erb"
16
+ builder.call(settings.merge(template_path: path)).render
17
+ true
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/struct"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module DevContainer
8
+ # Builds container configuration.
9
+ class Configuration < Abstract
10
+ using Refinements::Struct
11
+
12
+ def call
13
+ return false unless settings.build_devcontainer
14
+
15
+ path = "%project_name%/.devcontainer/devcontainer.json.erb"
16
+ builder.call(settings.merge(template_path: path)).render
17
+ true
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/struct"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module DevContainer
8
+ # Builds Dockerfile for container.
9
+ class Dockerfile < Abstract
10
+ using Refinements::Struct
11
+
12
+ def call
13
+ return false unless settings.build_devcontainer
14
+
15
+ builder.call(settings.merge(template_path: "%project_name%/.devcontainer/Dockerfile.erb"))
16
+ .render
17
+ true
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/struct"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Docker
8
+ # Builds Docker build script.
9
+ class Build < Abstract
10
+ using Refinements::Struct
11
+
12
+ def call
13
+ return false unless settings.build_docker
14
+
15
+ builder.call(settings.merge(template_path: "%project_name%/bin/docker/build.erb"))
16
+ .render
17
+ .permit 0o755
18
+
19
+ true
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end