rubysmith 7.3.0 → 7.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1529b428758e620a07651f58648e9347d6285ae658c5ba7f4e60ec445958b279
4
- data.tar.gz: 7efa1cd58738e11138bc31209ee0b6a2b0ab30a710f54016b8ad3c17b8f6a993
3
+ metadata.gz: de2fff14077ff2e68ddbe7764b4cddffdf1faa73e790be34fd6ff16e05a6b10a
4
+ data.tar.gz: cfa1edcb04628ae3339cbd9facb120c3f4a4321b366c83295abca316d1dbbae7
5
5
  SHA512:
6
- metadata.gz: bb59f4e7490b4e8298a9c14d31923f8e46d1f1ed28cc2ae0f6778d8269d4ee08eab8c304aef3c276439eb447ae5fb43d9b63cf6f9239d64a6e17bfaf70f81a7c
7
- data.tar.gz: 51d8e56f5b799df3b03a9a20c8331004d5f44f0bbdf4371c8299f8a8f75a17719c74c11d2d9d4bc9159cd535f0c3bf26c86e6c1d93ece452a18d149490f490c6
6
+ metadata.gz: 7f7943984c3c3561d26132987f4870741c2cd2f34e027cfb145e08234ecc1571996d09b49237aa19d7ac66443bde511b1a39af7a36847db15ca18b72a02868a3
7
+ data.tar.gz: af4ccfb4d14653548f944fa5d026cb0f8e041698697ce70e44c2f162429487c33f1451ebf426e1e6b3a9ffef108fca0b99fb841e50dd87b6080e6664dcfd889e
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
 
@@ -43,15 +46,7 @@ toc::[]
43
46
  * Supports link:https://github.com/simplecov-ruby/simplecov[SimpleCov].
44
47
  * Supports link:https://github.com/fxn/zeitwerk[Zeitwerk].
45
48
  * Supports common settings and a structured layout for building projects.
46
- * Provides common documentation:
47
- ** README
48
- ** LICENSE
49
- ** VERSIONS
50
- ** Security
51
- ** Code of Conduct
52
- ** Contributions
53
- ** Developer Certificate of Origin
54
- ** Communities
49
+ * Provides common documentation.
55
50
 
56
51
  == Requirements
57
52
 
@@ -103,19 +98,16 @@ options, you can use `--no-*` prefixes. Example:
103
98
  rubysmith build --name demo --no-debug --no-reek
104
99
  ----
105
100
 
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:
101
+ 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
102
 
110
103
  [source,bash]
111
104
  ----
112
105
  rubysmith build --name demo --min
113
106
  ----
114
107
 
115
- 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.
108
+ 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
109
 
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:
110
+ 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
111
 
120
112
  [source,bash]
121
113
  ----
@@ -123,15 +115,9 @@ rubysmith build --name demo --min --zeitwerk
123
115
  rubysmith build --name demo --max --no-debug
124
116
  ----
125
117
 
126
- With the above examples, the first line will _disable_ all options except Zeitwerk while the second
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).
118
+ 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
119
 
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.
120
+ 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
121
 
136
122
  ===== Amazing Print
137
123
 
@@ -150,44 +136,66 @@ link:https://github.com/Shopify/bootsnap[Bootsnap] gem for improved performance.
150
136
  The `--caliber` option allows you to build your project with the
151
137
  link:https://alchemists.io/projects/caliber[Caliber] gem so you have an immediate working -- and
152
138
  high quality -- link:https://docs.rubocop.org/rubocop[RuboCop] configuration. Read the Caliber
153
- documentation for further customization.
139
+ documentation for further customization. This adds the following files when enabled:
140
+
141
+ ....
142
+ ├── bin
143
+ │ ├── rubocop
144
+ ├── .config
145
+ │ └── rubocop
146
+ │ └── config.yml
147
+ ....
154
148
 
155
149
  ===== Circle CI
156
150
 
157
151
  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.
152
+ configured so you can get your project building as quickly as possible. This adds the following file when enabled:
153
+
154
+ ....
155
+ ├── .circleci
156
+ │ └── config.yml
157
+ ....
159
158
 
160
159
  ===== Citation
161
160
 
162
161
  The `--citation` option allows you to add a link:https://citation-file-format.github.io[citation]
