rubysmith 0.11.0 → 0.15.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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +109 -36
  4. data/lib/rubysmith/builder.rb +11 -14
  5. data/lib/rubysmith/builders/bundler.rb +3 -3
  6. data/lib/rubysmith/builders/{ruby_critic.rb → circle_ci.rb} +6 -5
  7. data/lib/rubysmith/builders/console.rb +1 -1
  8. data/lib/rubysmith/builders/core.rb +6 -2
  9. data/lib/rubysmith/builders/documentation/change.rb +32 -0
  10. data/lib/rubysmith/builders/documentation/conduct.rb +32 -0
  11. data/lib/rubysmith/builders/documentation/contribution.rb +32 -0
  12. data/lib/rubysmith/builders/documentation/license.rb +36 -0
  13. data/lib/rubysmith/builders/documentation/readme.rb +44 -0
  14. data/lib/rubysmith/builders/git/commit.rb +1 -1
  15. data/lib/rubysmith/builders/git/setup.rb +1 -1
  16. data/lib/rubysmith/builders/git_hub.rb +34 -0
  17. data/lib/rubysmith/builders/guard.rb +1 -1
  18. data/lib/rubysmith/builders/pragma.rb +1 -1
  19. data/lib/rubysmith/builders/rake.rb +3 -1
  20. data/lib/rubysmith/builders/reek.rb +1 -1
  21. data/lib/rubysmith/builders/rspec/context.rb +1 -1
  22. data/lib/rubysmith/builders/rspec/helper.rb +1 -1
  23. data/lib/rubysmith/builders/rubocop/formatter.rb +1 -1
  24. data/lib/rubysmith/builders/rubocop/setup.rb +1 -1
  25. data/lib/rubysmith/builders/setup.rb +1 -1
  26. data/lib/rubysmith/cli/actions/build.rb +48 -0
  27. data/lib/rubysmith/cli/actions/config.rb +33 -0
  28. data/lib/rubysmith/cli/configuration/content.rb +47 -18
  29. data/lib/rubysmith/cli/configuration/defaults.yml +16 -8
  30. data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +26 -0
  31. data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +33 -0
  32. data/lib/rubysmith/cli/configuration/enhancers/version.rb +26 -0
  33. data/lib/rubysmith/cli/configuration/loader.rb +15 -4
  34. data/lib/rubysmith/cli/parsers/assembler.rb +7 -9
  35. data/lib/rubysmith/cli/parsers/build.rb +176 -45
  36. data/lib/rubysmith/cli/parsers/core.rb +14 -9
  37. data/lib/rubysmith/cli/shell.rb +16 -27
  38. data/lib/rubysmith/container.rb +37 -0
  39. data/lib/rubysmith/identity.rb +2 -2
  40. data/lib/rubysmith/renderers/erb.rb +1 -1
  41. data/lib/rubysmith/renderers/namespace.rb +2 -2
  42. data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +31 -0
  43. data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +14 -0
  44. data/lib/rubysmith/templates/%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb +11 -0
  45. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +51 -49
  46. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +4 -0
  47. data/lib/rubysmith/templates/%project_name%/README.md.erb +3 -0
  48. data/lib/rubysmith/templates/%project_name%/Rakefile.erb +1 -7
  49. data/lib/rubysmith/templates/%project_name%/bin/console.erb +1 -1
  50. data/lib/rubysmith/templates/%project_name%/lib/%project_path%.rb.erb +12 -0
  51. data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +1 -4
  52. data/lib/rubysmith.rb +13 -31
  53. data.tar.gz.sig +0 -0
  54. metadata +94 -13
  55. metadata.gz.sig +0 -0
  56. data/lib/rubysmith/builders/documentation.rb +0 -57
  57. data/lib/rubysmith/cli/processors/build.rb +0 -57
  58. data/lib/rubysmith/cli/processors/config.rb +0 -31
  59. data/lib/rubysmith/templates/%project_name%/.rubycritic.yml.erb +0 -3
  60. data/lib/rubysmith/templates/%project_name%/lib/%project_name%.rb.erb +0 -3
