rubysmith 0.16.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/LICENSE.adoc +207 -155
  4. data/README.adoc +360 -104
  5. data/exe/rubysmith +0 -1
  6. data/lib/rubysmith/builder.rb +1 -2
  7. data/lib/rubysmith/builders/bundler.rb +7 -11
  8. data/lib/rubysmith/builders/circle_ci.rb +8 -2
  9. data/lib/rubysmith/builders/console.rb +8 -2
  10. data/lib/rubysmith/builders/core.rb +14 -4
  11. data/lib/rubysmith/builders/documentation/{change.rb → citation.rb} +8 -8
  12. data/lib/rubysmith/builders/documentation/license.rb +9 -4
  13. data/lib/rubysmith/builders/documentation/readme.rb +12 -18
  14. data/lib/rubysmith/builders/documentation/{contribution.rb → version.rb} +10 -5
  15. data/lib/rubysmith/builders/git/commit.rb +5 -3
  16. data/lib/rubysmith/builders/{rubocop/setup.rb → git/ignore.rb} +11 -7
  17. data/lib/rubysmith/builders/git/setup.rb +2 -1
  18. data/lib/rubysmith/builders/git_hub.rb +8 -3
  19. data/lib/rubysmith/builders/guard.rb +9 -3
  20. data/lib/rubysmith/builders/rake.rb +9 -3
  21. data/lib/rubysmith/builders/reek.rb +7 -2
  22. data/lib/rubysmith/builders/rspec/context.rb +8 -2
  23. data/lib/rubysmith/builders/rspec/helper.rb +8 -2
  24. data/lib/rubysmith/builders/rubocop.rb +34 -0
  25. data/lib/rubysmith/builders/setup.rb +8 -2
  26. data/lib/rubysmith/builders/version.rb +28 -0
  27. data/lib/rubysmith/cli/actions/build.rb +12 -12
  28. data/lib/rubysmith/cli/actions/config.rb +4 -2
  29. data/lib/rubysmith/cli/actions/publish.rb +21 -0
  30. data/lib/rubysmith/cli/parser.rb +31 -0
  31. data/lib/rubysmith/cli/parsers/build.rb +98 -45
  32. data/lib/rubysmith/cli/parsers/core.rb +18 -9
  33. data/lib/rubysmith/cli/shell.rb +23 -14
  34. data/lib/rubysmith/configuration/content.rb +174 -0
  35. data/lib/rubysmith/configuration/defaults.yml +91 -0
  36. data/lib/rubysmith/configuration/enhancers/current_time.rb +24 -0
  37. data/lib/rubysmith/configuration/enhancers/git_email.rb +31 -0
  38. data/lib/rubysmith/configuration/enhancers/git_hub_user.rb +31 -0
  39. data/lib/rubysmith/configuration/enhancers/git_user.rb +33 -0
  40. data/lib/rubysmith/configuration/loader.rb +48 -0
  41. data/lib/rubysmith/container.rb +4 -1
  42. data/lib/rubysmith/extensions/bundler.rb +30 -0
  43. data/lib/rubysmith/extensions/milestoner.rb +37 -0
  44. data/lib/rubysmith/extensions/pragmater.rb +36 -0
  45. data/lib/rubysmith/extensions/rubocop.rb +29 -0
  46. data/lib/rubysmith/extensions/tocer.rb +39 -0
  47. data/lib/rubysmith/renderers/erb.rb +9 -1
  48. data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +1 -4
  49. data/lib/rubysmith/templates/%project_name%/.gitignore.erb +11 -0
  50. data/lib/rubysmith/templates/%project_name%/.rubocop.yml.erb +2 -0
  51. data/lib/rubysmith/templates/%project_name%/CITATION.cff.erb +16 -0
  52. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +19 -10
  53. data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.adoc.erb +214 -0
  54. data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.md.erb +214 -0
  55. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +20 -21
  56. data/lib/rubysmith/templates/%project_name%/README.md.erb +20 -21
  57. data/lib/rubysmith/templates/%project_name%/Rakefile.erb +9 -0
  58. data/lib/rubysmith/templates/%project_name%/VERSIONS.adoc.erb +5 -0
  59. data/lib/rubysmith/templates/%project_name%/VERSIONS.md.erb +5 -0
  60. data/lib/rubysmith/templates/%project_name%/bin/rubocop.erb +0 -1
  61. data/lib/rubysmith/templates/%project_name%/lib/%project_path%.rb.erb +4 -4
  62. data/rubysmith.gemspec +42 -0
  63. data.tar.gz.sig +0 -0
  64. metadata +59 -39
  65. metadata.gz.sig +0 -0
  66. data/lib/rubysmith/builders/documentation/conduct.rb +0 -32
  67. data/lib/rubysmith/builders/pragma.rb +0 -32
  68. data/lib/rubysmith/builders/rubocop/formatter.rb +0 -31
  69. data/lib/rubysmith/cli/configuration/content.rb +0 -97
  70. data/lib/rubysmith/cli/configuration/defaults.yml +0 -46
  71. data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +0 -26
  72. data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +0 -33
  73. data/lib/rubysmith/cli/configuration/enhancers/version.rb +0 -26
  74. data/lib/rubysmith/cli/configuration/loader.rb +0 -46
  75. data/lib/rubysmith/cli/parsers/assembler.rb +0 -32
  76. data/lib/rubysmith/cli/parsers.rb +0 -11
  77. data/lib/rubysmith/identity.rb +0 -11
  78. data/lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb +0 -5
  79. data/lib/rubysmith/templates/%project_name%/CHANGES.md.erb +0 -5
  80. data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb +0 -114
  81. data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.md.erb +0 -115
  82. data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.adoc.erb +0 -22
  83. data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.md.erb +0 -22
