rubysmith 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -4
  3. data/README.adoc +88 -32
  4. data/lib/rubysmith/builders/bundler.rb +1 -1
  5. data/lib/rubysmith/builders/circle_ci.rb +26 -0
  6. data/lib/rubysmith/builders/documentation/change.rb +32 -0
  7. data/lib/rubysmith/builders/documentation/conduct.rb +32 -0
  8. data/lib/rubysmith/builders/documentation/contribution.rb +32 -0
  9. data/lib/rubysmith/builders/documentation/license.rb +36 -0
  10. data/lib/rubysmith/builders/documentation/readme.rb +44 -0
  11. data/lib/rubysmith/builders/git_hub.rb +34 -0
  12. data/lib/rubysmith/cli/actions/build.rb +7 -1
  13. data/lib/rubysmith/cli/configuration/content.rb +26 -7
  14. data/lib/rubysmith/cli/configuration/defaults.yml +13 -6
  15. data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +26 -0
  16. data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +33 -0
  17. data/lib/rubysmith/cli/configuration/enhancers/version.rb +26 -0
  18. data/lib/rubysmith/cli/configuration/loader.rb +13 -5
  19. data/lib/rubysmith/cli/parsers/build.rb +145 -21
  20. data/lib/rubysmith/cli/parsers/core.rb +1 -1
  21. data/lib/rubysmith/cli/shell.rb +4 -2
  22. data/lib/rubysmith/identity.rb +1 -1
  23. data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +31 -0
  24. data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +14 -0
  25. data/lib/rubysmith/templates/%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb +11 -0
  26. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +7 -4
  27. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +4 -0
  28. data/lib/rubysmith/templates/%project_name%/README.md.erb +3 -0
  29. data/lib/rubysmith.rb +4 -1
  30. data.tar.gz.sig +0 -0
  31. metadata +43 -3
  32. metadata.gz.sig +0 -0
  33. data/lib/rubysmith/builders/documentation.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa3e01ddcd6743f57757311a125d1e8ab39c44e09c1f1186a53b4a0ca6388d7d
4
- data.tar.gz: d0725b76c5829d64fbd5e648506ae2e57adbb9882e992b84bfddaa879f166a0b
3
+ metadata.gz: '0803a284b4191d1a3e08664747ddbb8bc743529a93d8d7f393b21dc0b488bead'
4
+ data.tar.gz: 1769e77743e2d90d262fc609dc0ca80a3b60f53400e977bde321d5b0b24e8e9a
5
5
  SHA512:
6
- metadata.gz: 1e14344b8a18601ef9e05ab3463491977eb81a62027dad1658a7cb1012f94f982296fe1981eea3bd90f35aa88668d3b553d3ef4bed5e77c7dddd060a8a2e444a
7
- data.tar.gz: 7b1d999af3527fdd1a182dc2405d19b852cfb93ab8d8c70fa2f1b1e5c3261daa8548d13966d062e266911817e53e394f20442c778c59aad4f89fe4b33402380a
6
+ metadata.gz: b1e9a371e502cb7f14359b2d9c9c4ead3703f2c02b70864e192a1a894a4e5e046e8146d8698edc4ea89570edba94e610b2108a7736ce13341fd08dcd858e705a
7
+ data.tar.gz: 297b580c0a5c44a53d705d3b27f1f3da6590cd067da2d36d7bbbd630f5debb03aea8bd37e858ec79038f3db25cbe5cd28ec5406a6bd7f389ef6877aafd68c455
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- �;��ݺ�a og%��?��}�N1ʜE�@�׀���E��F��W����@
2
- �T[ZvЎ��c*��!��9z�M_�!��$B�Do4N���E�G�����5�#���w% �#�d�`�me.縚�}WX��bJ�C$M�� �t7�$���qd��
3
- �P/�ߢ�h�=`�@�B��w,&zr�I���c�p1\=/�a Y�!^��h��Q�Z���1����Q
4
- �4)�`I������8.`�(
1
+ ��h0yO�rg���a�K��[2F��'�FcτY�ʵ>W5�QLJ }$�Dg���|:�P��ՈIS�62o-�F� S���e5� ۩9�.�:�3��K�]���6ؗ��.}m:)�V��d(2O������A6ޢ���$�qڶ��̋3��.D�^�:�W&���+�j'o�E�+�4��i1-)ߡk����b��C1����W�z?��تX<
2
+ U�G�8�ŜXa��p- (Y������� jB� �`�#
data/README.adoc CHANGED
@@ -30,8 +30,10 @@ toc::[]
30
30
  * Uses link:https://www.alchemists.io/projects/pragmater[Pragmater] for Ruby source pragma directives.
31
31
  * Supports link:https://github.com/amazing-print/amazing_print[Amazing Print].
32
32
  * Supports link:https://github.com/rubymem/bundler-leak[Bundler Leak].
33
+ * Supports link:https://circleci.com[Circle CI].
33
34
  * Supports link:https://github.com/ruby/debug[Debug].
34
35
  * Supports link:https://git-scm.com[Git].
36
+ * Supports link:https://github.com[GitHub].
35
37
  * Supports link:https://www.alchemists.io/projects/git-lint[Git Lint].
36
38
  * Supports link:https://github.com/guard/guard[Guard].
37
39
  * Supports link:https://github.com/ruby/rake[Rake].
@@ -48,8 +50,8 @@ toc::[]
48
50
  * Provides common documentation:
49
51
  ** README
50
52
  ** CHANGES
51
- ** CONTRIBUTING
52
53
  ** CODE OF CONDUCT
54
+ ** CONTRIBUTING
53
55
  ** LICENSE
54
56
 
55
57
  // == Screencasts
@@ -87,23 +89,30 @@ USAGE:
87
89
  -v, --version Show gem version.
88
90
 
89
91
  BUILD OPTIONS:
90
- --[no-]amazing_print Add Amazing Print.
91
- --[no-]bundler-leak Add Bundler Leak.
92
- --[no-]console Add console script.
93
- --[no-]debug Add Debug.
94
- --[no-]documentation Add documentation.
95
- --[no-]git Add Git.
96
- --[no-]git-lint Add Git Lint.
97
- --[no-]guard Add Guard.
98
- --min Use minimum/no options.
99
- --[no-]rake Add Rake.
100
- --[no-]reek Add Reek.
101
- --[no-]refinements Add Refinements.
102
- --[no-]rspec Add RSpec.
103
- --[no-]rubocop Add Rubocop.
104
- --[no-]setup Add setup script.
105
- --[no-]simple_cov Add SimpleCov.
106
- --[no-]zeitwerk Add Zeitwerk.
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.
107
116
  ....
108
117
 
109
118
  === Building
@@ -137,19 +146,20 @@ The above is essentially the same as building with _all_ options disabled. This
137
146
  situations where you need to quickly script something up for sharing with others yet still want to
138
147
  avoid using a Bundler Inline script so gem dependencies are not installed each time the code is run.
139
148
 
140
- As shown earlier, you can combine options but the order options can be handy in certain situations
141
- especially when used with the minimum build option. Example:
149
+ As shown earlier, you can combine options but be aware that order matters. Take the following, for
150
+ example, where both minimum and maximum options are used in conjunction with other options:
142
151
 
143
152
  [source,bash]
144
153
  ----
145
154
  rubysmith --build demo --min --zeitwerk
155
+ rubysmith --build demo --max --no-debug
146
156
  ----
147
157
 
148
- The above will disable _all_ options except for Zeitwerk which will be enabled in this situation.
149
- This can be a handy way to build a new project with all options disabled with only a few select
150
- options enabled. To have specific options enabled/disabled _every time_ you build a new Ruby
151
- project, you can edit your global configuration for making these settings permanent (see below for
152
- details).
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).
153
163
 
