rubysmith 0.16.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.adoc +207 -155
- data/README.adoc +340 -94
- data/lib/rubysmith/builder.rb +1 -2
- data/lib/rubysmith/builders/bundler.rb +7 -11
- data/lib/rubysmith/builders/circle_ci.rb +8 -2
- data/lib/rubysmith/builders/console.rb +8 -2
- data/lib/rubysmith/builders/core.rb +7 -3
- data/lib/rubysmith/builders/documentation/{change.rb → citation.rb} +8 -8
- data/lib/rubysmith/builders/documentation/license.rb +9 -4
- data/lib/rubysmith/builders/documentation/readme.rb +12 -18
- data/lib/rubysmith/builders/documentation/{contribution.rb → version.rb} +10 -5
- data/lib/rubysmith/builders/git/commit.rb +3 -1
- data/lib/rubysmith/builders/git/setup.rb +2 -1
- data/lib/rubysmith/builders/git_hub.rb +8 -3
- data/lib/rubysmith/builders/guard.rb +9 -3
- data/lib/rubysmith/builders/rake.rb +8 -3
- data/lib/rubysmith/builders/reek.rb +7 -2
- data/lib/rubysmith/builders/rspec/context.rb +8 -2
- data/lib/rubysmith/builders/rspec/helper.rb +8 -2
- data/lib/rubysmith/builders/rubocop.rb +34 -0
- data/lib/rubysmith/builders/setup.rb +8 -2
- data/lib/rubysmith/cli/actions/build.rb +10 -12
- data/lib/rubysmith/cli/actions/config.rb +4 -2
- data/lib/rubysmith/cli/actions/publish.rb +21 -0
- data/lib/rubysmith/cli/parser.rb +31 -0
- data/lib/rubysmith/cli/parsers/build.rb +80 -45
- data/lib/rubysmith/cli/parsers/core.rb +14 -10
- data/lib/rubysmith/cli/shell.rb +22 -15
- data/lib/rubysmith/configuration/content.rb +170 -0
- data/lib/rubysmith/configuration/defaults.yml +88 -0
- data/lib/rubysmith/configuration/enhancers/current_time.rb +24 -0
- data/lib/rubysmith/configuration/enhancers/git_email.rb +31 -0
- data/lib/rubysmith/configuration/enhancers/git_hub_user.rb +31 -0
- data/lib/rubysmith/configuration/enhancers/git_user.rb +33 -0
- data/lib/rubysmith/configuration/loader.rb +48 -0
- data/lib/rubysmith/container.rb +1 -1
- data/lib/rubysmith/extensions/bundler.rb +30 -0
- data/lib/rubysmith/extensions/milestoner.rb +35 -0
- data/lib/rubysmith/extensions/pragmater.rb +35 -0
- data/lib/rubysmith/extensions/rubocop.rb +29 -0
- data/lib/rubysmith/extensions/tocer.rb +37 -0
- data/lib/rubysmith/identity.rb +1 -1
- data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +1 -4
- data/lib/rubysmith/templates/%project_name%/.rubocop.yml.erb +2 -0
- data/lib/rubysmith/templates/%project_name%/CITATION.cff.erb +16 -0
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +12 -9
- data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.adoc.erb +214 -0
- data/lib/rubysmith/templates/%project_name%/LICENSE-hippocratic.md.erb +214 -0
- data/lib/rubysmith/templates/%project_name%/README.adoc.erb +20 -21
- data/lib/rubysmith/templates/%project_name%/README.md.erb +20 -21
- data/lib/rubysmith/templates/%project_name%/VERSIONS.adoc.erb +5 -0
- data/lib/rubysmith/templates/%project_name%/VERSIONS.md.erb +5 -0
- data/lib/rubysmith/templates/%project_name%/bin/rubocop.erb +0 -1
- data.tar.gz.sig +0 -0
- metadata +54 -38
- metadata.gz.sig +3 -2
- data/lib/rubysmith/builders/documentation/conduct.rb +0 -32
- data/lib/rubysmith/builders/pragma.rb +0 -32
- data/lib/rubysmith/builders/rubocop/formatter.rb +0 -31
- data/lib/rubysmith/builders/rubocop/setup.rb +0 -31
- data/lib/rubysmith/cli/configuration/content.rb +0 -97
- data/lib/rubysmith/cli/configuration/defaults.yml +0 -46
- data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +0 -26
- data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +0 -33
- data/lib/rubysmith/cli/configuration/enhancers/version.rb +0 -26
- data/lib/rubysmith/cli/configuration/loader.rb +0 -46
- data/lib/rubysmith/cli/parsers/assembler.rb +0 -32
- data/lib/rubysmith/cli/parsers.rb +0 -11
- data/lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb +0 -5
- data/lib/rubysmith/templates/%project_name%/CHANGES.md.erb +0 -5
- data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb +0 -114
- data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.md.erb +0 -115
- data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.adoc.erb +0 -22
- data/lib/rubysmith/templates/%project_name%/CONTRIBUTING.md.erb +0 -22
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
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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,52 @@ 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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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-]zeitwerk Add Zeitwerk gem. Default: true.
|
116
117
|
....
|
117
118
|
|
118
|
-
===
|
119
|
+
=== Build
|
119
120
|
|
120
|
-
The core functionality of this gem centers around the `--build` command
|
121
|
-
|
121
|
+
The core functionality of this gem centers around the `--build` command and associated options
|
122
|
+
(flags). The build options allow you to further customize the kind of project you want to build.
|
123
|
+
Most build options are enabled by default. Example:
|
122
124
|
|
123
125
|
[source,bash]
|
124
126
|
----
|
125
127
|
rubysmith --build demo
|
126
128
|
----
|
127
129
|
|
128
|
-
Running the above will generate a new `demo` Ruby project
|
129
|
-
|
130
|
+
Running the above will generate a new `demo` Ruby project. Should you wish to disable specific
|
131
|
+
options, you can use `--no-*` prefixes. Example:
|
130
132
|
|
131
133
|
[source,bash]
|
132
134
|
----
|
@@ -155,11 +157,178 @@ rubysmith --build demo --min --zeitwerk
|
|
155
157
|
rubysmith --build demo --max --no-debug
|
156
158
|
----
|
157
159
|
|
158
|
-
With the above examples, the first line will _disable_ all options except
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
With the above examples, the first line will _disable_ all options except Zeitwerk while the second
|
161
|
+
line will _enable_ all options except Debug. This can be a handy way to build a new project with all
|
162
|
+
options either disabled or enabled with only a few select options modified. To have specific options
|
163
|
+
enabled/disabled _every time_ you build a new Ruby project, you can edit your global configuration
|
164
|
+
for making these settings permanent (see below for details).
|
165
|
+
|
166
|
+
There is a lot of flexibility when building a new project through the various build options. I'll
|
167
|
+
walk you through each so you can better understand why you'd want to enable or disable any one of
|
168
|
+
them.
|
169
|
+
|
170
|
+
==== Amazing Print
|
171
|
+
|
172
|
+
The `--amazing_print` option allows you to build your project with the
|
173
|
+
link:https://github.com/amazing-print/amazing_print[Amazing Print] gem for debugging purposes and is
|
174
|
+
a handy debugging tool when inspecting your Ruby objects and printing details in a quick to read
|
175
|
+
format.
|
176
|
+
|
177
|
+
==== Bundler Leak
|
178
|
+
|
179
|
+
The `--bundler-leak` option allows you to build your project with the
|
180
|
+
link:https://github.com/rubymem/bundler-leak[Bundler Leak] gem which helps detect memory leaks in
|
181
|
+
your gem dependencies.
|
182
|
+
|
183
|
+
==== Circle CI
|
184
|
+
|
185
|
+
The `--circle_ci` option allows you to build your project with link:https://circleci.com[Circle CI]
|
186
|
+
configured so you can get your project building as quickly as possible. This includes a README badge
|
187
|
+
and configuration YAML.
|
188
|
+
|
189
|
+
==== Citation
|
190
|
+
|
191
|
+
The `--citation` option allows you to add a link:https://citation-file-format.github.io[citation]
|
192
|
+
file to your project so you can help the research community cite your work in their studies if your
|
193
|
+
project is used.
|
194
|
+
|
195
|
+
==== Community
|
196
|
+
|
197
|
+
The `--community` option allows you to link to your open source community, organization, or group
|
198
|
+
chat to help with community engagement of your work.
|
199
|
+
|
200
|
+
==== Code of Conduct
|
201
|
+
|
202
|
+
The `--conduct` option allows you to link to your link:https://www.contributor-covenant.org[Code of
|
203
|
+
Conduct] to encourage good community participation. Regardless of whether you have a community or
|
204
|
+
not, the code of conduct is good to encourage in general.
|
205
|
+
|
206
|
+
==== Console
|
207
|
+
|
208
|
+
The `--console` option allows you to add a `console` script for local development. So instead of
|
209
|
+
typing `irb`, you can type `bin/console` and get an IRB session with all of your project's code
|
210
|
+
loaded.
|
211
|
+
|
212
|
+
==== Contributions
|
213
|
+
|
214
|
+
The `--contributions` option allows you to link to contributing documentation so people know to
|
215
|
+
contribute back to your work.
|
216
|
+
|
217
|
+
==== DeadEnd
|
218
|
+
|
219
|
+
The `--dead_end` option allows you build your project with the
|
220
|
+
link:https://github.com/zombocom/dead_end[DeadEnd] for debugging purposes since the DeadEnd gem will
|
221
|
+
show you where you are missing `end`'s and closing statements.
|
222
|
+
|
223
|
+
==== Debug
|
224
|
+
|
225
|
+
The `--debug` option allows you add the link:https://github.com/ruby/debug[Debug] gem to your
|
226
|
+
project for debugging your code by setting breakpoints, remotely connecting to running code, and
|
227
|
+
much more.
|
228
|
+
|
229
|
+
==== Git
|
230
|
+
|
231
|
+
The `--git` option allows you add link:https://git-scm.com[Git] repository support.
|
232
|
+
|
233
|
+
==== GitHub
|
234
|
+
|
235
|
+
The `--git_hub` option allows you add link:https://github.com[GitHub] templates to your project for
|
236
|
+
issues and pull requests.
|
237
|
+
|
238
|
+
==== Git Lint
|
239
|
+
|
240
|
+
The `--git-lint` option allows you to add the link:https://www.alchemists.io/projects/git-lint[Git
|
241
|
+
Lint] gem to your project to ensure you are crafting your Git commits in a consistent and readable
|
242
|
+
manner.
|
243
|
+
|
244
|
+
==== Guard
|
245
|
+
|
246
|
+
The `--guard` option allows you add the link:https://github.com/guard/guard[Guard] gem to your
|
247
|
+
project for rapid red, green, refactor development cycles.
|
248
|
+
|
249
|
+
==== License
|
250
|
+
|
251
|
+
The `--license` option ensures you build your project with a license.
|
252
|
+
|
253
|
+
==== Maximum
|
254
|
+
|
255
|
+
The `--max` option allows you to build your project with _all_ options _enabled_. This is a quick way
|
256
|
+
to build a new project with all options enabled without having to pick and choose.
|
257
|
+
|
258
|
+
==== Minimum
|
259
|
+
|
260
|
+
The `--min` option allows you to build your project with _all_ options _disabled_. This is a quick
|
261
|
+
way to build a new project with the bare minimum of support which is a one step above reaching for
|
262
|
+
Bundler Inline script.
|
263
|
+
|
264
|
+
==== Rake
|
265
|
+
|
266
|
+
The `--rake` option allows you to add the link:https://github.com/ruby/rake[Rake] gem for quickly
|
267
|
+
crafting build scripts.
|
268
|
+
|
269
|
+
==== Readme
|
270
|
+
|
271
|
+
The `--readme` option allows you to add README documentation to your project.
|
272
|
+
|
273
|
+
==== Reek
|
274
|
+
|
275
|
+
The `--reek` option allows you add the link:https://github.com/troessner/reek[Reek] gem to your
|
276
|
+
project for code smell and code quality support.
|
277
|
+
|
278
|
+
==== Refinements
|
279
|
+
|
280
|
+
The `--refinements` option allows you to add the
|
281
|
+
link:https://www.alchemists.io/projects/refinements[Refinements] gem to your project which enhances
|
282
|
+
Ruby core objects without monkey patching your code.
|
283
|
+
|
284
|
+
==== RSpec
|
285
|
+
|
286
|
+
The `--rspec` option allows you add the link:https://rspec.info[RSpec] gem to your project for
|
287
|
+
defining your project specifications and have a framework for testing your code.
|
288
|
+
|
289
|
+
==== Rubocop
|
290
|
+
|
291
|
+
The `--rubocop` option allows you to add the link:https://docs.rubocop.org[[RuboCop] gem and suite
|
292
|
+
of gems to your project for good code quality standards. This the Alchemists style guide, provided
|
293
|
+
by the link:https://www.alchemists.io/projects/code_quality[Code Quality] project, is what is used
|
294
|
+
by default.
|
295
|
+
|
296
|
+
==== Setup
|
297
|
+
|
298
|
+
The `--setup` option allows you to configure you project with automated setup instructions so anyone
|
299
|
+
new to your project can quickly get started by running the `bin/setup` script.
|
300
|
+
|
301
|
+
==== SimpleCov
|
302
|
+
|
303
|
+
The `--simple_cov` option allows you add the
|
304
|
+
link:https://github.com/simplecov-ruby/simplecov[SimpleCov] gem to your project to provide full
|
305
|
+
analysis of what your quality of code is for the project.
|
306
|
+
|
307
|
+
==== Versions
|
308
|
+
|
309
|
+
The `--versions` option allows you add a `VERSIONS` file to your project to provide details about
|
310
|
+
all published versions of your project.
|
311
|
+
|
312
|
+
==== Zeitwerk
|
313
|
+
|
314
|
+
The `--zeitwerk` option allows you add the link:https://github.com/fxn/zeitwerk[Zeitwerk] gem to
|
315
|
+
your project so you can reduce the maintence burden of managing requirements when adding new objects
|
316
|
+
to your project.
|
317
|
+
|
318
|
+
=== Publish
|
319
|
+
|
320
|
+
Rubysmith can be used to publish your Ruby projects. This is done via the `--publish` command. If,
|
321
|
+
for example, you want to publish `0.1.0` of your `demo` project you could do that as follows:
|
322
|
+
|
323
|
+
[source,bash]
|
324
|
+
----
|
325
|
+
cd demo
|
326
|
+
rubysmith --publish 0.1.0
|
327
|
+
----
|
328
|
+
|
329
|
+
This will publish (tag) your `demo` project as `0.1.0` both locally and on your remote Git repository.
|
330
|
+
Rubysmith uses link:https://www.alchemists.io/projects/milestoner[Milestoner] to handle publishing
|
331
|
+
of your project for you. You can use either but the convenience is built in for you.
|
163
332
|
|
164
333
|
=== Configuration
|
165
334
|
|
@@ -175,17 +344,20 @@ variables. The default configuration is as follows:
|
|
175
344
|
[source,yaml]
|
176
345
|
----
|
177
346
|
:author:
|
178
|
-
:name:
|
179
347
|
:email:
|
348
|
+
:family_name:
|
349
|
+
:given_name:
|
180
350
|
:url:
|
181
351
|
:build:
|
182
352
|
:amazing_print: true
|
183
353
|
:bundler_leak: true
|
184
|
-
:changes: true
|
185
354
|
:circle_ci: false
|
355
|
+
:citation: true
|
356
|
+
:community: false
|
186
357
|
:conduct: true
|
187
358
|
:console: true
|
188
359
|
:contributions: true
|
360
|
+
:dead_end: true
|
189
361
|
:debug: true
|
190
362
|
:git: true
|
191
363
|
:git_hub: false
|
@@ -200,14 +372,34 @@ variables. The default configuration is as follows:
|
|
200
372
|
:refinements: true
|
201
373
|
:rspec: true
|
202
374
|
:rubocop: true
|
375
|
+
:security: true
|
203
376
|
:setup: true
|
204
377
|
:simple_cov: true
|
378
|
+
:versions: true
|
205
379
|
:zeitwerk: true
|
206
|
-
:
|
380
|
+
:citation:
|
381
|
+
:affiliation:
|
382
|
+
:message: Please use the following metadata when citing this project in your work.
|
383
|
+
:orcid:
|
384
|
+
:documentation:
|
385
|
+
:format: "adoc"
|
386
|
+
:extensions:
|
387
|
+
:milestoner:
|
388
|
+
:documentation:
|
389
|
+
:format: "md"
|
390
|
+
:prefixes:
|
391
|
+
- Fixed
|
392
|
+
- Added
|
393
|
+
- Updated
|
394
|
+
- Removed
|
395
|
+
- Refactored
|
396
|
+
:sign: false
|
207
397
|
:pragmater:
|
208
398
|
:comments:
|
209
399
|
- "# frozen_string_literal: true"
|
210
400
|
:includes:
|
401
|
+
- "**/*.gemspec"
|
402
|
+
- "**/*.rake"
|
211
403
|
- "**/*.rb"
|
212
404
|
- "**/*bin/console"
|
213
405
|
- "**/*bin/guard"
|
@@ -215,47 +407,86 @@ variables. The default configuration is as follows:
|
|
215
407
|
- "**/*Gemfile"
|
216
408
|
- "**/*Guardfile"
|
217
409
|
- "**/*Rakefile"
|
218
|
-
:
|
219
|
-
|
220
|
-
|
410
|
+
:tocer:
|
411
|
+
:includes:
|
412
|
+
- "README.md"
|
413
|
+
:label: "## Table of Contents"
|
221
414
|
:git_hub:
|
222
415
|
:user:
|
416
|
+
:license:
|
417
|
+
:label: Hippocratic
|
418
|
+
:name: hippocratic
|
419
|
+
:version: 3.0
|
420
|
+
:project:
|
421
|
+
:url:
|
422
|
+
:community:
|
423
|
+
:conduct:
|
424
|
+
:contributions:
|
425
|
+
:download:
|
426
|
+
:home:
|
427
|
+
:issues:
|
428
|
+
:license:
|
429
|
+
:security:
|
430
|
+
:source:
|
431
|
+
:versions:
|
432
|
+
:version: 0.0.0
|
223
433
|
----
|
224
434
|
|
225
435
|
Feel free to take this default configuration, modify, and save as your own custom
|
226
436
|
`configuration.yml`.
|
227
437
|
|
438
|
+
By customizing your configuration, you can change Rubysmith's default behavior when building
|
439
|
+
projects. This is a great way to define your own specialized settings other than what is provide for
|
440
|
+
you by default. This is also a handy way to provide additional information needed for some of the
|
441
|
+
build options. I'll walk you through each section of the configuration so you can learn more.
|
442
|
+
|
228
443
|
==== Author
|
229
444
|
|
230
445
|
Author information is used when generating project documentation and is recommended you fill this
|
231
446
|
information in before building a project. Example:
|
232
447
|
|
233
448
|
:author:
|
234
|
-
:name: Jill Smith
|
235
449
|
:email: jsmith@example.com
|
450
|
+
:family_name: Smith
|
451
|
+
:given_name: Jill
|
236
452
|
:url: https://www.exmaple.com/team/jsmith
|
237
453
|
|
454
|
+
If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
|
455
|
+
family name; and email will be used by default. Should you not want to defer to Git, you can supply
|
456
|
+
custom values as desired. The URL is the only value that can't be automatically computed for you.
|
457
|
+
|
238
458
|
==== Build
|
239
459
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
460
|
+
All build options can only be `true` or `false` booleans. Should you want a different configuration
|
461
|
+
than what is enabled/disabled by default, you'll want to customize these options as you see fit.
|
462
|
+
When changing build options, they will dynamically show up when viewing usage (i.e. `rubysmith
|
463
|
+
--help`). All of these options are explained in greater detail above.
|
244
464
|
|
245
|
-
====
|
465
|
+
==== Citations
|
246
466
|
|
247
|
-
|
248
|
-
|
249
|
-
|
467
|
+
This section allows you to configure your link:https://orcid.org[ORCiD]
|
468
|
+
link:https://citation-file-format.github.io[citation] information used by the research community.
|
469
|
+
You should definitely fill this in. Your author information, detailed above, will be used as well.
|
250
470
|
|
251
471
|
==== Documentation
|
252
472
|
|
253
|
-
|
473
|
+
Use this section to define the kind of documentation you want generated for your project. The
|
474
|
+
following options are available:
|
475
|
+
|
476
|
+
* `adoc` - Uses link:https://asciidoctor.org[ASCII Doc] format.
|
477
|
+
* `md` - Use link:https://asciidoctor.org[Markdown] format.
|
478
|
+
|
479
|
+
==== Extensions
|
254
480
|
|
255
|
-
|
256
|
-
|
481
|
+
Extensions are additional tooling which can be configured specifically for Rubysmith. The following
|
482
|
+
extensions are currently supported and will override each extensions global configuration should you
|
483
|
+
be using them individually for other purposes:
|
257
484
|
|
258
|
-
|
485
|
+
* link:https://www.alchemists.io/projects/milestoner[Milestoner]
|
486
|
+
* link:https://www.alchemists.io/projects/pragmater[Pragmater]
|
487
|
+
* link:https://www.alchemists.io/projects/tocer[Tocer]
|
488
|
+
|
489
|
+
Follow the above links to learn more about each extension's gem configuration.
|
259
490
|
|
260
491
|
==== GitHub
|
261
492
|
|
@@ -264,6 +495,39 @@ information is used for documentation purposes and Circle CI badge association.
|
|
264
495
|
this information, Rubysmith will automatically fallback to pulling this information from your Git
|
265
496
|
configuration (i.e. `github.user`). If all else fails, then nothing will be used.
|
266
497
|
|
498
|
+
==== License
|
499
|
+
|
500
|
+
Use this section to define the license you want to use for your project. The following kinds of
|
501
|
+
license are available:
|
502
|
+
|
503
|
+
* *Apache*: Use `apache` as the name and then supply the appropriate label and version.
|
504
|
+
* *Hippocratic*: Use `hippocratic` as the name and then supply the appropriate label and version.
|
505
|
+
* *MIT*: Use `mit` as the name and then supply the appropriate label and version.
|
506
|
+
|
507
|
+
==== Project
|
508
|
+
|
509
|
+
There are two many categories within this section: URLs and version. The URLs allow you to link to
|
510
|
+
specific documentation related to your project. You'll definitely want to customize these as makes
|
511
|
+
sense since these URLs are used for documentation, citations, and general project information. You
|
512
|
+
can also use `%project_name%` as a placeholder anywhere in your URL and Rubysmith will ensure your
|
513
|
+
place holder is replaced with your project name when generating a new project. Example:
|
514
|
+
|
515
|
+
....
|
516
|
+
# Configuration
|
517
|
+
https://www.example.com/%project_name%
|
518
|
+
|
519
|
+
# Command
|
520
|
+
rubysmith --build demo
|
521
|
+
|
522
|
+
# Actual (computed result)
|
523
|
+
https://www.example.com/demo
|
524
|
+
....
|
525
|
+
|
526
|
+
As for the `version` key, this defines the default version of newly created projects. `0.0.0` is the
|
527
|
+
default but you can use a higher version number like `0.1.0` or even `1.0.0` if you are super
|
528
|
+
confident in your work. That said, the lower the number is better when building your initial
|
529
|
+
project.
|
530
|
+
|
267
531
|
== Development
|
268
532
|
|
269
533
|
To contribute, run:
|
@@ -291,37 +555,19 @@ To test, run:
|
|
291
555
|
bundle exec rake
|
292
556
|
----
|
293
557
|
|
294
|
-
==
|
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
|
558
|
+
== link:https://www.alchemists.io/policies/license[License]
|
312
559
|
|
313
|
-
|
314
|
-
to this project and much more.
|
560
|
+
== link:https://www.alchemists.io/policies/security[Security]
|
315
561
|
|
316
|
-
==
|
562
|
+
== link:https://www.alchemists.io/policies/code_of_conduct[Code of Conduct]
|
317
563
|
|
318
|
-
|
564
|
+
== link:https://www.alchemists.io/policies/contributions[Contributions]
|
319
565
|
|
320
|
-
==
|
566
|
+
== link:https://www.alchemists.io/projects/rubysmith/versions[Versions]
|
321
567
|
|
322
|
-
|
323
|
-
Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
|
568
|
+
== link:https://www.alchemists.io/community[Community]
|
324
569
|
|
325
570
|
== Credits
|
326
571
|
|
327
|
-
|
572
|
+
* Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
|
573
|
+
* Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
data/lib/rubysmith/builder.rb
CHANGED
@@ -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.
|
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 "
|
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
|
7
|
+
# Builds Bundler Gemfile configuration for project skeleton.
|
10
8
|
class Bundler
|
11
|
-
using Refinements::
|
9
|
+
using Refinements::Structs
|
12
10
|
|
13
11
|
def self.call(...) = new(...).call
|
14
12
|
|
15
|
-
def initialize configuration, builder: Builder
|
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.
|
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
|
32
|
-
nil
|
28
|
+
configuration
|
33
29
|
end
|
34
30
|
|
35
31
|
private
|
36
32
|
|
37
|
-
attr_reader :configuration, :builder
|
33
|
+
attr_reader :configuration, :builder
|
38
34
|
end
|
39
35
|
end
|
40
36
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "refinements/structs"
|
4
|
+
|
3
5
|
module Rubysmith
|
4
6
|
module Builders
|
5
7
|
# Builds project skeleton Circle CI configuration.
|
6
8
|
class CircleCI
|
9
|
+
using Refinements::Structs
|
10
|
+
|
7
11
|
def self.call(...) = new(...).call
|
8
12
|
|
9
13
|
def initialize configuration, builder: Builder
|
@@ -12,10 +16,12 @@ module Rubysmith
|
|
12
16
|
end
|
13
17
|
|
14
18
|
def call
|
15
|
-
return unless configuration.build_circle_ci
|
19
|
+
return configuration unless configuration.build_circle_ci
|
16
20
|
|
17
|
-
builder.call(configuration.
|
21
|
+
builder.call(configuration.merge(template_path: "%project_name%/.circleci/config.yml.erb"))
|
18
22
|
.render
|
23
|
+
|
24
|
+
configuration
|
19
25
|
end
|
20
26
|
|
21
27
|
private
|