data/README.adoc CHANGED
@@ -15,11 +15,10 @@ Rubysmith is a command line interface for smithing Ruby projects.
15
15
 
16
16
  This gem is useful in situations in which you need something more sophisticated than a
17
17
  link:https://bundler.io/guides/bundler_in_a_single_file_ruby_script.html[Bundler Inline] script but
18
- less complicated than a link:https://www.alchemists.io/projects/gemsmith[Gemsmith] gem. Rubysmith is
19
- the foundation of Gemsmith and provides a lot of the same functionality as Gemsmith but solely
20
- tailored for pure Ruby projects. Again, this is a great tool for spiking quick Ruby implementations,
21
- sharing code snippets with others, or building full blown Ruby projects for collaboration with
22
- others.
18
+ less than a link:https://www.alchemists.io/projects/gemsmith[Gemsmith] gem. Rubysmith is the
19
+ foundation of Gemsmith and provides a lot of the same functionality as Gemsmith but solely tailored
20
+ for pure Ruby projects. Again, this is a great tool for spiking quick Ruby implementations, sharing
21
+ code snippets with others, or building full blown Ruby projects for collaboration with others.
23
22
 
24
23
  toc::[]
25
24
 
@@ -31,6 +30,9 @@ toc::[]
31
30
  * Supports link:https://github.com/amazing-print/amazing_print[Amazing Print].
32
31
  * Supports link:https://github.com/rubymem/bundler-leak[Bundler Leak].
33
32
  * Supports link:https://circleci.com[Circle CI].
33
+ * Supports link:https://orcid.org[ORCID Citations].
34
+ * Supports console script for local development.
35
+ * Supports link:https://rubygems.org/gems/dead_end[DeadEnd].
34
36
  * Supports link:https://github.com/ruby/debug[Debug].
35
37
  * Supports link:https://git-scm.com[Git].
36
38
  * Supports link:https://github.com[GitHub].
@@ -49,22 +51,17 @@ toc::[]
49
51
  * Supports common settings and a structured layout for building projects.
50
52
  * Provides common documentation:
51
53
  ** README
52
- ** CHANGES
53
- ** CODE OF CONDUCT
54
- ** CONTRIBUTING
55
54
  ** LICENSE
56
-
57
- // == Screencasts
58
-
59
- // [link=https://www.alchemists.io/screencasts/rubysmith]
60
- // image::https://www.alchemists.io/images/screencasts/rubysmith/cover.svg[Screencast,600,240,role=focal_point]
55
+ ** VERSIONS
56
+ ** Security
57
+ ** Code of Conduct
58
+ ** Contributions
59
+ ** Communities
61
60
 
62
61
  == Requirements
63
62
 
64
63
  . A UNIX-based system.
65
64
  . link:https://www.ruby-lang.org[Ruby].