@@ -2,57 +2,59 @@ ruby File.read(".ruby-version").strip
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- <% unless configuration.build_minimum %>
6
- <% if configuration.build_refinements %>
7
- gem "refinements", "~> 8.0"
8
- <% end %>
5
+ <% if configuration.build_refinements %>
6
+ gem "refinements", "~> 8.4"
7
+ <% end %>
8
+ <% if configuration.build_zeitwerk %>
9
+ gem "zeitwerk", "~> 2.4"
10
+ <% end %>
9
11
 
10
- group :code_quality do
11
- <% if configuration.build_bundler_leak %>
12
- gem "bundler-leak", "~> 0.2"
13
- <% end %>
14
- <% if configuration.build_git && configuration.build_git_lint %>
15
- gem "git-lint", "~> 2.0"
16
- <% end %>
17
- <% if configuration.build_reek %>
18
- gem "reek", "~> 6.0"
19
- <% end %>
20
- <% if configuration.build_rubocop %>
21
- gem "rubocop", "~> 1.14"
22
- gem "rubocop-performance", "~> 1.9"
23
- gem "rubocop-rake", "~> 0.5"
24
- <% end %>
25
- <% if configuration.build_rspec && configuration.build_rubocop %>
26
- gem "rubocop-rspec", "~> 2.0"
27
- <% end %>
28
- <% if configuration.build_ruby_critic %>
29
- gem "rubycritic", "~> 4.5", require: false
30
- <% end %>
31
- <% if configuration.build_simple_cov %>
32
- gem "simplecov", "~> 0.20"
33
- <% end %>
34
- end
12
+ group :code_quality do
13
+ <% if configuration.build_bundler_leak %>
14
+ gem "bundler-leak", "~> 0.2"
15
+ <% end %>
16
+ <% if configuration.build_git && configuration.build_git_lint %>
17
+ gem "git-lint", "~> 2.0"
18
+ <% end %>
19
+ <% if configuration.build_reek %>
20
+ gem "reek", "~> 6.0"
21
+ <% end %>
22
+ <% if configuration.build_rubocop %>
23
+ gem "rubocop", "~> 1.20"
24
+ gem "rubocop-performance", "~> 1.11"
25
+ gem "rubocop-rake", "~> 0.6"
26
+ <% end %>
27
+ <% if configuration.build_rspec && configuration.build_rubocop %>
28
+ gem "rubocop-rspec", "~> 2.4"
29
+ <% end %>
30
+ <% if configuration.build_simple_cov %>
31
+ gem "simplecov", "~> 0.20"
32
+ <% end %>
33
+ end
35
34
 
36
- group :development do
35
+ group :development do
36
+ <% if configuration.build_rake %>
37
37
  gem "rake", "~> 13.0"
38
- end
38
+ <% end %>
39
+ <% if configuration.markdown? %>
40
+ gem "tocer", "~> 12.1"
41
+ <% end %>
42
+ end
39
43
 
40
- group :test do
41
- <% if configuration.build_guard %>
42
- gem "guard-rspec", "~> 4.7", require: false
43
- <% end %>
44
- <% if configuration.build_rspec %>
45
- gem "rspec", "~> 3.10"
46
- <% end %>
47
- end
44
+ group :test do
45
+ <% if configuration.build_guard %>
46
+ gem "guard-rspec", "~> 4.7", require: false
47
+ <% end %>
48
+ <% if configuration.build_rspec %>
49
+ gem "rspec", "~> 3.10"
50
+ <% end %>
51
+ end
48
52
 
49
- group :tools do
50
- <% if configuration.build_amazing_print %>
51
- gem "amazing_print", "~> 1.2"
52
- <% end %>
53
- <% if configuration.build_pry %>
54
- gem "pry", "~> 0.13"
55
- gem "pry-byebug", "~> 3.9"
56
- <% end %>
57
- end
58
- <% end %>
53
+ group :tools do
54
+ <% if configuration.build_amazing_print %>
55
+ gem "amazing_print", "~> 1.3"
56
+ <% end %>
57
+ <% if configuration.build_debug %>
58
+ gem "debug", "~> 1.1"
59
+ <% end %>
60
+ end
@@ -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. -->
@@ -15,9 +15,6 @@ require "bundler/setup"
15
15
  <% if configuration.build_rubocop %>
16
16
  require "rubocop/rake_task"
17
17
  <% end %>
18
- <% if configuration.build_ruby_critic %>
19
- require "rubycritic/rake_task"
20
- <% end %>
21
18
 
22
19
  <% if configuration.build_bundler_leak %>