163
162
  file to your project so you can help the research community cite your work in their studies if your
164
- project is used.
163
+ project is used. This adds the following file when enabled:
164
+
165
+ ....
166
+ ├── CITATION.cff
167
+ ....
165
168
 
166
169
  ===== Community
167
170
 
168
171
  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.
172
+ chat to help with community engagement of your work. The link is added to the `README` file when enabled.
170
173
 
171
174
  ===== Code of Conduct
172
175
 
173
176
  The `--conduct` option allows you to link to your link:https://www.contributor-covenant.org[Code of
174
177
  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.
178
+ not, the code of conduct is good to encourage in general. The link is added to the `README` file when enabled.
176
179
 
177
180
  ===== Console
178
181
 
179
182
  The `--console` option allows you to add a `console` script for local development. So instead of
180
183
  typing `irb`, you can type `bin/console` and get an IRB session with all of your project's code
181
- loaded.
184
+ loaded. This adds the following file when enabled:
185
+
186
+ ....
187
+ ├── bin
188
+ │ ├── console
189
+ ....
182
190
 
183
191
  ===== Contributions
184
192
 
185
193
  The `--contributions` option allows you to link to contributing documentation so people know to
186
- contribute back to your work.
194
+ contribute back to your work. The link is added to the `README` file when enabled.
187
195
 
188
196
  ===== Developer Certificate of Origin
189
197
 
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.
198
+ 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
199
 
192
200
  ℹ️ This is disabled by default but will be enabled by default in the next major version.
193
201
 
@@ -199,17 +207,41 @@ much more.
199
207
 
200
208
  ===== Docker
201
209
 
202
- The `--docker` option allows you add {docker_link} to your project so you can build and deploy to production.
210
+ 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:
211
+
212
+ ....
213
+ ├── bin
214
+ │ ├── docker
215
+ │ │ ├── build # Use to build your production image for local use.
216
+ │ │ ├── console # Use to interact with your production image.
217
+ │ │ └── entrypoint # Conditionally enables jemalloc support.
218
+ ├── .dockerignore # Defines the files/folders Docker should ignore.
219
+ ├── Dockerfile # Defines how to build your production image.
220
+ ....
203
221
 
204
222
  ===== Development Containers
205
223
 
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.
224
+ 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:
225
+
226
+ ....
227
+ ├── .devcontainer
228
+ │ ├── compose.yaml # Your Docker Compose configuration.
229
+ │ ├── devcontainer.json # Your Developer Container configuration.
230
+ │ └── Dockerfile # The steps for building your development environment.
231
+ ....
232
+
233
+ ℹ️ 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
234
 
208
235
  ===== Funding
209
236
 
210
237
  The `--funding` option allows you add a link:https://github.com[GitHub] funding configuration to
211
238
  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.
239
+ doesn't require use of the `--git_hub` option but is encouraged. This adds the following file when enabled:
240
+
241
+ ....
242
+ ├── .github
243
+ │ ├── FUNDING.yml
244
+ ....
213
245
 
214
246
  ===== Git
215
247
 
@@ -218,11 +250,23 @@ The `--git` option allows you add link:https://git-scm.com[Git] repository suppo
218
250
  ===== GitHub
219
251
 
220
252
  The `--git_hub` option allows you add link:https://github.com[GitHub] templates to your project for
221
- issues and pull requests.
253
+ issues and pull requests. This adds the following fhile when enabled:
254
+
255
+ ....
256
+ ├── .github
257
+ │ ├── ISSUE_TEMPLATE.md
258
+ │ └── PULL_REQUEST_TEMPLATE.md
259
+ ....
222
260
 
223
261
  ===== GitHub CI
224
262
 
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.
263
+ 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:
264
+
265
+ ....
266
+ ├── .github
267
+ │ ├── workflows
268
+ │ │ └── ci.yml
269
+ ....
226
270
 
227
271
  ===== Git Lint
228
272
 
@@ -247,17 +291,23 @@ The `--license` option ensures you build your project with a license.
247
291
 
248
292
  ===== Maximum
249
293
 
250
- The `--max` option allows you to build your project with _all_ options _enabled_. This is a quick way
251
- to build a new project with all options enabled without having to pick and choose.
294
+ The `--max` option allows you to build your project with _all options enabled_. This is a quick way
295
+ to build a new project without having to pick and choose.
252
296
 