66
- . link:https://rubygems.org[RubyGems].
67
- . link:https://github.com/bundler/bundler[Bundler].
68
65
 
69
66
  == Setup
70
67
 
@@ -86,47 +83,53 @@ USAGE:
86
83
  -b, --build NAME [options] Build new project.
87
84
  -c, --config ACTION Manage gem configuration: edit or view.
88
85
  -h, --help Show this message.
86
+ -p, --publish VERSION Publish project.
89
87
  -v, --version Show gem version.
90
88
 
91
89
  BUILD OPTIONS:
92
- --[no-]amazing_print Add Amazing Print gem. Default: true.
93
- --[no-]bundler-leak Add Bundler Leak gem. Default: true.
94
- --[no-]changes Add CHANGES documentation. Default: true.
95
- --[no-]circle_ci Add Circle CI configuration and badge. Default: false.
96
- --[no-]conduct Add CODE_OF_CONDUCT documentation. Default: true.
97
- --[no-]console Add console script. Default: true.
98
- --[no-]contributions Add CONTRIBUTING documentation. Default: true.
99
- --[no-]debug Add Debug gem. Default: true.
100
- --[no-]git Add Git. Default: true.
101
- --[no-]git_hub Add GitHub templates. Default: false.
102
- --[no-]git-lint Add Git Lint gem. Default: true.
103
- --[no-]guard Add Guard gem. Default: true.
104
- --[no-]license Add LICENSE documentation. Default: true.
105
- --max Use maximum/enabled options. Default: false.
106
- --min Use minimum/disabled options. Default: false.
107
- --[no-]rake Add Rake gem. Default: true.
108
- --[no-]readme Add README documentation. Default: true.
109
- --[no-]reek Add Reek gem. Default: true.
110
- --[no-]refinements Add Refinements gem. Default: true.
111
- --[no-]rspec Add RSpec gem. Default: true.
112
- --[no-]rubocop Add Rubocop gems. Default: true.
113
- --[no-]setup Add setup script. Default: true.
114
- --[no-]simple_cov Add SimpleCov gem. Default: true.
115
- --[no-]zeitwerk Add Zeitwerk gem. Default: true.
90
+ --[no-]amazing_print Add Amazing Print gem. Default: true.
91
+ --[no-]bundler-leak Add Bundler Leak gem. Default: true.
92
+ --[no-]circle_ci Add Circle CI configuration and badge. Default: false.
93
+ --[no-]citation Add citation documentation. Default: true.
94
+ --[no-]community Add community documentation. Default: false.
95
+ --[no-]conduct Add code of conduct documentation. Default: true.
96
+ --[no-]console Add console script. Default: true.
97
+ --[no-]contributions Add contributions documentation. Default: true.
98
+ --[no-]dead_end Add Dead End gem. Default: true.
99
+ --[no-]debug Add Debug gem. Default: true.
100
+ --[no-]git Add Git. Default: true.
101
+ --[no-]git_hub Add GitHub templates. Default: false.
102
+ --[no-]git-lint Add Git Lint gem. Default: true.
103
+ --[no-]guard Add Guard gem. Default: true.
104
+ --[no-]license Add license documentation. Default: true.
105
+ --max Use maximum/enabled options. Default: false.
106
+ --min Use minimum/disabled options. Default: false.
107
+ --[no-]rake Add Rake gem. Default: true.
108
+ --[no-]readme Add readme documentation. Default: true.
109
+ --[no-]reek Add Reek gem. Default: true.
110
+ --[no-]refinements Add Refinements gem. Default: true.
111
+ --[no-]rspec Add RSpec gem. Default: true.
112
+ --[no-]rubocop Add RuboCop gems. Default: true.
113
+ --[no-]setup Add setup script. Default: true.
114
+ --[no-]simple_cov Add SimpleCov gem. Default: true.
115
+ --[no-]versions Add version history. Default: true.
116
+ --[no-]yard Add Yard gem. Default: false.
117
+ --[no-]zeitwerk Add Zeitwerk gem. Default: true.
116
118
  ....
117
119
 
118
- === Building
120
+ === Build
119
121
 