23
20
  Bundler::Plumber::Task.new
@@ -31,11 +28,8 @@ require "bundler/setup"
31
28
  <% if configuration.build_rubocop %>
32
29
  RuboCop::RakeTask.new
33
30
  <% end %>
34
- <% if configuration.build_ruby_critic %>
35
- RubyCritic::RakeTask.new
36
- <% end %>
37
31
 
38
32
  desc "Run code quality checks"
39
- task code_quality: %i[<% if configuration.build_bundler_leak %>bundle:leak<% end %> <% if configuration.build_git && configuration.build_git_lint %>git_lint<% end %> <% if configuration.build_reek %>reek<% end %> <% if configuration.build_rubocop %>rubocop<% end %> <% if configuration.build_ruby_critic %>rubycritic<% end %>]
33
+ task code_quality: %i[<% if configuration.build_bundler_leak %>bundle:leak<% end %> <% if configuration.build_git && configuration.build_git_lint %>git_lint<% end %> <% if configuration.build_reek %>reek<% end %> <% if configuration.build_rubocop %>rubocop<% end %>]
40
34
 
41
35
  task default: %i[code_quality <% if configuration.build_rspec %>spec<% end %>]
@@ -3,7 +3,7 @@
3
3
  require "bundler/setup"
4
4
  Bundler.require :tools
5
5
 
6
- require_relative "../lib/<%= configuration.project_name %>"
6
+ require_relative "../lib/<%= configuration.project_path %>"
7
7
  require "irb"
8
8
 
9
9
  IRB.start __FILE__
@@ -0,0 +1,12 @@
1
+ <% if configuration.build_zeitwerk %>
2
+ require "zeitwerk"
3
+ <% if configuration.project_path.include? "/" %>
4
+ Zeitwerk::Loader.new
5
+ .tap { |loader| loader.push_dir "#{__dir__}/.." }
6
+ .setup
7
+ <% else %>
8
+ Zeitwerk::Loader.for_gem.setup
9
+ <% end %>
10
+ <% end %>
11
+ # Main namespace.
12
+ <% namespace %>
@@ -6,14 +6,11 @@ Bundler.require :tools
6
6
  SimpleCov.start { enable_coverage :branch }
7
7
  <% end %>
8
8
 
9
- require "<%= configuration.project_name %>"
9
+ require "<%= configuration.project_path %>"
10
10
  <% if configuration.build_refinements %>
11
11
  require "refinements"
12
12
  <% end %>
13
13
 
14
- GC.auto_compact = true
15
- GC.verify_compaction_references double_heap: true, toward: :empty
16
-
17
14
  <% if configuration.build_refinements %>
18
15
  using Refinements::Pathnames
19
16
 
data/lib/rubysmith.rb CHANGED
@@ -1,33 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubysmith/identity"
4
- require "rubysmith/pathway"
5
- require "rubysmith/renderers/namespace"
6
- require "rubysmith/renderers/erb"
7
- require "rubysmith/text/inserter"
8
- require "rubysmith/builder"
9
- require "rubysmith/builders/core"
10
- require "rubysmith/builders/documentation"
11
- require "rubysmith/builders/git/setup"
12
- require "rubysmith/builders/git/commit"
13
- require "rubysmith/builders/bundler"
14
- require "rubysmith/builders/rake"
15
- require "rubysmith/builders/console"
16
- require "rubysmith/builders/setup"
17
- require "rubysmith/builders/guard"
18
- require "rubysmith/builders/reek"
19
- require "rubysmith/builders/rspec/context"
20
- require "rubysmith/builders/rspec/helper"
21
- require "rubysmith/builders/pragma"
22
- require "rubysmith/builders/rubocop/setup"
23
- require "rubysmith/builders/rubocop/formatter"
24
- require "rubysmith/builders/ruby_critic"
25
- require "rubysmith/cli/configuration/content"
26
- require "rubysmith/cli/configuration/loader"
27
- require "rubysmith/cli/parsers"
28
- require "rubysmith/cli/parsers/core"
29
- require "rubysmith/cli/parsers/build"
30
- require "rubysmith/cli/parsers/assembler"
31
- require "rubysmith/cli/processors/config"
32
- require "rubysmith/cli/processors/build"
33
- require "rubysmith/cli/shell"
3
+ require "zeitwerk"
4
+
5
+ Zeitwerk::Loader.for_gem.then do |loader|
6
+ loader.inflector.inflect "cli" => "CLI",
7
+ "circle_ci" => "CircleCI",
8
+ "erb" => "ERB",
9
+ "rspec" => "RSpec"
10
+ loader.setup
11
+ end
12
+
13
+ # Main namespace.
14
+ module Rubysmith
15
+ end
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.11.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,8 +28,50 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2021-08-08 00:00:00.000000000 Z
31
+ date: 2021-10-09 00:00:00.000000000 Z
32
32
  dependencies:
33
+ - !ruby/object:Gem::Dependency
34
+ name: dry-container
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.9'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
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'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pastel
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.8'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.8'
33
75
  - !ruby/object:Gem::Dependency
34
76
  name: pragmater
35
77
  requirement: !ruby/object:Gem::Requirement
@@ -50,28 +92,28 @@ dependencies:
50
92
  requirements:
51
93
  - - "~>"
52
94
  - !ruby/object:Gem::Version
53
- version: '8.0'
95
+ version: '8.4'
54
96
  type: :runtime
55
97
  prerelease: false
56
98
  version_requirements: !ruby/object:Gem::Requirement
57
99
  requirements:
58
100
  - - "~>"
59
101
  - !ruby/object:Gem::Version
60
- version: '8.0'
102
+ version: '8.4'
61
103
  - !ruby/object:Gem::Dependency
62
104
  name: rubocop
63
105
  requirement: !ruby/object:Gem::Requirement
64
106
  requirements:
65
107
  - - "~>"
66
108
  - !ruby/object:Gem::Version
67
- version: '1.14'
109
+ version: '1.20'
68
110
  type: :runtime
69
111
  prerelease: false
70
112
  version_requirements: !ruby/object:Gem::Requirement
71
113
  requirements:
72
114
  - - "~>"
73
115
  - !ruby/object:Gem::Version
74
- version: '1.14'
116
+ version: '1.20'
75
117
  - !ruby/object:Gem::Dependency
76
118
  name: runcom
77
119
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +128,34 @@ dependencies:
86
128
  - - "~>"
87
129
  - !ruby/object:Gem::Version
88
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.1'
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '12.1'
145
+ - !ruby/object:Gem::Dependency
146
+ name: zeitwerk
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '2.4'
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '2.4'
89
159
  description:
90
160
  email:
91
161
  - brooke@alchemists.io
@@ -102,11 +172,17 @@ files:
102
172
  - lib/rubysmith.rb
103
173
  - lib/rubysmith/builder.rb
104
174
  - lib/rubysmith/builders/bundler.rb
175
+ - lib/rubysmith/builders/circle_ci.rb
105
176
  - lib/rubysmith/builders/console.rb
106
177
  - lib/rubysmith/builders/core.rb
107
- - 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
108
183
  - lib/rubysmith/builders/git/commit.rb
109
184
  - lib/rubysmith/builders/git/setup.rb
185
+ - lib/rubysmith/builders/git_hub.rb
110
186
  - lib/rubysmith/builders/guard.rb
111
187
  - lib/rubysmith/builders/pragma.rb
112
188
  - lib/rubysmith/builders/rake.rb
@@ -115,26 +191,31 @@ files:
115
191
  - lib/rubysmith/builders/rspec/helper.rb
116
192
  - lib/rubysmith/builders/rubocop/formatter.rb
117
193
  - lib/rubysmith/builders/rubocop/setup.rb
118
- - lib/rubysmith/builders/ruby_critic.rb
119
194
  - lib/rubysmith/builders/setup.rb
195
+ - lib/rubysmith/cli/actions/build.rb
196
+ - lib/rubysmith/cli/actions/config.rb
120
197
  - lib/rubysmith/cli/configuration/content.rb
121
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
122
202
  - lib/rubysmith/cli/configuration/loader.rb
123
203
  - lib/rubysmith/cli/parsers.rb
124
204
  - lib/rubysmith/cli/parsers/assembler.rb
125
205
  - lib/rubysmith/cli/parsers/build.rb
126
206
  - lib/rubysmith/cli/parsers/core.rb
127
- - lib/rubysmith/cli/processors/build.rb
128
- - lib/rubysmith/cli/processors/config.rb
129
207
  - lib/rubysmith/cli/shell.rb