253
297
  ===== Minimum
254
298
 
255
- 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.
299
+ 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
300
 
257
301
  ===== Rake
258
302
 
259
303
  The `--rake` option allows you to add the link:https://github.com/ruby/rake[Rake] gem for quickly
260
- crafting build scripts.
304
+ crafting build scripts. This adds the following files to your project:
305
+
306
+ ....
307
+ ├── bin
308
+ │ ├── rake
309
+ ├── Rakefile
310
+ ....
261
311
 
262
312
  ===== Readme
263
313
 
@@ -266,7 +316,7 @@ The `--readme` option allows you to add README documentation to your project.
266
316
  ===== Reek
267
317
 
268
318
  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.
319
+ project for code smell and code quality support. This adds the `.reek.yml` configuration to your project.
270
320
 
271
321
  ===== Refinements
272
322
 
@@ -277,7 +327,19 @@ Ruby core objects without monkey patching your code.
277
327
  ===== RSpec
278
328
 
279
329
  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.
330
+ defining your project specifications and have a framework for testing your code. This adds the following files to your project:
331
+
332
+ ....
333
+ ├── bin
334
+ │ ├── rspec
335
+ ├── spec
336
+ │ ├── lib
337
+ │ │ └── <your project name>_spec.rb
338
+ │ ├── support
339
+ │ │ └── shared_contexts
340
+ │ │ └── temp_dir.rb
341
+ │ └── spec_helper.rb
342
+ ....
281
343
 
282
344
  ===== Repl Type Completor (RTC)
283
345
 
@@ -286,13 +348,17 @@ The `--rtc` option allows you add the link:https://github.com/ruby/repl_type_com
286
348
  ===== Setup
287
349
 
288
350
  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.
351
+ new to your project can quickly get started by running the `bin/setup` script. This adds the following file to your project:
352
+
353
+ ....
354
+ │ └── setup
355
+ ....
290
356
 
291
357
  ===== SimpleCov
292
358
 
293
359
  The `--simple_cov` option allows you add the
294
360
  link:https://github.com/simplecov-ruby/simplecov[SimpleCov] gem to your project to provide full
295
- analysis of what your quality of code is for the project.
361
+ analysis of your project's code quality and/or find code that is unused.
296
362
 
297
363
  ===== Versions
298
364
 
@@ -313,8 +379,7 @@ This gem can be configured via a global configuration:
313
379
  $HOME/.config/rubysmith/configuration.yml
314
380
  ....
315
381
 
316
- It can also be configured via link:https://alchemists.io/projects/xdg[XDG] environment
317
- variables. The default configuration is as follows:
382
+ It can also be configured via {xdg_link}/{runcom_link} environment variables. The default configuration is as follows:
318
383
 
319
384
  [source,yaml]
320
385
  ----
@@ -358,6 +423,7 @@ build:
358
423
  versions: true
359
424
  zeitwerk: true
360
425
  citation:
426
+ affiliation: "%<organization_label>s"
361
427
  message: Please use the following metadata when citing this project in your work.
362
428
  documentation:
363
429
  format: "adoc"
@@ -387,11 +453,11 @@ repository:
387
453
  uri: https://github.com
388
454
  ----
389
455
 
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 provide for you by default. This is also a handy way to provide additional information needed for some of the build options.
456
+ 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
457
 
392
458
  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
459
 
394
- The next sections will walk you through each configuration so you can learn more.
460
+ Each section of the configuration is explained below.
395
461
 
396
462
  ==== Author
397
463
 
@@ -404,6 +470,7 @@ author:
404
470
  email: jsmith@example.com
405
471
  family_name: Smith
406
472
  given_name: Jill
473
+ author_uri: # Requires being supplied.
407
474
  ----
408
475
 
409
476
  If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
@@ -421,15 +488,23 @@ this project.
421
488
 
422
489
  This section allows you to configure your link:https://orcid.org[ORCID]
423
490
  link:https://citation-file-format.github.io[citation] information used by the research community.
