rubysmith 6.7.0 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +18 -1
  4. data/lib/rubysmith/builders/abstract.rb +24 -0
  5. data/lib/rubysmith/builders/bundler.rb +1 -12
  6. data/lib/rubysmith/builders/caliber.rb +1 -12
  7. data/lib/rubysmith/builders/circle_ci.rb +1 -12
  8. data/lib/rubysmith/builders/console.rb +1 -12
  9. data/lib/rubysmith/builders/core.rb +1 -10
  10. data/lib/rubysmith/builders/documentation/citation.rb +1 -12
  11. data/lib/rubysmith/builders/documentation/license.rb +1 -10
  12. data/lib/rubysmith/builders/documentation/readme.rb +2 -11
  13. data/lib/rubysmith/builders/documentation/version.rb +1 -10
  14. data/lib/rubysmith/builders/git/commit.rb +2 -8
  15. data/lib/rubysmith/builders/git/ignore.rb +1 -12
  16. data/lib/rubysmith/builders/git/safe.rb +1 -12
  17. data/lib/rubysmith/builders/git/setup.rb +1 -12
  18. data/lib/rubysmith/builders/git_hub.rb +1 -10
  19. data/lib/rubysmith/builders/git_hub_ci.rb +1 -10
  20. data/lib/rubysmith/builders/guard.rb +1 -12
  21. data/lib/rubysmith/builders/init.rb +1 -12
  22. data/lib/rubysmith/builders/rake.rb +1 -10
  23. data/lib/rubysmith/builders/reek.rb +1 -12
  24. data/lib/rubysmith/builders/rspec/binstub.rb +1 -12
  25. data/lib/rubysmith/builders/rspec/context.rb +1 -12
  26. data/lib/rubysmith/builders/rspec/helper.rb +1 -12
  27. data/lib/rubysmith/builders/setup.rb +1 -12
  28. data/lib/rubysmith/builders/version.rb +1 -12
  29. data/lib/rubysmith/cli/actions/irb_kit.rb +22 -0
  30. data/lib/rubysmith/cli/actions/rtc.rb +22 -0
  31. data/lib/rubysmith/cli/commands/build.rb +2 -0
  32. data/lib/rubysmith/configuration/contract.rb +4 -1
  33. data/lib/rubysmith/configuration/defaults.yml +2 -0
  34. data/lib/rubysmith/configuration/model.rb +4 -1
  35. data/lib/rubysmith/container.rb +1 -1
  36. data/lib/rubysmith/templates/%project_name%/CITATION.cff.erb +1 -1
  37. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +6 -1
  38. data/lib/rubysmith/templates/%project_name%/LICENSE-apache.adoc.erb +1 -1
  39. data/lib/rubysmith/templates/%project_name%/LICENSE-apache.md.erb +1 -1
  40. data/lib/rubysmith/templates/%project_name%/LICENSE-mit.adoc.erb +1 -1
  41. data/lib/rubysmith/templates/%project_name%/LICENSE-mit.md.erb +1 -1
  42. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +5 -36
  43. data/lib/rubysmith/templates/%project_name%/README.md.erb +6 -25
  44. data/lib/rubysmith/templates/%project_name%/VERSIONS.adoc.erb +1 -1
  45. data/lib/rubysmith/templates/%project_name%/VERSIONS.md.erb +1 -1
  46. data/lib/rubysmith.rb +3 -1
  47. data/rubysmith.gemspec +3 -3
  48. data.tar.gz.sig +0 -0
  49. metadata +9 -7
  50. metadata.gz.sig +0 -0
  51. data/lib/rubysmith/configuration/transformers/current_time.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e66348f46dd686a44fa3113f6d7489fdbbc11fb52746953c081a9e99f77ed6ff
4
- data.tar.gz: 91f4e06f5d2bc2171815f192ca8a4bbb88257876ebf899a94dab32c15d6faa5d
3
+ metadata.gz: 0f20822bfa5fc0def1a71fa52c0baf8d9888bb0ea85ead200ed7a00412ffe96b
4
+ data.tar.gz: e92c7f25a98acc995384f4154f806008144e4879b96b583214269f9a7bb15f11
5
5
  SHA512:
6
- metadata.gz: d708a295eec43e4a4ea4913939a2a9d48bd9ccf1c6be70174fc1edddf2d0ff54cde76d1d45372f83684d56a7dadda85c07bc61f1ccc7bb6b776cab251b7ae11f
7
- data.tar.gz: 76bc96b3ca0a4d996471bb1d19ea6c166ae70965549842e0a979bc6ee2ef0ed61e2597fa666120660fc438c5c1f3cfaad27722766d2e6793d17193fa2fe18044
6
+ metadata.gz: 61765546bec88e56137acd995023780d29b8356f6abcd6d782a91e6c8e9bbda616bb0374dcb73ed43607ff1680c26d63a266e922ee7c597caaf9e4b4260dfba3
7
+ data.tar.gz: 926375d0d30b427c0bda7f024f5e55ef29f7fed4a5621807e77ad553964369297c11b64b32521e3decdac1172c93902313ba81517b14da5b5d514a66fc9cfab8
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -29,13 +29,14 @@ toc::[]
29
29
  * Supports link:https://github.com[GitHub].