154
164
  === Configuration
155
165
 
@@ -160,9 +170,7 @@ $HOME/.config/rubysmith/configuration.yml
160
170
  ....
161
171
 
162
172
  It can also be configured via link:https://www.alchemists.io/projects/xdg[XDG] environment
163
- variables.
164
-
165
- The default configuration is as follows:
173
+ variables. The default configuration is as follows:
166
174
 
167
175
  [source,yaml]
168
176
  ----
@@ -170,20 +178,24 @@ The default configuration is as follows:
170
178
  :name:
171
179
  :email:
172
180
  :url:
173
- :documentation:
174
- :format: "md"
175
- :license: "mit"
176
181
  :build:
177
182
  :amazing_print: true
178
183
  :bundler_leak: true
184
+ :changes: true
185
+ :circle_ci: false
186
+ :conduct: true
179
187
  :console: true
188
+ :contributions: true
180
189
  :debug: true
181
- :documentation: true
182
190
  :git: true
191
+ :git_hub: false
183
192
  :git_lint: true
184
193
  :guard: true
194
+ :license: true
195
+ :maximum: false
185
196
  :minimum: false
186
197
  :rake: true
198
+ :readme: true
187
199
  :reek: true
188
200
  :refinements: true
189
201
  :rspec: true
@@ -203,11 +215,55 @@ The default configuration is as follows:
203
215
  - "**/*Gemfile"
204
216
  - "**/*Guardfile"
205
217
  - "**/*Rakefile"
218
+ :documentation:
219
+ :format: "md"
220
+ :license: "mit"
221
+ :git_hub:
222
+ :user:
206
223
  ----
207
224
 
208
225
  Feel free to take this default configuration, modify, and save as your own custom
209
226
  `configuration.yml`.
210
227
 