424
- You should definitely fill this in. Your author information, detailed above, will also be used when building this file.
491
+ [source,yaml]
492
+ ----
493
+ citation:
494
+ affiliation: # Defaults to organization label (see above).
495
+ message: # Defaults to supplied message (see above).
496
+ orcid: # Defaults to https://orcid.org/ when no ID is supplied.
497
+ ----
498
+
499
+ Your author, project, and license information will be used when building this file.
425
500
 
426
501
  ==== Documentation
427
502
 
428
503
  Use this section to define the kind of documentation you want generated for your project. The
429
504
  following options are available:
430
505
 
431
- * `adoc` - Uses link:https://asciidoctor.org[ASCII Doc] format.
432
- * `md` - Uses link:https://asciidoctor.org[Markdown] format.
506
+ * `adoc`: Uses link:https://asciidoctor.org[ASCII Doc] format.
507
+ * `md`: Uses link:https://daringfireball.net/projects/markdown[Markdown] format.
433
508
 
434
509
  ==== License
435
510
 
@@ -520,7 +595,13 @@ As for the `version` key, this defines the default version of newly created proj
520
595
 
521
596
  ==== Repository
522
597
 
523
- 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.
598
+ 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:
599
+
600
+ ``` yaml
601
+ repository:
602
+ handle: undefined
603
+ uri: https://github.com
604
+ ```
524
605
 
525
606
  == Development
526
607
 
@@ -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
 
@@ -10,7 +10,7 @@ module Rubysmith
10
10
  using Refinements::Struct
11
11
 
12
12
  def call
13
- return false unless settings.build_git
13
+ return false unless settings.build_docker
14
14
 
15
15
  builder.call(settings.merge(template_path: "%project_name%/.dockerignore.erb")).render
16
16
  true
@@ -12,44 +12,44 @@ module Rubysmith
12
12
 
13
13
  # Order is important.