120
- The core functionality of this gem centers around the `--build` command with optional customization
121
- provided via build options. By default, all build options are enabled. Example:
122
+ The core functionality of this gem centers around the `--build` command and associated options
123
+ (flags). The build options allow you to further customize the kind of project you want to build.
124
+ Most build options are enabled by default. Example:
122
125
 
123
126
  [source,bash]
124
127
  ----
125
128
  rubysmith --build demo
126
129
  ----
127
130
 
128
- Running the above will generate a new `demo` Ruby project with all options enabled. Should you wish
129
- to disable specific options, you can use the `--no-*` prefix. Example:
131
+ Running the above will generate a new `demo` Ruby project. Should you wish to disable specific
132
+ options, you can use `--no-*` prefixes. Example:
130
133
 
131
134
  [source,bash]
132
135
  ----
@@ -155,11 +158,185 @@ rubysmith --build demo --min --zeitwerk
155
158
  rubysmith --build demo --max --no-debug
156
159
  ----
157
160
 
158
- With the above examples, the first line will _disable_ all options except for Zeitwerk while the
159
- second line will _enable_ all options except for Debug. This can be a handy way to build a new
160
- project with all options either disabled or enabled with only a few select options modified. To have
161
- specific options enabled/disabled _every time_ you build a new Ruby project, you can edit your
162
- global configuration for making these settings permanent (see below for details).
161
+ With the above examples, the first line will _disable_ all options except Zeitwerk while the second
162
+ line will _enable_ all options except Debug. This can be a handy way to build a new project with all
163
+ options either disabled or enabled with only a few select options modified. To have specific options
164
+ enabled/disabled _every time_ you build a new Ruby project, you can edit your global configuration
165
+ for making these settings permanent (see below for details).
166
+
167
+ There is a lot of flexibility when building a new project through the various build options. I'll
168
+ walk you through each so you can better understand why you'd want to enable or disable any one of
169
+ them.
170
+
171
+ ==== Amazing Print
172
+
173
+ The `--amazing_print` option allows you to build your project with the
174
+ link:https://github.com/amazing-print/amazing_print[Amazing Print] gem for debugging purposes and is
175
+ a handy debugging tool when inspecting your Ruby objects and printing details in a quick to read
176
+ format.
177
+
178
+ ==== Bundler Leak
179
+
180
+ The `--bundler-leak` option allows you to build your project with the
181
+ link:https://github.com/rubymem/bundler-leak[Bundler Leak] gem which helps detect memory leaks in
182
+ your gem dependencies.
183
+
184
+ ==== Circle CI
185
+
186
+ The `--circle_ci` option allows you to build your project with link:https://circleci.com[Circle CI]
187
+ configured so you can get your project building as quickly as possible. This includes a README badge
188
+ and configuration YAML.
189
+
190
+ ==== Citation
191
+
192
+ The `--citation` option allows you to add a link:https://citation-file-format.github.io[citation]
193
+ file to your project so you can help the research community cite your work in their studies if your
194
+ project is used.
195
+
196
+ ==== Community
197
+
198
+ The `--community` option allows you to link to your open source community, organization, or group
199
+ chat to help with community engagement of your work.
200
+
201
+ ==== Code of Conduct
202
+
203
+ The `--conduct` option allows you to link to your link:https://www.contributor-covenant.org[Code of
204
+ Conduct] to encourage good community participation. Regardless of whether you have a community or
205
+ not, the code of conduct is good to encourage in general.
206
+
207
+ ==== Console
208
+
209
+ The `--console` option allows you to add a `console` script for local development. So instead of
210
+ typing `irb`, you can type `bin/console` and get an IRB session with all of your project's code
211
+ loaded.
212
+
213
+ ==== Contributions
214
+
215
+ The `--contributions` option allows you to link to contributing documentation so people know to
216
+ contribute back to your work.
217
+
218
+ ==== DeadEnd
219
+
220
+ The `--dead_end` option allows you build your project with the
221
+ link:https://github.com/zombocom/dead_end[DeadEnd] for debugging purposes since the DeadEnd gem will
222
+ show you where you are missing `end`'s and closing statements.
223
+
224
+ ==== Debug
225
+
226
+ The `--debug` option allows you add the link:https://github.com/ruby/debug[Debug] gem to your
227
+ project for debugging your code by setting breakpoints, remotely connecting to running code, and
228
+ much more.
229
+
230
+ ==== Git
231
+
232
+ The `--git` option allows you add link:https://git-scm.com[Git] repository support.
233
+
234
+ ==== GitHub
235
+
236
+ The `--git_hub` option allows you add link:https://github.com[GitHub] templates to your project for
237
+ issues and pull requests.
238
+
239
+ ==== Git Lint
240
+
241
+ The `--git-lint` option allows you to add the link:https://www.alchemists.io/projects/git-lint[Git
242
+ Lint] gem to your project to ensure you are crafting your Git commits in a consistent and readable
243
+ manner.
244
+
245
+ ==== Guard
246
+
247
+ The `--guard` option allows you add the link:https://github.com/guard/guard[Guard] gem to your
248
+ project for rapid red, green, refactor development cycles.
249
+
250
+ ==== License
251
+
252
+ The `--license` option ensures you build your project with a license.
253
+
254
+ ==== Maximum
255
+
256
+ The `--max` option allows you to build your project with _all_ options _enabled_. This is a quick way
257
+ to build a new project with all options enabled without having to pick and choose.
258
+
259
+ ==== Minimum
260
+
261
+ The `--min` option allows you to build your project with _all_ options _disabled_. This is a quick
262
+ way to build a new project with the bare minimum of support which is a one step above reaching for
263
+ Bundler Inline script.
264
+
265
+ ==== Rake
266
+
267
+ The `--rake` option allows you to add the link:https://github.com/ruby/rake[Rake] gem for quickly
268
+ crafting build scripts.
269
+
270
+ ==== Readme
271
+
272
+ The `--readme` option allows you to add README documentation to your project.
273
+
274
+ ==== Reek
275
+
276
+ The `--reek` option allows you add the link:https://github.com/troessner/reek[Reek] gem to your
277
+ project for code smell and code quality support.
278
+
279
+ ==== Refinements
280
+
281
+ The `--refinements` option allows you to add the
282
+ link:https://www.alchemists.io/projects/refinements[Refinements] gem to your project which enhances
283
+ Ruby core objects without monkey patching your code.
284
+
285
+ ==== RSpec
286
+
287
+ The `--rspec` option allows you add the link:https://rspec.info[RSpec] gem to your project for
288
+ defining your project specifications and have a framework for testing your code.
289
+
290
+ ==== Rubocop
291
+
292
+ The `--rubocop` option allows you to add the link:https://docs.rubocop.org[RuboCop] gem and suite
293
+ of gems to your project for good code quality standards. This the Alchemists style guide, provided
294
+ by the link:https://www.alchemists.io/projects/code_quality[Code Quality] project, is what is used
295
+ by default.
296
+
297
+ ==== Setup
298
+
299
+ The `--setup` option allows you to configure you project with automated setup instructions so anyone
300
+ new to your project can quickly get started by running the `bin/setup` script.
301
+
302
+ ==== SimpleCov
303
+
304
+ The `--simple_cov` option allows you add the
305
+ link:https://github.com/simplecov-ruby/simplecov[SimpleCov] gem to your project to provide full
306
+ analysis of what your quality of code is for the project.
307
+
308
+ ==== Versions
309
+
310
+ The `--versions` option allows you add a `VERSIONS` file to your project to provide details about
311
+ all published versions of your project.
312
+
313
+ ==== YARD
314
+
315
+ The `--yard` option allows you add the link:https://yardoc.org/[YARD] gem to your project so you can
316
+ automate the generation of project documentation. Once your project is built, you can use `rake
317
+ yard` to build documentation into the `doc/yard` folder. This folder is ignored by Git by default.
318
+ Additional customization is possible via the YARD Rake task as found in the `Rakefile`.
319
+
320
+ ==== Zeitwerk
321
+
322
+ The `--zeitwerk` option allows you add the link:https://github.com/fxn/zeitwerk[Zeitwerk] gem to
323
+ your project so you can reduce the maintence burden of managing requirements when adding new objects
324
+ to your project.
325
+
326
+ === Publish
327
+
328
+ Rubysmith can be used to publish your Ruby projects. This is done via the `--publish` command. If,
329
+ for example, you want to publish `0.1.0` of your `demo` project you could do that as follows:
330
+
331
+ [source,bash]
332
+ ----
333
+ cd demo
334
+ rubysmith --publish 0.1.0
335
+ ----
336
+
337
+ This will publish (tag) your `demo` project as `0.1.0` both locally and on your remote Git repository.
338
+ Rubysmith uses link:https://www.alchemists.io/projects/milestoner[Milestoner] to handle publishing
339
+ of your project for you. You can use either but the convenience is built in for you.
163
340
 