30
30
  * Supports link:https://alchemists.io/projects/git-lint[Git Lint].
31
31
  * Supports link:https://github.com/guard/guard[Guard].
32
+ * Supports link:https://alchemists.io/projects/irb-kit[IRB Kit].
32
33
  * Supports link:https://github.com/ruby/rake[Rake].
33
34
  * Supports link:https://github.com/troessner/reek[Reek].
34
35
  * Supports link:https://alchemists.io/projects/refinements[Refinements].
35
36
  * Supports link:https://rspec.info[RSpec].
37
+ * Supports link:https://github.com/ruby/repl_type_completor[ReplTypeCompletor].
36
38
  * Supports setup script for project setup.
37
39
  * Supports link:https://github.com/simplecov-ruby/simplecov[SimpleCov].
38
- * Supports link:https://github.com/ruby/repl_type_completor[ReplTypeCompletor].
39
40
  * Supports link:https://github.com/fxn/zeitwerk[Zeitwerk].
40
41
  * Supports common settings and a structured layout for building projects.
41
42
  * Provides common documentation:
@@ -210,6 +211,10 @@ manner.
210
211
  The `--guard` option allows you add the link:https://github.com/guard/guard[Guard] gem to your
211
212
  project for rapid red, green, refactor development cycles.
212
213
 
214
+ ===== IRB Kit
215
+
216
+ The `--irb-kit` option allows you add the link:https://alchemists.io/projects/irb-kit[IRB Kit] gem to your project for additional extensions you can use within IRB to improve your workflow.
217
+
213
218
  ===== License
214
219
 
215
220
  The `--license` option ensures you build your project with a license.
@@ -248,6 +253,10 @@ Ruby core objects without monkey patching your code.
248
253
  The `--rspec` option allows you add the link:https://rspec.info[RSpec] gem to your project for
249
254
  defining your project specifications and have a framework for testing your code.
250
255
 
256
+ ===== Repl Type Completor (RTC)
257
+
258
+ The `--rtc` option allows you add the link:https://github.com/ruby/repl_type_completor[Repl Type Completor] gem to your project for improved type completion when using link:https://github.com/ruby/irb[IRB].
259
+
251
260
  ===== Setup
252
261
 
253
262
  The `--setup` option allows you to configure you project with automated setup instructions so anyone
@@ -320,6 +329,7 @@ build:
320
329
  git_hub_ci: false
321
330
  git_lint: true
322
331
  guard: true
332
+ irb_kit: false
323
333
  license: true
324
334
  maximum: false
325
335
  minimum: false
@@ -328,6 +338,7 @@ build:
328
338
  reek: true
329
339
  refinements: true
330
340
  rspec: true
341
+ rtc: true
331
342
  security: true
332
343
  setup: true
333
344
  simple_cov: true
@@ -345,6 +356,8 @@ license:
345
356
  label: Hippocratic
346
357
  name: hippocratic
347
358
  version: "2.1"
359
+ organization:
360
+ url:
348
361
  project:
349
362
  url:
350
363
  community:
@@ -413,6 +426,10 @@ Use this section to define the license you want to use for your project. The fol
413
426
 
414
427
  When picking a license, you can also supply the appropriate label and version in addition to the name.
415
428
 
429
+ ==== Organization
430
+
431
+ Use this section to define URL information that points to your organization. This is useful for information that isn't project specific but related to all projects within your organization. You'll want to customize this URL especially for documentation purposes.
432
+
416
433
  ==== Project
417
434
 
418
435
  There are two sub-categories within this section: URLs and version. The URLs allow you to link to
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubysmith
4
+ module Builders
5
+ # Provides default implementation from which builders can inherit from.
6
+ class Abstract
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
+ fail NoMethodError,
16
+ "`#{self.class}##{__method__} #{method(__method__).parameters}` must be implemented."
17
+ end
18
+
19
+ protected
20
+
21
+ attr_reader :configuration, :builder
22
+ end
23
+ end
24
+ end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds Bundler Gemfile configuration for project skeleton.
8
- class Bundler
8
+ class Bundler < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  builder.call(configuration.merge(template_path: "%project_name%/Gemfile.erb"))
20
13
  .render
@@ -27,10 +20,6 @@ module Rubysmith
27
20
 
28
21
  configuration
29
22
  end
30
-
31
- private
32
-
33
- attr_reader :configuration, :builder
34
23
  end
35
24
  end