14
14
  BUILDERS = [
15
- Builders::Init.new,
16
- Builders::Core.new,
17
- Builders::Version.new,
18
- Builders::Documentation::Readme.new,
19
- Builders::Documentation::Citation.new,
20
- Builders::Documentation::License.new,
21
- Builders::Documentation::Version.new,
22
- Builders::Git::Setup.new,
23
- Builders::Git::Ignore.new,
24
- Builders::Git::Safe.new,
25
- Builders::Bundler.new,
26
- Builders::Rake::Binstub.new,
27
- Builders::Rake::Configuration.new,
28
- Builders::Console.new,
29
- Builders::CircleCI.new,
30
- Builders::Setup.new,
31
- Builders::GitHub::Template.new,
32
- Builders::GitHub::Funding.new,
33
- Builders::GitHub::CI.new,
34
- Builders::Guard.new,
35
- Builders::Reek.new,
36
- Builders::RSpec::Binstub.new,
37
- Builders::RSpec::Context.new,
38
- Builders::RSpec::Helper.new,
39
- Builders::Caliber.new,
40
- Builders::DevContainer::Dockerfile.new,
41
- Builders::DevContainer::Compose.new,
42
- Builders::DevContainer::Configuration.new,
43
- Builders::Docker::Build.new,
44
- Builders::Docker::Console.new,
45
- Builders::Docker::Entrypoint.new,
46
- Builders::Docker::File.new,
47
- Builders::Docker::Ignore.new,
48
- Extensions::Bundler.new,
49
- Extensions::Pragmater.new,
50
- Extensions::Tocer.new,
51
- Extensions::Rubocop.new,
52
- Builders::Git::Commit.new
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(&:call)
102
+ builders.each { |builder| builder.new(settings:, logger:).call }
103
103
  log_info "Project skeleton complete!"
104
104
  end
105
105
 
@@ -38,6 +38,7 @@ build:
38
38
  versions: true
39
39
  zeitwerk: true
40
40
  citation:
41
+ affiliation: "%<organization_label>s"
41
42
  message: Please use the following metadata when citing this project in your work.
42
43
  documentation:
43
44
  format: "adoc"
@@ -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
- private
32
-
33
- attr_reader :client
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
- project_root = settings.project_root
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
- settings.project_root.change_dir { client.call }
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
@@ -6,7 +6,7 @@ source "https://rubygems.org"
6
6
  gem "bootsnap", "~> 1.18"
7
7
  <% end %>
8
8
  <% if settings.build_refinements %>
9
- gem "refinements", "~> 12.7"
9
+ gem "refinements", "~> 12.8"
10
10
  <% end %>
11
11
  <% if settings.build_zeitwerk %>
12
12
  gem "zeitwerk", "~> 2.6"
data/rubysmith.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "rubysmith"
5
- spec.version = "7.3.0"
5
+ spec.version = "7.5.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/rubysmith"
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.metadata = {
13
13
  "bug_tracker_uri" => "https://github.com/bkuhlmann/rubysmith/issues",
14
14
  "changelog_uri" => "https://alchemists.io/projects/rubysmith/versions",
15
- "documentation_uri" => "https://alchemists.io/projects/rubysmith",
15
+ "homepage_uri" => "https://alchemists.io/projects/rubysmith",
16
16
  "funding_uri" => "https://github.com/sponsors/bkuhlmann",
17
17
  "label" => "Rubysmith",
18
18
  "rubygems_mfa_required" => "true",
@@ -22,17 +22,17 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = "~> 3.3"
26
- spec.add_dependency "cogger", "~> 0.21"
25
+ spec.required_ruby_version = ">= 3.3", "<= 3.4"
26
+ spec.add_dependency "cogger", "~> 0.26"
27
27
  spec.add_dependency "containable", "~> 0.2"
28
28
  spec.add_dependency "dry-monads", "~> 1.6"
29
29
  spec.add_dependency "dry-schema", "~> 1.13"
30
30
  spec.add_dependency "etcher", "~> 2.1"
31
- spec.add_dependency "gitt", "~> 3.6"
31
+ spec.add_dependency "gitt", "~> 3.8"
32
32
  spec.add_dependency "infusible", "~> 3.8"
33
33
  spec.add_dependency "pragmater", "~> 15.2"
34
- spec.add_dependency "refinements", "~> 12.7"
35
- spec.add_dependency "rubocop", "~> 1.65"
34
+ spec.add_dependency "refinements", "~> 12.8"
35
+ spec.add_dependency "rubocop", "~> 1.66"
36
36
  spec.add_dependency "runcom", "~> 11.5"
37
37
  spec.add_dependency "sod", "~> 0.14"
38
38
  spec.add_dependency "spek", "~> 3.0"
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.3.0
4
+ version: 7.5.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-21 00:00:00.000000000 Z
38
+ date: 2024-09-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.21'
46
+ version: '0.26'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.21'
53
+ version: '0.26'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: containable
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +113,14 @@ dependencies:
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '3.6'
116
+ version: '3.8'
117
117
  type: :runtime
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '3.6'
123
+ version: '3.8'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: infusible
126
126
  requirement: !ruby/object:Gem::Requirement
@@ -155,28 +155,28 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '12.7'
158
+ version: '12.8'
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '12.7'
165
+ version: '12.8'
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: rubocop
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '1.65'
172
+ version: '1.66'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '1.65'
179
+ version: '1.66'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: runcom
182
182
  requirement: !ruby/object:Gem::Requirement
@@ -415,7 +415,7 @@ licenses:
415
415
  metadata:
416
416
  bug_tracker_uri: https://github.com/bkuhlmann/rubysmith/issues
417
417
  changelog_uri: https://alchemists.io/projects/rubysmith/versions
418
- documentation_uri: https://alchemists.io/projects/rubysmith
418
+ homepage_uri: https://alchemists.io/projects/rubysmith
419
419
  funding_uri: https://github.com/sponsors/bkuhlmann
420
420
  label: Rubysmith
421
421
  rubygems_mfa_required: 'true'
@@ -426,16 +426,19 @@ require_paths:
426
426
  - lib
427
427
  required_ruby_version: !ruby/object:Gem::Requirement
428
428
  requirements:
429
- - - "~>"
429
+ - - ">="
430
430
  - !ruby/object:Gem::Version
431
431
  version: '3.3'
432
+ - - "<="
433
+ - !ruby/object:Gem::Version
434
+ version: '3.4'
432
435
  required_rubygems_version: !ruby/object:Gem::Requirement
433
436
  requirements:
434
437
  - - ">="
435
438
  - !ruby/object:Gem::Version
436
439
  version: '0'
437
440
  requirements: []
438
- rubygems_version: 3.5.17
441
+ rubygems_version: 3.5.18
439
442
  signing_key:
440
443
  specification_version: 4
441
444
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file