164
341
  === Configuration
165
342
 
@@ -175,17 +352,20 @@ variables. The default configuration is as follows:
175
352
  [source,yaml]
176
353
  ----
177
354
  :author:
178
- :name:
179
355
  :email:
356
+ :family_name:
357
+ :given_name:
180
358
  :url:
181
359
  :build:
182
360
  :amazing_print: true
183
361
  :bundler_leak: true
184
- :changes: true
185
362
  :circle_ci: false
363
+ :citation: true
364
+ :community: false
186
365
  :conduct: true
187
366
  :console: true
188
367
  :contributions: true
368
+ :dead_end: true
189
369
  :debug: true
190
370
  :git: true
191
371
  :git_hub: false
@@ -200,69 +380,163 @@ variables. The default configuration is as follows:
200
380
  :refinements: true
201
381
  :rspec: true
202
382
  :rubocop: true
383
+ :security: true
203
384
  :setup: true
204
385
  :simple_cov: true
386
+ :versions: true
387
+ :yard: false
205
388
  :zeitwerk: true
206
- :builders:
389
+ :citation:
390
+ :affiliation:
391
+ :message: Please use the following metadata when citing this project in your work.
392
+ :orcid:
393
+ :documentation:
394
+ :format: "adoc"
395
+ :extensions:
396
+ :milestoner:
397
+ :documentation:
398
+ :format: "md"
399
+ :prefixes:
400
+ - Fixed
401
+ - Added
402
+ - Updated
403
+ - Removed
404
+ - Refactored
405
+ :sign: false
207
406
  :pragmater:
208
407
  :comments:
209
408
  - "# frozen_string_literal: true"
210
409
  :includes:
410
+ - "**/*.rake"
211
411
  - "**/*.rb"
212
- - "**/*bin/console"
213
- - "**/*bin/guard"
214
- - "**/*bin/rubocop"
215
- - "**/*Gemfile"
216
- - "**/*Guardfile"
217
- - "**/*Rakefile"
218
- :documentation:
219
- :format: "md"
220
- :license: "mit"
412
+ - "*.gemspec"
413
+ - "exe/*"
414
+ - bin/console
415
+ - bin/guard
416
+ - bin/rubocop
417
+ - config.ru
418
+ - Gemfile
419
+ - Guardfile
420
+ - Rakefile
421
+ :tocer:
422
+ :includes:
423
+ - "README.md"
424
+ :label: "## Table of Contents"
221
425
  :git_hub:
222
426
  :user:
427
+ :license:
428
+ :label: Hippocratic
429
+ :name: hippocratic
430
+ :version: 3.0
431
+ :project:
432
+ :url:
433
+ :community:
434
+ :conduct:
435
+ :contributions:
436
+ :download:
437
+ :home:
438
+ :issues:
439
+ :license:
440
+ :security:
441
+ :source:
442
+ :versions:
443
+ :version: 0.0.0
223
444
  ----
224
445
 
225
446
  Feel free to take this default configuration, modify, and save as your own custom
226
447
  `configuration.yml`.
227
448
 
449
+ By customizing your configuration, you can change Rubysmith's default behavior when building
450
+ projects. This is a great way to define your own specialized settings other than what is provide for
451
+ you by default. This is also a handy way to provide additional information needed for some of the
452
+ build options. I'll walk you through each section of the configuration so you can learn more.
453
+
228
454
  ==== Author
229
455
 
230
456
  Author information is used when generating project documentation and is recommended you fill this
231
457
  information in before building a project. Example:
232
458
 
233
459
  :author:
234
- :name: Jill Smith
235
460
  :email: jsmith@example.com
461
+ :family_name: Smith
462
+ :given_name: Jill
236
463
  :url: https://www.exmaple.com/team/jsmith
237
464
 
465
+ If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
466
+ family name; and email will be used by default. Should you not want to defer to Git, you can supply
467
+ custom values as desired. The URL is the only value that can't be automatically computed for you.
468
+
238
469
  ==== Build