36
25
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton with Caliber style support.
8
- class Caliber
8
+ class Caliber < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_caliber
20
13
 
@@ -26,10 +19,6 @@ module Rubysmith
26
19
  builder.call(configuration.merge(template_path: path)).render
27
20
  configuration
28
21
  end
29
-
30
- private
31
-
32
- attr_reader :configuration, :builder
33
22
  end
34
23
  end
35
24
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton Circle CI configuration.
8
- class CircleCI
8
+ class CircleCI < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_circle_ci
20
13
 
@@ -24,10 +17,6 @@ module Rubysmith
24
17
 
25
18
  configuration
26
19
  end
27
-
28
- private
29
-
30
- attr_reader :configuration, :builder
31
20
  end
32
21
  end
33
22
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton console for object inspection and exploration.
8
- class Console
8
+ class Console < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_console
20
13
 
@@ -24,10 +17,6 @@ module Rubysmith
24
17
 
25
18
  configuration
26
19
  end
27
-
28
- private
29
-
30
- attr_reader :configuration, :builder
31
20
  end
32
21
  end
33
22
  end
@@ -6,17 +6,10 @@ require "refinements/struct"
6
6
  module Rubysmith
7
7
  module Builders
8
8
  # Builds project skeleton core structure and minimum file support.
9
- class Core
9
+ class Core < Abstract
10
10
  using Refinements::String
11
11
  using Refinements::Struct
12
12
 
13
- def self.call(...) = new(...).call
14
-
15
- def initialize configuration, builder: Builder
16
- @configuration = configuration
17
- @builder = builder
18
- end
19
-
20
13
  def call
21
14
  render_implementation
22
15
  render_specification
@@ -44,8 +37,6 @@ module Rubysmith
44
37
  def indentation = ::Core::EMPTY_STRING.indent configuration.project_levels
45
38
 
46
39
  def module_name = configuration.project_class
47
-
48
- attr_reader :configuration, :builder
49
40
  end
50
41
  end
51
42
  end
@@ -6,26 +6,15 @@ module Rubysmith
6
6
  module Builders
7
7
  module Documentation
8
8
  # Builds project skeleton citation documentation.
9
- class Citation
9
+ class Citation < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_citation
21
14
 
22
15
  builder.call(configuration.merge(template_path: "%project_name%/CITATION.cff.erb")).render
23
16
  configuration
24
17
  end
25
-
26
- private
27
-
28
- attr_reader :configuration, :builder
29
18
  end
30
19
  end
31
20
  end
@@ -7,16 +7,9 @@ module Rubysmith
7
7
  module Builders
8
8
  module Documentation
9
9
  # Builds project skeleton LICENSE documentation.
10
- class License
10
+ class License < Abstract
11
11
  using Refinements::Struct
12
12
 
13
- def self.call(...) = new(...).call
14
-
15
- def initialize configuration, builder: Builder
16
- @configuration = configuration
17
- @builder = builder
18
- end
19
-
20
13
  def call
21
14
  return configuration unless configuration.build_license
22
15
 
@@ -30,8 +23,6 @@ module Rubysmith
30
23
 
31
24
  private
32
25
 
33
- attr_reader :configuration, :builder
34
-
35
26
  def kind = configuration.documentation_format
36
27
 
37
28
  def license = configuration.license_name
@@ -6,16 +6,9 @@ module Rubysmith
6
6
  module Builders
7
7
  module Documentation
8
8
  # Builds project skeleton README documentation.
9
- class Readme
9
+ class Readme < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_readme
21
14
 
@@ -27,9 +20,7 @@ module Rubysmith
27
20
  configuration
28
21
  end
29
22
 
30
- private
31
-
32
- attr_reader :configuration, :builder
23
+ protected
33
24
 
34
25
  def kind = configuration.documentation_format
35
26
  end
@@ -7,16 +7,9 @@ module Rubysmith
7
7
  module Builders
8
8
  module Documentation
9
9
  # Builds project skeleton version history.
10
- class Version
10
+ class Version < Abstract
11
11
  using Refinements::Struct
12
12
 
13
- def self.call(...) = new(...).call
14
-
15
- def initialize configuration, builder: Builder
16
- @configuration = configuration
17
- @builder = builder
18
- end
19
-
20
13
  def call
21
14
  return configuration unless configuration.build_versions
22
15
 
@@ -28,8 +21,6 @@ module Rubysmith
28
21
 
29
22
  private
30
23
 
31
- attr_reader :configuration, :builder
32
-
33
24
  def kind = configuration.documentation_format
34
25
  end
35
26
  end
@@ -4,15 +4,11 @@ module Rubysmith
4
4
  module Builders
5
5
  module Git
6
6
  # Builds project skeleton initial Git commit message.
7
- class Commit
7
+ class Commit < Abstract
8
8
  include Import[:specification]
9
9
 
