rubysmith 0.15.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.adoc +207 -155
- data/README.adoc +352 -93
- data/{bin → exe}/rubysmith +0 -0
- data/lib/rubysmith/builder.rb +2 -3
- 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/{rubocop/setup.rb → git/ignore.rb} +11 -7
- 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 +9 -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 +11 -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 +89 -45
- data/lib/rubysmith/cli/parsers/core.rb +14 -10
- data/lib/rubysmith/cli/shell.rb +22 -15
- data/lib/rubysmith/configuration/content.rb +174 -0
- data/lib/rubysmith/configuration/defaults.yml +89 -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%/.github/PULL_REQUEST_TEMPLATE.md.erb +0 -3
- data/lib/rubysmith/templates/%project_name%/.gitignore.erb +11 -0
- 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 +19 -10
- 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%/Rakefile.erb +9 -0
- 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 +61 -42
- metadata.gz.sig +0 -0
- 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/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,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
|
-
|
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-]yard Add Yard gem. Default: false.
|
117
|
+
--[no-]zeitwerk Add Zeitwerk gem. Default: true.
|
116
118
|
....
|
117
119
|
|
118
|
-
===
|
120
|
+
=== Build
|
119
121
|
|
120
|
-
The core functionality of this gem centers around the `--build` command
|
121
|
-
|
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
|
129
|
-
|
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
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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,14 +380,35 @@ 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
|
-
:
|
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
|
+
- "**/*.gemspec"
|
411
|
+
- "**/*.rake"
|
211
412
|
- "**/*.rb"
|
212
413
|
- "**/*bin/console"
|
213
414
|
- "**/*bin/guard"
|
@@ -215,54 +416,125 @@ variables. The default configuration is as follows:
|
|
215
416
|
- "**/*Gemfile"
|
216
417
|
- "**/*Guardfile"
|
217
418
|
- "**/*Rakefile"
|
218
|
-
:
|
219
|
-
|
220
|
-
|
419
|
+
:tocer:
|
420
|
+
:includes:
|
421
|
+
- "README.md"
|
422
|
+
:label: "## Table of Contents"
|
221
423
|
:git_hub:
|
222
424
|
:user:
|
425
|
+
:license:
|
426
|
+
:label: Hippocratic
|
427
|
+
:name: hippocratic
|
428
|
+
:version: 3.0
|
429
|
+
:project:
|
430
|
+
:url:
|
431
|
+
:community:
|
432
|
+
:conduct:
|
433
|
+
:contributions:
|
434
|
+
:download:
|
435
|
+
:home:
|
436
|
+
:issues:
|
437
|
+
:license:
|
438
|
+
:security:
|
439
|
+
:source:
|
440
|
+
:versions:
|
441
|
+
:version: 0.0.0
|
223
442
|
----
|
224
443
|
|
225
444
|
Feel free to take this default configuration, modify, and save as your own custom
|
226
445
|
`configuration.yml`.
|
227
446
|
|
447
|
+
By customizing your configuration, you can change Rubysmith's default behavior when building
|
448
|
+
projects. This is a great way to define your own specialized settings other than what is provide for
|
449
|
+
you by default. This is also a handy way to provide additional information needed for some of the
|
450
|
+
build options. I'll walk you through each section of the configuration so you can learn more.
|
451
|
+
|
228
452
|
==== Author
|
229
453
|
|
230
454
|
Author information is used when generating project documentation and is recommended you fill this
|
231
455
|
information in before building a project. Example:
|
232
456
|
|
233
457
|
:author:
|
234
|
-
:name: Jill Smith
|
235
458
|
:email: jsmith@example.com
|
459
|
+
:family_name: Smith
|
460
|
+
:given_name: Jill
|
236
461
|
:url: https://www.exmaple.com/team/jsmith
|
237
462
|
|
463
|
+
If your global link:https://git-scm.com[Git] configuration is properly configured, your given name;
|
464
|
+
family name; and email will be used by default. Should you not want to defer to Git, you can supply
|
465
|
+
custom values as desired. The URL is the only value that can't be automatically computed for you.
|
466
|
+
|
238
467
|
==== Build
|
239
468
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
`rubysmith --help`).
|
469
|
+
All build options accept booleans values only and can be customized as desired. When changing your
|
470
|
+
build options, they will dynamically render when display usage (i.e. `rubysmith --help`). All of
|
471
|
+
these options are explained in greater detail above.
|
244
472
|
|
245
|
-
====
|
473
|
+
==== Citations
|
246
474
|
|
247
|
-
|
248
|
-
|
249
|
-
|
475
|
+
This section allows you to configure your link:https://orcid.org[ORCiD]
|
476
|
+
link:https://citation-file-format.github.io[citation] information used by the research community.
|
477
|
+
You should definitely fill this in. Your author information, detailed above, will be used as well.
|
250
478
|
|
251
479
|
==== Documentation
|
252
480
|
|
253
|
-
|
481
|
+
Use this section to define the kind of documentation you want generated for your project. The
|
482
|
+
following options are available:
|
483
|
+
|
484
|
+
* `adoc` - Uses link:https://asciidoctor.org[ASCII Doc] format.
|
485
|
+
* `md` - Use link:https://asciidoctor.org[Markdown] format.
|
486
|
+
|
487
|
+
==== Extensions
|
488
|
+
|
489
|
+
Extensions are additional tooling which can be configured specifically for Rubysmith. The following
|
490
|
+
extensions are currently supported and will override each extensions global configuration should you
|
491
|
+
be using them individually for other purposes:
|
254
492
|
|
255
|
-
*
|
256
|
-
*
|
493
|
+
* link:https://www.alchemists.io/projects/milestoner[Milestoner]
|
494
|
+
* link:https://www.alchemists.io/projects/pragmater[Pragmater]
|
495
|
+
* link:https://www.alchemists.io/projects/tocer[Tocer]
|
257
496
|
|
258
|
-
|
497
|
+
Follow the above links to learn more about each extension's gem configuration.
|
259
498
|
|
260
499
|
==== GitHub
|
261
500
|
|
262
|
-
Your GitHub user is
|
263
|
-
|
264
|
-
|
265
|
-
|
501
|
+
Your GitHub user is the handle you setup when creating your GitHub account. This information is used
|
502
|
+
for documentation purposes and Circle CI badge association. If you don't define this information,
|
503
|
+
Rubysmith will automatically fallback to pulling this information from your Git configuration (i.e.
|
504
|
+
`github.user`). If all else fails, then nothing will be used.
|
505
|
+
|
506
|
+
==== License
|
507
|
+
|
508
|
+
Use this section to define the license you want to use for your project. The following kinds of
|
509
|
+
license are available:
|
510
|
+
|
511
|
+
* *Apache*: Use `apache` as the name and then supply the appropriate label and version.
|
512
|
+
* *Hippocratic*: Use `hippocratic` as the name and then supply the appropriate label and version.
|
513
|
+
* *MIT*: Use `mit` as the name and then supply the appropriate label and version.
|
514
|
+
|
515
|
+
==== Project
|
516
|
+
|
517
|
+
There are two categories within this section: URLs and version. The URLs allow you to link to
|
518
|
+
specific documentation related to your project. You'll definitely want to customize these as makes
|
519
|
+
sense since these URLs are used for documentation, citations, and general project information. You
|
520
|
+
can also use `%project_name%` as a placeholder anywhere in your URL and Rubysmith will ensure your
|
521
|
+
place holder is replaced with your project name when generating a new project. Example:
|
522
|
+
|
523
|
+
....
|
524
|
+
# Configuration
|
525
|
+
https://www.example.com/%project_name%
|
526
|
+
|
527
|
+
# Command
|
528
|
+
rubysmith --build demo
|
529
|
+
|
530
|
+
# Actual (computed result)
|
531
|
+
https://www.example.com/demo
|
532
|
+
....
|
533
|
+
|
534
|
+
As for the `version` key, this defines the default version of newly created projects. `0.0.0` is the
|
535
|
+
default but you can use a higher version number like `0.1.0` or even `1.0.0` if you are super
|
536
|
+
confident in your work. That said, the lower the number is better when building your initial
|
537
|
+
project.
|
266
538
|
|
267
539
|
== Development
|
268
540
|
|
@@ -291,32 +563,19 @@ To test, run:
|
|
291
563
|
bundle exec rake
|
292
564
|
----
|
293
565
|
|
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
|
566
|
+
== link:https://www.alchemists.io/policies/license[License]
|
308
567
|
|
309
|
-
|
568
|
+
== link:https://www.alchemists.io/policies/security[Security]
|
310
569
|
|
311
|
-
==
|
570
|
+
== link:https://www.alchemists.io/policies/code_of_conduct[Code of Conduct]
|
312
571
|
|
313
|
-
|
572
|
+
== link:https://www.alchemists.io/policies/contributions[Contributions]
|
314
573
|
|
315
|
-
==
|
574
|
+
== link:https://www.alchemists.io/projects/rubysmith/versions[Versions]
|
316
575
|
|
317
|
-
|
318
|
-
Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
|
576
|
+
== link:https://www.alchemists.io/community[Community]
|
319
577
|
|
320
578
|
== Credits
|
321
579
|
|
322
|
-
|
580
|
+
* Built with link:https://www.alchemists.io/projects/gemsmith[Gemsmith].
|
581
|
+
* Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
data/{bin → exe}/rubysmith
RENAMED
File without changes
|
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
|
@@ -88,7 +87,7 @@ module Rubysmith
|
|
88
87
|
|
89
88
|
def touch
|
90
89
|
logger.info "Touching: #{relative_build_path}"
|
91
|
-
build_path.
|
90
|
+
build_path.deep_touch
|
92
91
|
self
|
93
92
|
end
|
94
93
|
|
@@ -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
|