239
470
 
240
- Build options are booleans so can only be `true` or `false` by default. Should you want a different
241
- configuration than what is enabled/disabled by default, you'll want to customize these options as
242
- you see fit. When changing build options, they will dynamically show up when viewing usage (i.e.
243
- `rubysmith --help`).
471
+ All build options accept booleans values only and can be customized as desired. When changing your
472
+ build options, they will dynamically render when display usage (i.e. `rubysmith --help`). All of
473
+ these options are explained in greater detail above.
244
474
 
245
- ==== Builders
475
+ ==== Citations
246
476
 
247
- Builders are additional tooling which can be configured specifically for Rubysmith. At the moment,
248
- only link:https://www.alchemists.io/projects/pragmater[Pragmater] is supported so view the Pragmater
249
- project page to learn more.
477
+ This section allows you to configure your link:https://orcid.org[ORCiD]
478
+ link:https://citation-file-format.github.io[citation] information used by the research community.
479
+ You should definitely fill this in. Your author information, detailed above, will be used as well.
250
480
 
251
481
  ==== Documentation
252
482
 
253
- Documentation can be configured as follows:
483
+ Use this section to define the kind of documentation you want generated for your project. The
484
+ following options are available:
485
+
486
+ * `adoc` - Uses link:https://asciidoctor.org[ASCII Doc] format.
487
+ * `md` - Use link:https://asciidoctor.org[Markdown] format.
488
+
489
+ ==== Extensions
254
490
 
255
- * *Format*: Use `md` for Markdown or `adoc` for ASCCI Doc.
256
- * *License*: Use `mit` for MIT or `Apache` for Apache 2.0.0 license.
491
+ Extensions are additional tooling which can be configured specifically for Rubysmith. The following
492
+ extensions are currently supported and will override each extensions global configuration should you
493
+ be using them individually for other purposes:
257
494
 
258
- No other licenses are supported at this time but might be expanded up on in the future.
495
+ * link:https://www.alchemists.io/projects/milestoner[Milestoner]
496
+ * link:https://www.alchemists.io/projects/pragmater[Pragmater]
497
+ * link:https://www.alchemists.io/projects/tocer[Tocer]
498
+
499
+ Follow the above links to learn more about each extension's gem configuration.
259
500
 
260
501
  ==== GitHub
261
502
 
262
- Your GitHub user is whatever handle you setup when you creating your GitHub account. This
263
- information is used for documentation purposes and Circle CI badge association. If you don't define
264
- this information, Rubysmith will automatically fallback to pulling this information from your Git
265
- configuration (i.e. `github.user`). If all else fails, then nothing will be used.
503
+ Your GitHub user is the handle you setup when creating your GitHub account. This information is used
504
+ for documentation purposes and Circle CI badge association. If you don't define this information,
505
+ Rubysmith will automatically fallback to pulling this information from your Git configuration (i.e.
506
+ `github.user`). If all else fails, then nothing will be used.
507
+
508
+ ==== License
509
+
510
+ Use this section to define the license you want to use for your project. The following kinds of
511
+ license are available:
512
+
513
+ * *Apache*: Use `apache` as the name and then supply the appropriate label and version.
514
+ * *Hippocratic*: Use `hippocratic` as the name and then supply the appropriate label and version.
515
+ * *MIT*: Use `mit` as the name and then supply the appropriate label and version.
516
+
517
+ ==== Project
518
+
519
+ There are two categories within this section: URLs and version. The URLs allow you to link to
520
+ specific documentation related to your project. You'll definitely want to customize these as makes
521
+ sense since these URLs are used for documentation, citations, and general project information. You
522
+ can also use `%project_name%` as a placeholder anywhere in your URL and Rubysmith will ensure your
523
+ place holder is replaced with your project name when generating a new project. Example:
524
+
525
+ ....
526
+ # Configuration
527
+ https://www.example.com/%project_name%
528
+
529
+ # Command
530
+ rubysmith --build demo
531
+
532
+ # Actual (computed result)
533
+ https://www.example.com/demo
534
+ ....
535
+
536
+ As for the `version` key, this defines the default version of newly created projects. `0.0.0` is the
537
+ default but you can use a higher version number like `0.1.0` or even `1.0.0` if you are super
538
+ confident in your work. That said, the lower the number is better when building your initial
539
+ project.
266
540
 