10
- def self.call(...) = new(...).call
11
-
12
10
  def initialize(configuration, builder: Builder, **)
13
- super(**)
14
- @configuration = configuration
15
- @builder = builder
11
+ super
16
12
  end
17
13
 
18
14
  def call
@@ -30,8 +26,6 @@ module Rubysmith
30
26
 
31
27
  private
32
28
 
33
- attr_reader :configuration, :builder
34
-
35
29
  def body
36
30
  "Generated with link:#{specification.homepage_url}[#{specification.label}] " \
37
31
  "#{specification.version}."
@@ -6,16 +6,9 @@ module Rubysmith
6
6
  module Builders
7
7
  module Git
8
8
  # Builds Git repository directory and file ignore configuration.
9
- class Ignore
9
+ class Ignore < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_git
21
14
 
@@ -25,10 +18,6 @@ module Rubysmith
25
18
 
26
19
  configuration
27
20
  end
28
-
29
- private
30
-
31
- attr_reader :configuration, :builder
32
21
  end
33
22
  end
34
23
  end
@@ -6,26 +6,15 @@ module Rubysmith
6
6
  module Builders
7
7
  module Git
8
8
  # Initializes project skeleton with Git Safe support.
9
- class Safe
9
+ class Safe < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_git
21
14
 
22
15
  builder.call(configuration.merge(template_path: "%project_name%/.git/safe")).make_path
23
16
  configuration
24
17
  end
25
-
26
- private
27
-
28
- attr_reader :configuration, :builder
29
18
  end
30
19
  end
31
20
  end
@@ -4,24 +4,13 @@ module Rubysmith
4
4
  module Builders
5
5
  module Git
6
6
  # Initializes project skeleton as a Git repository.
7
- class Setup
8
- def self.call(...) = new(...).call
9
-
10
- def initialize configuration, builder: Builder
11
- @configuration = configuration
12
- @builder = builder
13
- end
14
-
7
+ class Setup < Abstract
15
8
  def call
16
9
  return configuration unless configuration.build_git
17
10
 
18
11
  builder.call(configuration).run("git init", chdir: configuration.project_name)
19
12
  configuration
20
13
  end
21
-
22
- private
23
-
24
- attr_reader :configuration, :builder
25
14
  end
26
15
  end
27
16
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton GitHub templates.
8
- class GitHub
8
+ class GitHub < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  render_funding
20
13
 
@@ -27,8 +20,6 @@ module Rubysmith
27
20
 
28
21
  private
29
22
 
30
- attr_reader :configuration, :builder
31
-
32
23
  def render_funding
33
24
  return unless configuration.build_funding
34
25
 
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton GitHub CI template.
8
- class GitHubCI
8
+ class GitHubCI < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_git_hub_ci
20
13
 
@@ -24,8 +17,6 @@ module Rubysmith
24
17
 
25
18
  private
26
19
 
27
- attr_reader :configuration, :builder
28
-
29
20
  def configuration_with_template
30
21
  configuration.merge template_path: "%project_name%/.github/workflows/ci.yml.erb"
31
22
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton Guard support for a red, green, refactor loop.
8
- class Guard
8
+ class Guard < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_guard
20
13
 
@@ -25,10 +18,6 @@ module Rubysmith
25
18
  builder.call(configuration.merge(template_path: "%project_name%/Guardfile.erb")).render
26
19
  configuration
27
20
  end
28
-
29
- private
30
-
31
- attr_reader :configuration, :builder
32
21
  end
33
22
  end
34
23
  end
@@ -6,24 +6,13 @@ require "refinements/struct"
6
6
  module Rubysmith
7
7
  module Builders
8
8
  # Initializes building of project by checking for existence first.
9
- class Init
9
+ class Init < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  builder.call(configuration.merge(template_path: "%project_name%")).check
21
14
  configuration
22
15
  end
23
-
24
- private
25
-
26
- attr_reader :configuration, :builder
27
16
  end
28
17
  end
29
18
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton Rake support.
8
- class Rake
8
+ class Rake < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_rake
20
13
 
@@ -25,8 +18,6 @@ module Rubysmith
25
18
 
26
19
  private
27
20
 
28
- attr_reader :configuration, :builder
29
-
30
21
  def add_binstub
31
22
  builder.call(configuration.merge(template_path: "%project_name%/bin/rake.erb"))
32
23
  .render
@@ -5,26 +5,15 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton Reek code quality support.
8
- class Reek
8
+ class Reek < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_reek
20
13
 
21
14
  builder.call(configuration.merge(template_path: "%project_name%/.reek.yml.erb")).render
22
15
  configuration
23
16
  end
24
-
25
- private
26
-
27
- attr_reader :configuration, :builder
28
17
  end
29
18
  end
30
19
  end
@@ -6,16 +6,9 @@ module Rubysmith
6
6
  module Builders