208
+ - lib/rubysmith/container.rb
130
209
  - lib/rubysmith/identity.rb
131
210
  - lib/rubysmith/pathway.rb
132
211
  - lib/rubysmith/renderers/erb.rb
133
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
134
216
  - lib/rubysmith/templates/%project_name%/.reek.yml.erb
135
217
  - lib/rubysmith/templates/%project_name%/.rubocop.yml.erb
136
218
  - lib/rubysmith/templates/%project_name%/.ruby-version.erb
137
- - lib/rubysmith/templates/%project_name%/.rubycritic.yml.erb
138
219
  - lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb
139
220
  - lib/rubysmith/templates/%project_name%/CHANGES.md.erb
140
221
  - lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb
@@ -154,7 +235,7 @@ files:
154
235
  - lib/rubysmith/templates/%project_name%/bin/guard.erb
155
236
  - lib/rubysmith/templates/%project_name%/bin/rubocop.erb
156
237
  - lib/rubysmith/templates/%project_name%/bin/setup.erb
157
- - lib/rubysmith/templates/%project_name%/lib/%project_name%.rb.erb
238
+ - lib/rubysmith/templates/%project_name%/lib/%project_path%.rb.erb
158
239
  - lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb
159
240
  - lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb
160
241
  - lib/rubysmith/text/inserter.rb
@@ -181,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
262
  - !ruby/object:Gem::Version
182
263
  version: '0'
183
264
  requirements: []
184
- rubygems_version: 3.2.25
265
+ rubygems_version: 3.2.28
185
266
  signing_key:
186
267
  specification_version: 4
187
268
  summary: A command line interface for smithing Ruby projects.
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(configuration, builder: Builder) = new(configuration, builder: builder).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
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "refinements/structs"
4
-
5
- module Rubysmith
6
- module CLI
7
- module Processors
8
- # Handles the Command Line Interface (CLI) for building of a project skeleton.
9
- class Build
10
- using Refinements::Structs
11
-
12
- # Order is important.
13
- MINIMUM = [
14
- Builders::Core,
15
- Builders::Bundler,
16
- Builders::Pragma,
17
- Builders::Rubocop::Formatter
18
- ].freeze
19
-
20
- # Order is important.
21
- MAXIMUM = [
22
- Builders::Core,
23
- Builders::Documentation,
24
- Builders::Git::Setup,
25
- Builders::Bundler,
26
- Builders::Rake,
27
- Builders::Console,
28
- Builders::Setup,
29
- Builders::Guard,
30
- Builders::Reek,
31
- Builders::RSpec::Context,
32
- Builders::RSpec::Helper,
33
- Builders::Pragma,
34
- Builders::Rubocop::Setup,
35
- Builders::Rubocop::Formatter,
36
- Builders::RubyCritic,
37
- Builders::Git::Commit
38
- ].freeze
39
-
40
- def self.with_minimum = new(builders: MINIMUM)
41
-
42
- def initialize configuration: Configuration::Loader.call, builders: MAXIMUM
43
- @configuration = configuration
44
- @builders = builders
45
- end
46
-
47
- def call(options) = configuration.merge(**options).then { |config| process config }
48
-
49
- private
50
-
51
- attr_reader :configuration, :builders
52
-
53
- def process(config) = builders.each { |builder| builder.call config }
54
- end
55
- end
56
- end
57
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rubysmith
4
- module CLI
5
- module Processors
6
- # Handles the Command Line Interface (CLI) configuration processing.
7
- class Config
8
- def initialize configuration: CLI::Configuration::Loader::CLIENT, kernel: Kernel
9
- @configuration = configuration
10
- @kernel = kernel
11
- end
12
-
13
- def call action
14
- case action
15
- when :edit then edit
16
- when :view then view
17
- else fail StandardError, "Invalid configuration action: #{action}."
18
- end
19
- end
20
-
21
- private
22
-
23
- attr_reader :configuration, :kernel
24
-
25
- def edit = kernel.system("$EDITOR #{configuration.current}")
26
-
27
- def view = kernel.system("cat #{configuration.current}")
28
- end
29
- end
30
- end
31
- end
@@ -1,3 +0,0 @@
1
- paths:
2
- - "lib"
3
- no_browser: true
@@ -1,3 +0,0 @@
1
- # The project namespace.
2
- module <%= configuration.project_class %>
3
- end