267
541
  == Development
268
542
 
@@ -291,37 +565,19 @@ To test, run:
291
565
  bundle exec rake
292
566
  ----
293
567
 
294
- == Versioning
295
-
296
- Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
297
-
298
- * Major (X.y.z) - Incremented for any backwards incompatible public API changes.
299
- * Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
300
- * Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
301
-
302
- == Code of Conduct
303
-
304
- Please note that this project is released with a link:CODE_OF_CONDUCT.adoc[CODE OF CONDUCT]. By
305
- participating in this project you agree to abide by its terms.
306
-
307
- == Contributions
308
-
309
- Read link:CONTRIBUTING.adoc[CONTRIBUTING] for details.
310
-
311
- == Community
568
+ == link:https://www.alchemists.io/policies/license[License]
312
569
 
313
- Feel free to link:https://www.alchemists.io/community[join the commmunity] for discussions related
314
- to this project and much more.
570
+ == link:https://www.alchemists.io/policies/security[Security]
315
571
 
316
- == License
572
+ == link:https://www.alchemists.io/policies/code_of_conduct[Code of Conduct]
317
573
 
318
- Read link:LICENSE.adoc[LICENSE] for details.
574
+ == link:https://www.alchemists.io/policies/contributions[Contributions]
319
575
 
320
- == History
576
+ == link:https://www.alchemists.io/projects/rubysmith/versions[Versions]
321
577
 
322
- Read link:CHANGES.adoc[CHANGES] for details.
323
- Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
578
+ == link:https://www.alchemists.io/community[Community]
324
579
 
325
580
  == Credits
326
581
 
327
- Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
582
+ * Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
583
+ * Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
data/exe/rubysmith CHANGED
@@ -3,5 +3,4 @@
3
3
 
4
4
  require "rubysmith"
5
5
 
6
- Process.setproctitle Rubysmith::Identity::VERSION_LABEL
7
6
  Rubysmith::CLI::Shell.new.call ARGV
@@ -5,7 +5,6 @@ require "open3"
5
5
  require "logger"
6
6
 
7
7
  module Rubysmith
8
- # :reek:TooManyMethods
9
8
  # Provides common functionality necessary for all builders.
10
9
  class Builder
11
10
  using Refinements::Pathnames
@@ -119,6 +118,6 @@ module Rubysmith
119
118
  .sub ".erb", ""
120
119
  end
121
120
 
122
- def pathway = configuration.to_pathway
121
+ def pathway = configuration.pathway
123
122
  end
124
123
  end
@@ -1,25 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler"
4
- require "bundler/cli"
5
- require "refinements/pathnames"
3
+ require "refinements/structs"
6
4
 
7
5
  module Rubysmith
8
6
  module Builders
9
- # Builds Bundler Gemfile configuration and installs gem dependencies for project skeleton.
7
+ # Builds Bundler Gemfile configuration for project skeleton.
10
8
  class Bundler
11
- using Refinements::Pathnames
9
+ using Refinements::Structs
12
10
 
13
11
  def self.call(...) = new(...).call
14
12
 
15
- def initialize configuration, builder: Builder, client: ::Bundler::CLI
13
+ def initialize configuration, builder: Builder
16
14
  @configuration = configuration
17
15
  @builder = builder
18
- @client = client
19
16
  end
20
17
 
21
18
  def call
22
- builder.call(configuration.with(template_path: "%project_name%/Gemfile.erb"))
19
+ builder.call(configuration.merge(template_path: "%project_name%/Gemfile.erb"))
23
20
  .render
24
21
  .replace(/\n\s+group/, "\n\ngroup")
25
22
  .replace(/\n\s+gem/, "\n gem")
@@ -28,13 +25,12 @@ module Rubysmith
28
25
  .replace(/\n\ngroup :(code_quality|development|test|tools) do\nend/, "")
29
26
  .replace(/org"\n+/, "org\"\n\n")
30
27
 
31
- configuration.project_root.change_dir { client.start %w[install --quiet] }
32
- nil
28
+ configuration
33
29
  end
34
30
 
35
31
  private
36
32
 
37
- attr_reader :configuration, :builder, :client
33
+ attr_reader :configuration, :builder
38
34
  end
39
35
  end
40
36
  end