7
7
  module RSpec
8
8
  # Builds RSpec binstub for project skeleton.
9
- class Binstub
9
+ class Binstub < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_rspec
21
14
 
@@ -25,10 +18,6 @@ module Rubysmith
25
18
 
26
19
  configuration
27
20
  end
28
-
29
- private
30
-
31
- attr_reader :configuration, :builder
32
21
  end
33
22
  end
34
23
  end
@@ -6,16 +6,9 @@ module Rubysmith
6
6
  module Builders
7
7
  module RSpec
8
8
  # Builds RSpec shared context for temporary directories.
9
- class Context
9
+ class Context < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_rspec
21
14
 
@@ -27,10 +20,6 @@ module Rubysmith
27
20
 
28
21
  configuration
29
22
  end
30
-
31
- private
32
-
33
- attr_reader :configuration, :builder
34
23
  end
35
24
  end
36
25
  end
@@ -6,16 +6,9 @@ module Rubysmith
6
6
  module Builders
7
7
  module RSpec
8
8
  # Builds RSpec spec helper for project skeleton.
9
- class Helper
9
+ class Helper < Abstract
10
10
  using Refinements::Struct
11
11
 
12
- def self.call(...) = new(...).call
13
-
14
- def initialize configuration, builder: Builder
15
- @configuration = configuration
16
- @builder = builder
17
- end
18
-
19
12
  def call
20
13
  return configuration unless configuration.build_rspec
21
14
 
@@ -26,10 +19,6 @@ module Rubysmith
26
19
 
27
20
  configuration
28
21
  end
29
-
30
- private
31
-
32
- attr_reader :configuration, :builder
33
22
  end
34
23
  end
35
24
  end
@@ -5,16 +5,9 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton setup script.
8
- class Setup
8
+ class Setup < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  return configuration unless configuration.build_setup
20
13
 
@@ -24,10 +17,6 @@ module Rubysmith
24
17
 
25
18
  configuration
26
19
  end
27
-
28
- private
29
-
30
- attr_reader :configuration, :builder
31
20
  end
32
21
  end
33
22
  end
@@ -5,26 +5,15 @@ require "refinements/struct"
5
5
  module Rubysmith
6
6
  module Builders
7
7
  # Builds project skeleton Ruby version file.
8
- class Version
8
+ class Version < Abstract
9
9
  using Refinements::Struct
10
10
 
11
- def self.call(...) = new(...).call
12
-
13
- def initialize configuration, builder: Builder
14
- @configuration = configuration
15
- @builder = builder
16
- end
17
-
18
11
  def call
19
12
  builder.call(configuration.merge(template_path: "%project_name%/.ruby-version.erb"))
20
13
  .render
21
14
  .append("\n")
22
15
  configuration
23
16
  end
24
-
25
- private
26
-
27
- attr_reader :configuration, :builder
28
17
  end
29
18
  end
30
19
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sod"
4
+
5
+ module Rubysmith
6
+ module CLI
7
+ module Actions
8
+ # Stores IRB Kit flag.
9
+ class IRBKit < Sod::Action
10
+ include Import[:input]
11
+
12
+ description "Add IRB Kit gem."
13
+
14
+ on "--[no-]irb-kit"
15
+
16
+ default { Container[:configuration].build_irb_kit }
17
+
18
+ def call(value = nil) = input.build_irb_kit = value
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sod"
4
+
5
+ module Rubysmith
6
+ module CLI
7
+ module Actions
8
+ # Stores Repl Type Completor flag.
9
+ class RTC < Sod::Action
10
+ include Import[:input]
11
+
12
+ description "Add Repl Type Completor gem."
13
+
14
+ on "--[no-]rtc"
15
+
16
+ default { Container[:configuration].build_rtc }
17
+
18
+ def call(value = nil) = input.build_rtc = value
19
+ end
20
+ end
21
+ end
22
+ end
@@ -62,6 +62,7 @@ module Rubysmith
62
62
  on Actions::GitHubCI
63
63
  on Actions::GitLint
64
64
  on Actions::Guard
65
+ on Actions::IRBKit
65
66
  on Actions::License
66
67
  on Actions::Maximum
67
68
  on Actions::Minimum
@@ -70,6 +71,7 @@ module Rubysmith
70
71
  on Actions::Reek
71
72
  on Actions::Refinements
72
73
  on Actions::RSpec
74
+ on Actions::RTC
73
75
  on Actions::Security
74
76
  on Actions::Setup
75
77
  on Actions::SimpleCov
@@ -28,6 +28,7 @@ module Rubysmith
28
28
  required(:build_git_hub_ci).filled :bool
29
29
  required(:build_git_lint).filled :bool
30
30
  required(:build_guard).filled :bool
31
+ required(:build_irb_kit).filled :bool
31
32
  required(:build_license).filled :bool