228
+ ==== Author
229
+
230
+ Author information is used when generating project documentation and is recommended you fill this
231
+ information in before building a project. Example:
232
+
233
+ :author:
234
+ :name: Jill Smith
235
+ :email: jsmith@example.com
236
+ :url: https://www.exmaple.com/team/jsmith
237
+
238
+ ==== Build
239
+
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`).
244
+
245
+ ==== Builders
246
+
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.
250
+
251
+ ==== Documentation
252
+
253
+ Documentation can be configured as follows:
254
+
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.
257
+
258
+ No other licenses are supported at this time but might be expanded up on in the future.
259
+
260
+ ==== GitHub
261
+
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.
266
+
211
267
  == Development
212
268
 
213
269
  To contribute, run:
@@ -25,7 +25,7 @@ module Rubysmith
25
25
  .replace(/\n\s+gem/, "\n gem")
26
26
  .replace(/ (?=.+(refinements|zeitwerk))/, "")
27
27
  .replace(/(\n+|\s+)end/, "\nend")
28
- .replace(/\n\ngroup :(code_quality|test|tools) do\nend/, "")
28
+ .replace(/\n\ngroup :(code_quality|development|test|tools) do\nend/, "")
29
29
  .replace(/org"\n+/, "org\"\n\n")
30
30
 
31
31
  configuration.project_root.change_dir { client.start %w[install --quiet] }
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubysmith
4
+ module Builders
5
+ # Builds project skeleton Circle CI configuration.
6
+ class CircleCI
7
+ def self.call(...) = new(...).call
8
+
9
+ def initialize configuration, builder: Builder
10
+ @configuration = configuration
11
+ @builder = builder
12
+ end
13
+
14
+ def call
15
+ return unless configuration.build_circle_ci
16
+
17
+ builder.call(configuration.with(template_path: "%project_name%/.circleci/config.yml.erb"))
18
+ .render
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :configuration, :builder
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tocer"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Documentation
8
+ # Builds project skeleton CHANGES documentation.
9
+ class Change
10
+ def self.call(...) = new(...).call
11
+
12
+ def initialize configuration, builder: Builder
13
+ @configuration = configuration
14
+ @builder = builder
15
+ end
16
+
17
+ def call
18
+ return unless configuration.build_changes
19
+
20
+ builder.call(configuration.with(template_path: "%project_name%/CHANGES.#{kind}.erb"))
21
+ .render
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder
27
+
28
+ def kind = configuration.documentation_format || "md"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tocer"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Documentation
8
+ # Builds project skeleton CODE_OF_CONDUCT documentation.
9
+ class Conduct
10
+ def self.call(...) = new(...).call
11
+
12
+ def initialize configuration, builder: Builder
13
+ @configuration = configuration
14
+ @builder = builder
15
+ end
16
+
17
+ def call
18
+ return unless configuration.build_conduct
19
+
20
+ configuration.with(template_path: "%project_name%/CODE_OF_CONDUCT.#{kind}.erb")
21
+ .then { |updated_configuration| builder.call(updated_configuration).render }
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder
27
+
28
+ def kind = configuration.documentation_format || "md"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tocer"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Documentation
8
+ # Builds project skeleton CONTRIBUTING documentation.
9
+ class Contribution
10
+ def self.call(...) = new(...).call
11
+
12
+ def initialize configuration, builder: Builder
13
+ @configuration = configuration
14
+ @builder = builder
15
+ end
16
+
17
+ def call
18
+ return unless configuration.build_contributions
19
+
20
+ builder.call(configuration.with(template_path: "%project_name%/CONTRIBUTING.#{kind}.erb"))
21
+ .render
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder
27
+
28
+ def kind = configuration.documentation_format || "md"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tocer"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Documentation
8
+ # Builds project skeleton LICENSE documentation.
9
+ class License
10
+ def self.call(...) = new(...).call
11
+
12
+ def initialize configuration, builder: Builder
13
+ @configuration = configuration
14
+ @builder = builder
15
+ end
16
+
17
+ def call
18
+ return unless configuration.build_license
19
+
20
+ configuration.with(template_path: "%project_name%/LICENSE-#{license}.#{kind}.erb")
21
+ .then do |updated_configuration|
22
+ builder.call(updated_configuration).render.rename "LICENSE.#{kind}"
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ attr_reader :configuration, :builder
29
+
30
+ def kind = configuration.documentation_format || "md"
31
+
32
+ def license = configuration.documentation_license || "mit"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tocer"
4
+
5
+ module Rubysmith
6
+ module Builders
7
+ module Documentation
8
+ # Builds project skeleton README documentation.
9
+ class Readme
10
+ def self.call(...) = new(...).call
11
+
12
+ def initialize configuration, builder: Builder, tocer: Tocer::Writer.new
13
+ @configuration = configuration
14
+ @builder = builder
15
+ @tocer = tocer
16
+ end
17
+
18
+ def call
19
+ return unless configuration.build_readme
20
+
21
+ private_methods.sort.grep(/render_/).each { |method| __send__ method }
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder, :tocer
27
+
28
+ def render_content
29
+ builder.call(configuration.with(template_path: "%project_name%/README.#{kind}.erb"))
30
+ .render
31
+ .replace("\n\n\n", "\n\n")
32
+ end
33
+
34
+ def render_table_of_contents
35
+ configuration.project_root
36
+ .join("README.md")
37
+ .then { |path| tocer.call path if path.exist? }
38
+ end
39
+
40
+ def kind = configuration.documentation_format || "md"
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubysmith
4
+ module Builders
5
+ # Builds project skeleton GitHub templates.
6
+ class GitHub
7
+ def self.call(...) = new(...).call
8
+
9
+ def initialize configuration, builder: Builder
10
+ @configuration = configuration
11
+ @builder = builder
12
+ end
13
+
14
+ def call
15
+ return unless configuration.build_git_hub
16
+
17
+ builder.call(with_issue_template).render
18
+ builder.call(with_pull_request_template).render
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :configuration, :builder
24
+
25
+ def with_issue_template
26
+ configuration.with template_path: "%project_name%/.github/ISSUE_TEMPLATE.md.erb"
27
+ end
28
+
29
+ def with_pull_request_template
30
+ configuration.with template_path: "%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb"
31
+ end
32
+ end
33
+ end
34
+ end
@@ -8,12 +8,18 @@ module Rubysmith
8
8
  # Order is important.
9
9
  BUILDERS = [
10
10
  Builders::Core,
11
- Builders::Documentation,
11
+ Builders::Documentation::Readme,
12
+ Builders::Documentation::Change,
13
+ Builders::Documentation::Conduct,
14
+ Builders::Documentation::Contribution,
15
+ Builders::Documentation::License,
12
16
  Builders::Git::Setup,
13
17
  Builders::Bundler,
14
18
  Builders::Rake,
15
19
  Builders::Console,
20
+ Builders::CircleCI,
16
21
  Builders::Setup,
22
+ Builders::GitHub,
17
23
  Builders::Guard,
18
24
  Builders::Reek,
19
25
  Builders::RSpec::Context,
@@ -17,14 +17,21 @@ module Rubysmith
17
17
  :author_url,
18
18
  :build_amazing_print,
19
19
  :build_bundler_leak,
20
+ :build_changes,
21
+ :build_circle_ci,
22
+ :build_conduct,
20
23
  :build_console,
24
+ :build_contributions,
21
25
  :build_debug,
22
- :build_documentation,
23
26
  :build_git,
27
+ :build_git_hub,
24
28
  :build_git_lint,
25
29
  :build_guard,
30
+ :build_license,
31
+ :build_maximum,
26
32
  :build_minimum,
27
33
  :build_rake,
34
+ :build_readme,
28
35
  :build_reek,
29
36
  :build_refinements,
30
37
  :build_rspec,
@@ -36,11 +43,13 @@ module Rubysmith
36
43
  :builders_pragmater_includes,
37
44
  :documentation_format,
38
45
  :documentation_license,
46
+ :git_hub_user,
39
47
  :now,
40
48
  :project_name,
41
49
  :target_root,
42
50
  :template_path,
43
51
  :template_root,
52
+ :version,
44
53
  keyword_init: true
45
54
  ) do
46
55
  using Refinements::Strings
@@ -54,12 +63,9 @@ module Rubysmith
54
63
 
55
64
  def with(attributes) = self.class.new(to_h.merge(attributes))
56
65
 
57
- def minimize
58
- to_h.except(:build_minimum)
59
- .select { |key, _value| key.start_with? "build_" }
60
- .each { |key, _value| self[key] = false }
61
- .then { self }
62
- end
66
+ def maximize = update_build_options(true)
67
+
68
+ def minimize = update_build_options(false)
63
69
 
64
70
  def project_label = project_name.titleize
65
71
 
@@ -69,9 +75,22 @@ module Rubysmith
69
75
 
70
76
  def project_path = project_name.snakecase
71
77
 
78
+ def ascii_doc? = documentation_format == "adoc"
79
+
80
+ def markdown? = documentation_format == "md"
81
+
72
82
  def to_pathway
73
83
  Pathway[start_root: template_root, start_path: template_path, end_root: target_root]
74
84
  end
85
+
86
+ private
87
+
88
+ def update_build_options value
89
+ to_h.except(:build_minimum)
90
+ .select { |key, _value| key.start_with? "build_" }
91
+ .each { |key, _value| self[key] = value }
92
+ .then { self }
93
+ end
75
94
  end
76
95
  end
77
96
  end
@@ -1,23 +1,25 @@
1
- :project:
2
- :name:
3
1
  :author:
4
2
  :name:
5
3
  :email:
6
4
  :url:
7
- :documentation:
8
- :format: "md"
9
- :license: "mit"
10
5
  :build:
11
6
  :amazing_print: true
12
7
  :bundler_leak: true
8
+ :changes: true
9
+ :circle_ci: false
10
+ :conduct: true
13
11
  :console: true
12
+ :contributions: true
14
13
  :debug: true
15
- :documentation: true
16
14
  :git: true
15
+ :git_hub: false
17
16
  :git_lint: true
18
17
  :guard: true
18
+ :license: true
19
+ :maximum: false
19
20
  :minimum: false
20
21
  :rake: true
22
+ :readme: true
21
23
  :reek: true
22
24
  :refinements: true
23
25
  :rspec: true
@@ -37,3 +39,8 @@
37
39
  - "**/*Gemfile"
38
40
  - "**/*Guardfile"
39
41
  - "**/*Rakefile"
42
+ :documentation:
43
+ :format: "md"
44
+ :license: "mit"
45
+ :git_hub:
46
+ :user:
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/structs"
4
+
5
+ module Rubysmith
6
+ module CLI
7
+ module Configuration
8
+ module Enhancers
9
+ # Adds current time to content.
10
+ class CurrentTime
11
+ using Refinements::Structs
12
+
13
+ def initialize now = Time.now
14
+ @now = now
15
+ end
16
+
17
+ def call(content) = content.merge(now: now)
18
+
19
+ private
20
+
21
+ attr_reader :now
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "git_plus"
4
+ require "refinements/strings"
5
+ require "refinements/structs"
6
+
7
+ module Rubysmith
8
+ module CLI
9
+ module Configuration
10
+ module Enhancers
11
+ # Dynamically adds GitHub user if user is defined.
12
+ class GitHubUser
13
+ using Refinements::Strings
14
+ using Refinements::Structs
15
+
16
+ def initialize repository: GitPlus::Repository.new
17
+ @repository = repository
18
+ end
19
+
20
+ def call content
21
+ String(content.git_hub_user).blank? ? content.merge(git_hub_user: user) : content
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :repository
27
+
28
+ def user = repository.config_get("github.user")
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/structs"
4
+
5
+ module Rubysmith
6
+ module CLI
7
+ module Configuration
8
+ module Enhancers
9
+ # Adds this gem's version to content.
10
+ class Version
11
+ using Refinements::Structs
12
+
13
+ def initialize version = Identity::VERSION_LABEL
14
+ @version = version
15
+ end
16
+
17
+ def call(content) = content.merge(version: version)
18
+
19
+ private
20
+
21
+ attr_reader :version
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -17,21 +17,29 @@ module Rubysmith
17
17
  DEFAULTS = YAML.load_file(Pathname(__dir__).join("defaults.yml")).freeze
18
18
  CLIENT = Runcom::Config.new "#{Identity::NAME}/configuration.yml", defaults: DEFAULTS
19
19
 
20
+ ENHANCERS = [
21
+ Enhancers::GitHubUser.new,
22
+ Enhancers::CurrentTime.new,
23
+ Enhancers::Version.new
24
+ ].freeze
25
+
20
26
  def self.call(...) = new(...).call
21
27
 
22
- def self.with_defaults(now: Time.now) = new(now: now, client: DEFAULTS)
28
+ def self.with_defaults = new(client: DEFAULTS, enhancers: [])
23
29
 
24
- def initialize now: Time.now, content: Content.new, client: CLIENT
25
- @now = now
30
+ def initialize content: Content.new, client: CLIENT, enhancers: ENHANCERS
26
31
  @content = content
27
32
  @client = client
33
+ @enhancers = enhancers
28
34
  end
29
35
 
30
- def call = content.merge(**client.to_h.flatten_keys, now: now)
36
+ def call = enhancers.reduce(preload_content) { |preload, enhancer| enhancer.call preload }
31
37
 
32
38
  private
33
39
 
34
- attr_reader :now, :content, :client
40
+ attr_reader :content, :client, :enhancers
41
+
42
+ def preload_content = content.merge(**client.to_h.flatten_keys)
35
43
  end
36
44
  end
37
45
  end
@@ -23,108 +23,232 @@ module Rubysmith
23
23
  attr_reader :client, :container
24
24
 
25
25
  def add_amazing_print
26
- client.on "--[no-]amazing_print", "Add Amazing Print." do |value|
26
+ client.on(
27
+ "--[no-]amazing_print",
28
+ "Add Amazing Print gem. #{default __method__}."
29
+ ) do |value|
27
30
  configuration.build_amazing_print = value
28
31
  end
29
32
  end
30
33
 
31
34
  def add_bundler_leak
32
- client.on "--[no-]bundler-leak", "Add Bundler Leak." do |value|
35
+ client.on(
36
+ "--[no-]bundler-leak",
37
+ "Add Bundler Leak gem. #{default __method__}."
38
+ ) do |value|
33
39
  configuration.build_bundler_leak = value
34
40
  end
35
41
  end
36
42
 
43
+ def add_changes
44
+ client.on(
45
+ "--[no-]changes",
46
+ "Add CHANGES documentation. #{default __method__}."
47
+ ) do |value|
48
+ configuration.build_changes = value
49
+ end
50
+ end
51
+
37
52
  def add_console
38
- client.on "--[no-]console", "Add console script." do |value|
53
+ client.on(
54
+ "--[no-]console",
55
+ "Add console script. #{default __method__}."
56
+ ) do |value|
39
57
  configuration.build_console = value
40
58
  end
41
59
  end
42
60
 
43
- def add_debug
44
- client.on "--[no-]debug", "Add Debug." do |value|
45
- configuration.build_debug = value
61
+ def add_contributions
62
+ client.on(
63
+ "--[no-]contributions",
64
+ "Add CONTRIBUTING documentation. #{default __method__}."
65
+ ) do |value|
66
+ configuration.build_contributions = value
67
+ end
68
+ end
69
+
70
+ def add_circle_ci
71
+ client.on(
72
+ "--[no-]circle_ci",
73
+ "Add Circle CI configuration and badge. #{default __method__}."
74
+ ) do |value|
75
+ configuration.build_circle_ci = value
46
76
  end
47
77
  end
48
78
 
49
- def add_documentation
50
- client.on "--[no-]documentation", "Add documentation." do |value|
51
- configuration.build_documentation = value
79
+ def add_conduct
80
+ client.on(
81
+ "--[no-]conduct",
82
+ "Add CODE_OF_CONDUCT documentation. #{default __method__}."
83
+ ) do |value|
84
+ configuration.build_conduct = value
85
+ end
86
+ end
87
+
88
+ def add_debug
89
+ client.on(
90
+ "--[no-]debug",
91
+ "Add Debug gem. #{default __method__}."
92
+ ) do |value|
93
+ configuration.build_debug = value
52
94
  end
53
95
  end
54
96
 
55
97
  def add_git
56
- client.on "--[no-]git", "Add Git." do |value|
98
+ client.on(
99
+ "--[no-]git",
100
+ "Add Git. #{default __method__}."
101
+ ) do |value|
57
102
  configuration.build_git = value
58
103
  end
59
104
  end
60
105
 
106
+ def add_git_hub
107
+ client.on(
108
+ "--[no-]git_hub",
109
+ "Add GitHub templates. #{default __method__}."
110
+ ) do |value|
111
+ configuration.build_git_hub = value
112
+ end
113
+ end
114
+
61
115
  def add_git_lint
62
- client.on "--[no-]git-lint", "Add Git Lint." do |value|
116
+ client.on(
117
+ "--[no-]git-lint",
118
+ "Add Git Lint gem. #{default __method__}."
119
+ ) do |value|
63
120
  configuration.build_git_lint = value
64
121
  end
65
122
  end
66
123
 
67
124
  def add_guard
68
- client.on "--[no-]guard", "Add Guard." do |value|
125
+ client.on(
126
+ "--[no-]guard",
127
+ "Add Guard gem. #{default __method__}."
128
+ ) do |value|
69
129
  configuration.build_guard = value
70
130
  end
71
131
  end
72
132
 
133
+ def add_license
134
+ client.on(
135
+ "--[no-]license",
136
+ "Add LICENSE documentation. #{default __method__}."
137
+ ) do |value|
138
+ configuration.build_license = value
139
+ end
140
+ end
141
+
142
+ def add_maximum
143
+ client.on(
144
+ "--max",
145
+ "Use maximum/enabled options. #{default __method__}."
146
+ ) do |value|
147
+ configuration.maximize.build_maximum = value
148
+ end
149
+ end
150
+
73
151
  def add_minimum
74
- client.on "--min", "Use minimum/no options." do |value|
152
+ client.on(
153
+ "--min",
154
+ "Use minimum/disabled options. #{default __method__}."
155
+ ) do |value|
75
156
  configuration.minimize.build_minimum = value
76
157
  end
77
158
  end
78
159
 
79
160
  def add_rake
80
- client.on "--[no-]rake", "Add Rake." do |value|
161
+ client.on(
162
+ "--[no-]rake",
163
+ "Add Rake gem. #{default __method__}."
164
+ ) do |value|
81
165
  configuration.build_rake = value
82
166
  end
83
167
  end
84
168
 
169
+ def add_readme
170
+ client.on(
171
+ "--[no-]readme",
172
+ "Add README documentation. #{default __method__}."
173
+ ) do |value|
174
+ configuration.build_readme = value
175
+ end
176
+ end
177
+
85
178
  def add_reek
86
- client.on "--[no-]reek", "Add Reek." do |value|
179
+ client.on(
180
+ "--[no-]reek",
181
+ "Add Reek gem. #{default __method__}."
182
+ ) do |value|
87
183
  configuration.build_reek = value
88
184
  end
89
185
  end
90
186
 
91
187
  def add_refinements
92
- client.on "--[no-]refinements", "Add Refinements." do |value|
188
+ client.on(
189
+ "--[no-]refinements",
190
+ "Add Refinements gem. #{default __method__}."
191
+ ) do |value|
93
192
  configuration.build_refinements = value
94
193
  end
95
194
  end
96
195
 
97
196
  def add_rspec
98
- client.on "--[no-]rspec", "Add RSpec." do |value|
197
+ client.on(
198
+ "--[no-]rspec",
199
+ "Add RSpec gem. #{default __method__}."
200
+ ) do |value|
99
201
  configuration.build_rspec = value
100
202
  end
101
203
  end
102
204
 
103
205
  def add_rubocop
104
- client.on "--[no-]rubocop", "Add Rubocop." do |value|
206
+ client.on(
207
+ "--[no-]rubocop",
208
+ "Add Rubocop gems. #{default __method__}."
209
+ ) do |value|
105
210
  configuration.build_rubocop = value
106
211
  end
107
212
  end
108
213
 
109
214
  def add_setup
110
- client.on "--[no-]setup", "Add setup script." do |value|
215
+ client.on(
216
+ "--[no-]setup",
217
+ "Add setup script. #{default __method__}."
218
+ ) do |value|
111
219
  configuration.build_setup = value
112
220
  end
113
221
  end
114
222
 
115
223
  def add_simple_cov
116
- client.on "--[no-]simple_cov", "Add SimpleCov." do |value|
224
+ client.on(
225
+ "--[no-]simple_cov",
226
+ "Add SimpleCov gem. #{default __method__}."
227
+ ) do |value|
117
228
  configuration.build_simple_cov = value
118
229
  end
119
230
  end
120
231
 
121
232
  def add_zeitwerk
122
- client.on "--[no-]zeitwerk", "Add Zeitwerk." do |value|
233
+ client.on(
234
+ "--[no-]zeitwerk",
235
+ "Add Zeitwerk gem. #{default __method__}."
236
+ ) do |value|
123
237
  configuration.build_zeitwerk = value
124
238
  end
125
239
  end
126
240
 
241
+ def default option
242
+ option.to_s
243
+ .sub("add_", "build_")
244
+ .then { |attribute| configuration.public_send attribute }
245
+ .then { |boolean| boolean ? colorizer.green(boolean) : colorizer.red(boolean) }
246
+ .then { |colored_boolean| "Default: #{colored_boolean}" }
247
+ end
248
+
127
249
  def configuration = container[__method__]
250
+
251
+ def colorizer = container[__method__]
128
252
  end
129
253
  end
130
254
  end
@@ -47,7 +47,7 @@ module Rubysmith
47
47
 
48
48
  def add_version
49
49
  client.on "-v", "--version", "Show gem version." do
50
- configuration.action_version = Identity::VERSION_LABEL
50
+ configuration.action_version = true
51
51
  end
52
52
  end
53
53
 
@@ -16,7 +16,7 @@ module Rubysmith
16
16
  case parse arguments
17
17
  in action_config: Symbol => action then config action
18
18
  in action_build: true then build
19
- in action_version: String => version then puts version
19
+ in action_version: true then logger.info configuration.version
20
20
  else usage
21
21
  end
22
22
  end
@@ -28,7 +28,7 @@ module Rubysmith
28
28
  def parse arguments = []
29
29
  parser.call arguments
30
30
  rescue StandardError => error
31
- puts error.message
31
+ logger.error error.message
32
32
  end
33
33
 
34
34
  def config(action) = actions.fetch(__method__).call(action)
@@ -37,6 +37,8 @@ module Rubysmith
37
37
 
38
38
  def usage = logger.unknown(parser.to_s)
39
39
 
40
+ def configuration = container[__method__]
41
+
40
42
  def logger = container[__method__]
41
43
  end
42
44
  end
@@ -4,7 +4,7 @@ module Rubysmith
4
4
  module Identity
5
5
  NAME = "rubysmith"
6
6
  LABEL = "Rubysmith"
7
- VERSION = "0.13.0"
7
+ VERSION = "0.14.0"
8
8
  VERSION_LABEL = "#{LABEL} #{VERSION}".freeze
9
9
  SUMMARY = "A command line interface for smithing Ruby projects."
10
10
  end
@@ -0,0 +1,31 @@
1
+ version: 2.1
2
+ jobs:
3
+ build:
4
+ working_directory: ~/project
5
+ docker:
6
+ - image: bkuhlmann/alpine-ruby:latest
7
+ steps:
8
+ - checkout
9
+
10
+ - restore_cache:
11
+ name: Bundler Restore
12
+ keys:
13
+ - gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
14
+ - gem-cache-
15
+
16
+ - run:
17
+ name: Bundler Install
18
+ command: |
19
+ gem update --system
20
+ bundle config set path "vendor/bundle"
21
+ bundle install
22
+
23
+ - save_cache:
24
+ name: Bundler Store
25
+ key: gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
26
+ paths:
27
+ - vendor/bundle
28
+
29
+ - run:
30
+ name: Build
31
+ command: bundle exec rake
@@ -0,0 +1,14 @@
1
+ ## Overview
2
+ <!-- Required. Describe, briefly, the behavior experienced. -->
3
+
4
+ ## Screenshots/Screencasts
5
+ <!-- Optional. Attach screenshot(s) and/or screencast(s) that demo the behavior. -->
6
+
7
+ ## Steps to Recreate
8
+ <!-- Required. List exact steps (numbered list) to reproduce errant behavior. -->
9
+
10
+ ## Desired Behavior
11
+ <!-- Required. Describe the behavior you'd like to see or your idea of a proposed solution. -->
12
+
13
+ ## Environment
14
+ <!-- Required. What is your operating system, software version(s), etc. -->
@@ -0,0 +1,11 @@
1
+ ## Overview
2
+ <!-- Required. Why is this important/necessary and what is the overarching architecture. -->
3
+
4
+ ## Screenshots/Screencasts
5
+ <!-- Optional. Provide supporting image/video. -->
6
+
7
+ ## Details
8
+ <!-- Optional. List the key features/highlights as bullet points. -->
9
+
10
+ ## Notes
11
+ <!-- Optional. List additional notes/references as bullet points. -->
@@ -32,11 +32,14 @@ group :code_quality do
32
32
  <% end %>
33
33
  end
34
34
 
35
- <% if configuration.build_rake %>
36
- group :development do
35
+ group :development do
36
+ <% if configuration.build_rake %>
37
37
  gem "rake", "~> 13.0"
38
- end
39
- <% end %>
38
+ <% end %>
39
+ <% if configuration.markdown? %>
40
+ gem "tocer", "~> 12.0"
41
+ <% end %>
42
+ end
40
43
 
41
44
  group :test do
42
45
  <% if configuration.build_guard %>
@@ -8,6 +8,10 @@
8
8
  [link=https://www.alchemists.io/projects/code_quality]
9
9
  image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
10
10
  <% end %>
11
+ <% if configuration.build_circle_ci %>
12
+ [link=https://circleci.com/gh/<%= configuration.git_hub_user %>/<%= configuration.project_name %>]
13
+ image::https://circleci.com/gh/<%= configuration.git_hub_user %>/<%= configuration.project_name %>.svg?style=svg[Circle CI Status]
14
+ <% end %>
11
15
 
12
16
  toc::[]
13
17
 
@@ -3,6 +3,9 @@
3
3
  <% if configuration.build_rubocop %>
4
4
  [![Alchemists Style Guide](https://img.shields.io/badge/code_style-alchemists-brightgreen.svg)](https://www.alchemists.io/projects/code_quality)
5
5
  <% end %>
6
+ <% if configuration.build_circle_ci %>
7
+ [![Circle CI Status](https://circleci.com/gh/<%= configuration.git_hub_user %>/<%= configuration.project_name %>.svg?style=svg)](https://circleci.com/gh/<%= configuration.git_hub_user %>/<%= configuration.project_name %>)
8
+ <% end %>
6
9
 
7
10
  <!-- Tocer[start]: Auto-generated, don't remove. -->
8
11
  <!-- Tocer[finish]: Auto-generated, don't remove. -->
data/lib/rubysmith.rb CHANGED
@@ -3,7 +3,10 @@
3
3
  require "zeitwerk"
4
4
 
5
5
  Zeitwerk::Loader.for_gem.then do |loader|
6
- loader.inflector.inflect "cli" => "CLI", "erb" => "ERB", "rspec" => "RSpec"
6
+ loader.inflector.inflect "cli" => "CLI",
7
+ "circle_ci" => "CircleCI",
8
+ "erb" => "ERB",
9
+ "rspec" => "RSpec"
7
10
  loader.setup
8
11
  end
9
12
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2021-09-16 00:00:00.000000000 Z
31
+ date: 2021-09-19 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dry-container
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.9'
47
+ - !ruby/object:Gem::Dependency
48
+ name: git_plus
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.6'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '0.6'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: pastel
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +128,20 @@ dependencies:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
130
  version: '7.0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: tocer
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '12.0'
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '12.0'
117
145
  - !ruby/object:Gem::Dependency
118
146
  name: zeitwerk
119
147
  requirement: !ruby/object:Gem::Requirement
@@ -144,11 +172,17 @@ files:
144
172
  - lib/rubysmith.rb
145
173
  - lib/rubysmith/builder.rb
146
174
  - lib/rubysmith/builders/bundler.rb
175
+ - lib/rubysmith/builders/circle_ci.rb
147
176
  - lib/rubysmith/builders/console.rb
148
177
  - lib/rubysmith/builders/core.rb
149
- - lib/rubysmith/builders/documentation.rb
178
+ - lib/rubysmith/builders/documentation/change.rb
179
+ - lib/rubysmith/builders/documentation/conduct.rb
180
+ - lib/rubysmith/builders/documentation/contribution.rb
181
+ - lib/rubysmith/builders/documentation/license.rb
182
+ - lib/rubysmith/builders/documentation/readme.rb
150
183
  - lib/rubysmith/builders/git/commit.rb
151
184
  - lib/rubysmith/builders/git/setup.rb
185
+ - lib/rubysmith/builders/git_hub.rb
152
186
  - lib/rubysmith/builders/guard.rb
153
187
  - lib/rubysmith/builders/pragma.rb
154
188
  - lib/rubysmith/builders/rake.rb
@@ -162,6 +196,9 @@ files:
162
196
  - lib/rubysmith/cli/actions/config.rb
163
197
  - lib/rubysmith/cli/configuration/content.rb
164
198
  - lib/rubysmith/cli/configuration/defaults.yml
199
+ - lib/rubysmith/cli/configuration/enhancers/current_time.rb
200
+ - lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb
201
+ - lib/rubysmith/cli/configuration/enhancers/version.rb
165
202
  - lib/rubysmith/cli/configuration/loader.rb
166
203
  - lib/rubysmith/cli/parsers.rb
167
204
  - lib/rubysmith/cli/parsers/assembler.rb
@@ -173,6 +210,9 @@ files:
173
210
  - lib/rubysmith/pathway.rb
174
211
  - lib/rubysmith/renderers/erb.rb
175
212
  - lib/rubysmith/renderers/namespace.rb
213
+ - lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb
214
+ - lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb
215
+ - lib/rubysmith/templates/%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb
176
216
  - lib/rubysmith/templates/%project_name%/.reek.yml.erb
177
217
  - lib/rubysmith/templates/%project_name%/.rubocop.yml.erb
178
218
  - lib/rubysmith/templates/%project_name%/.ruby-version.erb
metadata.gz.sig CHANGED
Binary file
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rubysmith
4
- module Builders
5
- # Builds project skeleton documentation.
6
- class Documentation
7
- def self.call(...) = new(...).call
8
-
9
- def initialize configuration, builder: Builder
10
- @configuration = configuration
11
- @builder = builder
12
- end
13
-
14
- def call
15
- return unless configuration.build_documentation
16
-
17
- private_methods.sort.grep(/render_/).each { |method| __send__ method }
18
- end
19
-
20
- private
21
-
22
- attr_reader :configuration, :builder
23
-
24
- def render_changes
25
- builder.call(configuration.with(template_path: "%project_name%/CHANGES.#{kind}.erb"))
26
- .render
27
- end
28
-
29
- def render_conduct
30
- configuration.with(template_path: "%project_name%/CODE_OF_CONDUCT.#{kind}.erb")
31
- .then { |updated_configuration| builder.call(updated_configuration).render }
32
- end
33
-
34
- def render_contributions
35
- builder.call(configuration.with(template_path: "%project_name%/CONTRIBUTING.#{kind}.erb"))
36
- .render
37
- end
38
-
39
- def render_license
40
- configuration.with(template_path: "%project_name%/LICENSE-#{license}.#{kind}.erb")
41
- .then do |updated_configuration|
42
- builder.call(updated_configuration).render.rename "LICENSE.#{kind}"
43
- end
44
- end
45
-
46
- def render_readme
47
- builder.call(configuration.with(template_path: "%project_name%/README.#{kind}.erb"))
48
- .render
49
- .replace("\n\n\n", "\n\n")
50
- end
51
-
52
- def kind = configuration.documentation_format || "md"
53
-
54
- def license = configuration.documentation_license || "mit"
55
- end
56
- end
57
- end