32
33
  required(:build_maximum).filled :bool
33
34
  required(:build_minimum).filled :bool
@@ -36,6 +37,7 @@ module Rubysmith
36
37
  required(:build_reek).filled :bool
37
38
  required(:build_refinements).filled :bool
38
39
  required(:build_rspec).filled :bool
40
+ required(:build_rtc).filled :bool
39
41
  required(:build_security).filled :bool
40
42
  required(:build_setup).filled :bool
41
43
  required(:build_simple_cov).filled :bool
@@ -46,10 +48,11 @@ module Rubysmith
46
48
  optional(:citation_orcid).filled :string
47
49
  required(:documentation_format).filled :string
48
50
  optional(:git_hub_user).filled :string
51
+ optional(:loaded_at).filled :time
49
52
  required(:license_label).filled :string
50
53
  required(:license_name).filled :string
51
54
  required(:license_version).filled :string
52
- optional(:now).filled :time
55
+ optional(:organization_url).filled :string
53
56
  optional(:project_name).filled :string
54
57
  optional(:project_url_community).filled :string
55
58
  optional(:project_url_conduct).filled :string
@@ -15,6 +15,7 @@ build:
15
15
  git_hub_ci: false
16
16
  git_lint: true
17
17
  guard: true
18
+ irb_kit: false
18
19
  license: true
19
20
  maximum: false
20
21
  minimum: false
@@ -23,6 +24,7 @@ build:
23
24
  reek: true
24
25
  refinements: true
25
26
  rspec: true
27
+ rtc: true
26
28
  security: true
27
29
  setup: true
28
30
  simple_cov: true
@@ -29,6 +29,7 @@ module Rubysmith
29
29
  :build_git_hub_ci,
30
30
  :build_git_lint,
31
31
  :build_guard,
32
+ :build_irb_kit,
32
33
  :build_license,
33
34
  :build_maximum,
34
35
  :build_minimum,
@@ -37,6 +38,7 @@ module Rubysmith
37
38
  :build_reek,
38
39
  :build_refinements,
39
40
  :build_rspec,
41
+ :build_rtc,
40
42
  :build_security,
41
43
  :build_setup,
42
44
  :build_simple_cov,
@@ -50,7 +52,8 @@ module Rubysmith
50
52
  :license_label,
51
53
  :license_name,
52
54
  :license_version,
53
- :now,
55
+ :loaded_at,
56
+ :organization_url,
54
57
  :project_name,
55
58
  :project_url_community,
56
59
  :project_url_conduct,
@@ -20,12 +20,12 @@ module Rubysmith
20
20
  register :defaults do
21
21
  Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
22
22
  .add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
23
- .add_transformer(Configuration::Transformers::CurrentTime)
24
23
  .add_transformer(Configuration::Transformers::GitHubUser.new)
25
24
  .add_transformer(Configuration::Transformers::GitEmail.new)
26
25
  .add_transformer(Configuration::Transformers::GitUser.new)
27
26
  .add_transformer(Configuration::Transformers::TemplateRoot.new)
28
27
  .add_transformer(Configuration::Transformers::TargetRoot)
28
+ .add_transformer(Etcher::Transformers::Time.new)
29
29
  end
30
30
 
31
31
  register(:specification) { Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec" }
@@ -4,7 +4,7 @@ title: <%= configuration.project_label %>
4
4
  abstract:
5
5
  version: <%= configuration.project_version %>
6
6
  license: <%= configuration.license_label_version %>
7
- date-released: <%= configuration.now.strftime "%Y-%m-%d" %>
7
+ date-released: <%= configuration.loaded_at.strftime "%Y-%m-%d" %>
8
8
  authors:
9
9
  - family-names: <%= configuration.author_family_name %>
10
10
  given-names: <%= configuration.author_given_name %>
@@ -49,5 +49,10 @@ group :tools do
49
49
  <% if configuration.build_debug %>
50
50
  gem "debug", "~> 1.9"
51
51
  <% end %>
52
- gem "repl_type_completor", "~> 0.1"
52
+ <% if configuration.build_irb_kit %>
53
+ gem "irb-kit", "~> 0.0"
54
+ <% end %>
55
+ <% if configuration.build_rtc %>
56
+ gem "repl_type_completor", "~> 0.1"
57
+ <% end %>
53
58
  end
@@ -150,7 +150,7 @@ additional liability.
150
150
 
151
151
  END OF TERMS AND CONDITIONS
152
152
 
153
- Copyright <%= configuration.now.strftime "%Y" %> link:<%= configuration.author_url %>[<%= configuration.author_name %>].
153
+ Copyright <%= configuration.loaded_at.strftime "%Y" %> link:<%= configuration.author_url %>[<%= configuration.author_name %>].
154
154
 
155
155
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
156
156
  compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
@@ -150,7 +150,7 @@ additional liability.
150
150
 
151
151
  END OF TERMS AND CONDITIONS
152
152
 
153
- Copyright <%= configuration.now.strftime "%Y" %> [<%= configuration.author_name %>](<%= configuration.author_url %>).
153
+ Copyright <%= configuration.loaded_at.strftime "%Y" %> [<%= configuration.author_name %>](<%= configuration.author_url %>).
154
154
 
155
155
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
156
156
  compliance with the License. You may obtain a [copy](https://www.apache.org/licenses/LICENSE-2.0) of
@@ -1,4 +1,4 @@
1
- Copyright <%= configuration.now.strftime "%Y" %> link:<%= configuration.author_url %>[<%= configuration.author_name %>].
1
+ Copyright <%= configuration.loaded_at.strftime "%Y" %> link:<%= configuration.author_url %>[<%= configuration.author_name %>].
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- Copyright <%= configuration.now.strftime "%Y" %> [<%= configuration.author_name %>](<%= configuration.author_url %>).
1
+ Copyright <%= configuration.loaded_at.strftime "%Y" %> [<%= configuration.author_name %>](<%= configuration.author_url %>).
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -8,52 +8,21 @@ toc::[]
8
8
 
9
9
  == Features
10
10
 
11
- == Screencasts
12
-
13
11
  == Requirements
14
12
 
15
13
  . link:https://www.ruby-lang.org[Ruby].
16
14
 
17
15
  == Setup
18
- <% if configuration.build_security %>
19
-
20
- To install _with_ security, run:
21
-
22
- [source,bash]
23
- ----
24
- # 💡 Skip this line if you already have the public certificate installed.
25
- gem cert --add <(curl --compressed --location <%= configuration.computed_project_url_home %>/gems.pem)
26
- gem install <%= configuration.project_name %> --trust-policy HighSecurity
27
- ----
28
16
 
29
- To install _without_ security, run:
17
+ To set up project, run:
30
18
 
31
19
  [source,bash]
32
20
  ----
33
- gem install <%= configuration.project_name %>
34
- ----
35
- <% else %>
36
-
37
- To install, run:
38
-
39
- [source,bash]
40
- ----
41
- gem install <%= configuration.project_name %>
42
- ----
21
+ git clone <%= configuration.computed_project_url_source %>
22
+ cd <%= configuration.project_name %>
23
+ <% if configuration.build_setup %>
24
+ bin/setup
43
25
  <% end %>
44
-
45
- You can also add the gem directly to your project:
46
-
47
- [source,bash]
48
- ----
49
- bundle add <%= configuration.project_name %>
50
- ----
51
-
52
- Once the gem is installed, you only need to require it:
53
-
54
- [source,ruby]
55
- ----
56
- require "<%= configuration.project_path %>"
57
26
  ----
58
27
 
59
28
  == Usage
@@ -5,38 +5,19 @@
5
5
 
6
6
  ## Features
7
7
 
8
- ## Screencasts
9
-
10
8
  ## Requirements
11
9
 
12
10
  1. [Ruby](https://www.ruby-lang.org)
13
11
 
14
12
  ## Setup
15
- <% if configuration.build_security %>
16
-
17
- To install _with_ security, run:
18
-
19
- # 💡 Skip this line if you already have the public certificate installed.
20
- gem cert --add <(curl --compressed --location <%= configuration.computed_project_url_home %>/gems.pem)
21
- gem install <%= configuration.project_name %> --trust-policy HighSecurity
22
-
23
- To install _without_ security, run:
24
-
25
- gem install <%= configuration.project_name %>
26
- <% else %>
27
-
28
- To install, run:
29
-
30
- gem install <%= configuration.project_name %>
31
- <% end %>
32
-
33
- You can also add the gem directly to your project:
34
13
 
35
- bundle add <%= configuration.project_name %>
14
+ To set up project, run:
36
15
 
37
- Once the gem is installed, you only need to require it:
38
-
39
- require "<%= configuration.project_path %>"
16
+ git clone <%= configuration.computed_project_url_source %>
17
+ cd <%= configuration.project_name %>
18
+ <% if configuration.build_setup %>
19
+ bin/setup
20
+ <% end %>
40
21
 
41
22
  ## Usage
42
23
 
@@ -1,5 +1,5 @@
1
1
  = Versions
2
2
 
3
- == <%= configuration.project_version %> (<%= configuration.now.strftime "%Y-%m-%d" %>)
3
+ == <%= configuration.project_version %> (<%= configuration.loaded_at.strftime "%Y-%m-%d" %>)
4
4
 
5
5
  * Added initial implementation.
@@ -1,5 +1,5 @@
1
1
  # Versions
2
2
 
3
- ## <%= configuration.project_version %> (<%= configuration.now.strftime "%Y-%m-%d" %>)
3
+ ## <%= configuration.project_version %> (<%= configuration.loaded_at.strftime "%Y-%m-%d" %>)
4
4
 
5
5
  - Added initial implementation.
data/lib/rubysmith.rb CHANGED
@@ -7,7 +7,9 @@ Zeitwerk::Loader.new.then do |loader|
7
7
  "circle_ci" => "CircleCI",
8
8
  "erb" => "ERB",
9
9
  "git_hub_ci" => "GitHubCI",
10
- "rspec" => "RSpec"
10
+ "irb_kit" => "IRBKit",
11
+ "rspec" => "RSpec",
12
+ "rtc" => "RTC"
11
13
  loader.tag = File.basename __FILE__, ".rb"
12
14
  loader.push_dir __dir__
13
15
  loader.setup
data/rubysmith.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "rubysmith"
5
- spec.version = "6.7.0"
5
+ spec.version = "6.8.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/rubysmith"
@@ -27,10 +27,10 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency "containable", "~> 0.0"
28
28
  spec.add_dependency "dry-monads", "~> 1.6"
29
29
  spec.add_dependency "dry-schema", "~> 1.13"
30
- spec.add_dependency "etcher", "~> 1.3"
30
+ spec.add_dependency "etcher", "~> 1.5"
31
31
  spec.add_dependency "gitt", "~> 3.2"
32
32
  spec.add_dependency "infusible", "~> 3.5"
33
- spec.add_dependency "milestoner", "~> 17.7"
33
+ spec.add_dependency "milestoner", "~> 17.8"
34
34
  spec.add_dependency "pragmater", "~> 14.4"
35
35
  spec.add_dependency "refinements", "~> 12.1"
36
36
  spec.add_dependency "rubocop", "~> 1.63"
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: 6.7.0
4
+ version: 6.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-05-16 00:00:00.000000000 Z
38
+ date: 2024-05-25 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -99,14 +99,14 @@ dependencies:
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '1.3'
102
+ version: '1.5'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '1.3'
109
+ version: '1.5'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: gitt
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -141,14 +141,14 @@ dependencies:
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '17.7'
144
+ version: '17.8'
145
145
  type: :runtime
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '17.7'
151
+ version: '17.8'
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: pragmater
154
154
  requirement: !ruby/object:Gem::Requirement
@@ -290,6 +290,7 @@ files:
290
290
  - exe/rubysmith
291
291
  - lib/rubysmith.rb
292
292
  - lib/rubysmith/builder.rb
293
+ - lib/rubysmith/builders/abstract.rb
293
294
  - lib/rubysmith/builders/bundler.rb
294
295
  - lib/rubysmith/builders/caliber.rb
295
296
  - lib/rubysmith/builders/circle_ci.rb
@@ -329,6 +330,7 @@ files:
329
330
  - lib/rubysmith/cli/actions/git_hub_ci.rb
330
331
  - lib/rubysmith/cli/actions/git_lint.rb
331
332
  - lib/rubysmith/cli/actions/guard.rb
333
+ - lib/rubysmith/cli/actions/irb_kit.rb
332
334
  - lib/rubysmith/cli/actions/license.rb
333
335
  - lib/rubysmith/cli/actions/maximum.rb
334
336
  - lib/rubysmith/cli/actions/minimum.rb
@@ -339,6 +341,7 @@ files:
339
341
  - lib/rubysmith/cli/actions/reek.rb
340
342
  - lib/rubysmith/cli/actions/refinements.rb
341
343
  - lib/rubysmith/cli/actions/rspec.rb
344
+ - lib/rubysmith/cli/actions/rtc.rb
342
345
  - lib/rubysmith/cli/actions/security.rb
343
346
  - lib/rubysmith/cli/actions/setup.rb
344
347
  - lib/rubysmith/cli/actions/simple_cov.rb
@@ -349,7 +352,6 @@ files:
349
352
  - lib/rubysmith/configuration/contract.rb
350
353
  - lib/rubysmith/configuration/defaults.yml
351
354
  - lib/rubysmith/configuration/model.rb
352
- - lib/rubysmith/configuration/transformers/current_time.rb
353
355
  - lib/rubysmith/configuration/transformers/git_email.rb
354
356
  - lib/rubysmith/configuration/transformers/git_hub_user.rb
355
357
  - lib/rubysmith/configuration/transformers/git_user.rb
metadata.gz.sig CHANGED
Binary file
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "dry/monads"
4
-
5
- module Rubysmith
6
- module Configuration
7
- # Adds current time.
8
- module Transformers
9
- include Dry::Monads[:result]
10
-
11
- CurrentTime = lambda do |attributes, key = :now, at: Time.now|
12
- attributes.fetch(key) { at }
13
- .then { |value| attributes.merge! key => value }
14
- .then { |updated_attributes| Dry::Monads::Success updated_attributes }
15
- end
16
- end
17
- end
18
- end