rubysmith 0.8.0 → 0.11.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 (58) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.adoc +2 -5
  5. data/bin/rubysmith +0 -4
  6. data/lib/rubysmith.rb +3 -2
  7. data/lib/rubysmith/builder.rb +12 -27
  8. data/lib/rubysmith/builders/bundler.rb +11 -9
  9. data/lib/rubysmith/builders/console.rb +6 -8
  10. data/lib/rubysmith/builders/core.rb +7 -8
  11. data/lib/rubysmith/builders/documentation.rb +16 -21
  12. data/lib/rubysmith/builders/git/commit.rb +7 -11
  13. data/lib/rubysmith/builders/git/setup.rb +6 -8
  14. data/lib/rubysmith/builders/guard.rb +9 -9
  15. data/lib/rubysmith/builders/pragma.rb +9 -14
  16. data/lib/rubysmith/builders/rake.rb +5 -7
  17. data/lib/rubysmith/builders/reek.rb +6 -8
  18. data/lib/rubysmith/builders/rspec/context.rb +10 -11
  19. data/lib/rubysmith/builders/rspec/helper.rb +6 -8
  20. data/lib/rubysmith/builders/rubocop/formatter.rb +5 -7
  21. data/lib/rubysmith/builders/rubocop/setup.rb +7 -9
  22. data/lib/rubysmith/builders/ruby_critic.rb +6 -8
  23. data/lib/rubysmith/builders/setup.rb +8 -8
  24. data/lib/rubysmith/cli/configuration/content.rb +68 -0
  25. data/lib/rubysmith/cli/{defaults.yml → configuration/defaults.yml} +0 -1
  26. data/lib/rubysmith/cli/configuration/loader.rb +35 -0
  27. data/lib/rubysmith/cli/parsers.rb +11 -0
  28. data/lib/rubysmith/cli/parsers/assembler.rb +10 -15
  29. data/lib/rubysmith/cli/parsers/build.rb +4 -12
  30. data/lib/rubysmith/cli/parsers/core.rb +5 -9
  31. data/lib/rubysmith/cli/processors/build.rb +10 -11
  32. data/lib/rubysmith/cli/processors/config.rb +3 -7
  33. data/lib/rubysmith/cli/shell.rb +9 -17
  34. data/lib/rubysmith/identity.rb +1 -1
  35. data/lib/rubysmith/pathway.rb +3 -9
  36. data/lib/rubysmith/renderers/erb.rb +7 -9
  37. data/lib/rubysmith/renderers/namespace.rb +1 -3
  38. data/lib/rubysmith/templates/%project_name%/.rubocop.yml.erb +5 -5
  39. data/lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb +1 -1
  40. data/lib/rubysmith/templates/%project_name%/CHANGES.md.erb +1 -1
  41. data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb +2 -2
  42. data/lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.md.erb +1 -1
  43. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +16 -17
  44. data/lib/rubysmith/templates/%project_name%/LICENSE-apache.adoc.erb +1 -1
  45. data/lib/rubysmith/templates/%project_name%/LICENSE-apache.md.erb +1 -1
  46. data/lib/rubysmith/templates/%project_name%/LICENSE-mit.adoc.erb +1 -1
  47. data/lib/rubysmith/templates/%project_name%/LICENSE-mit.md.erb +1 -1
  48. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +5 -5
  49. data/lib/rubysmith/templates/%project_name%/README.md.erb +5 -5
  50. data/lib/rubysmith/templates/%project_name%/Rakefile.erb +13 -19
  51. data/lib/rubysmith/templates/%project_name%/bin/console.erb +1 -1
  52. data/lib/rubysmith/templates/%project_name%/lib/%project_name%.rb.erb +1 -1
  53. data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +8 -3
  54. data/lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb +4 -4
  55. metadata +19 -18
  56. metadata.gz.sig +0 -0
  57. data/lib/rubysmith/cli/configuration.rb +0 -30
  58. data/lib/rubysmith/realm.rb +0 -74
@@ -1,6 +1,6 @@
1
- # <%= realm.project_label %>
1
+ # <%= configuration.project_label %>
2
2
 
3
- <% if realm.build_rubocop %>
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
6
 
@@ -16,7 +16,7 @@
16
16
  1. [Ruby](https://www.ruby-lang.org)
17
17
 
18
18
  ## Setup
19
- <% if realm.build_setup %>
19
+ <% if configuration.build_setup %>
20
20
 
21
21
  To set up the project, run:
22
22
 
@@ -26,7 +26,7 @@ To set up the project, run:
26
26
  ## Usage
27
27
 
28
28
  ## Development
29
- <% if realm.build_console %>
29
+ <% if configuration.build_console %>
30
30
 
31
31
  You can also use the IRB console for direct access to all objects:
32
32
 
@@ -67,4 +67,4 @@ Built with [Rubysmith](https://www.alchemists.io/projects/rubysmith).
67
67
 
68
68
  ## Credits
69
69
 
70
- Engineered by [<%= realm.author_name %>](<%= realm.author_url %>).
70
+ Engineered by [<%= configuration.author_name %>](<%= configuration.author_url %>).
@@ -1,47 +1,41 @@
1
1
  require "bundler/setup"
2
2
 
3
- <% if realm.build_bundler_audit %>
4
- require "bundler/audit/task"
5
- <% end %>
6
- <% if realm.build_bundler_leak %>
3
+ <% if configuration.build_bundler_leak %>
7
4
  require "bundler/plumber/task"
8
5
  <% end %>
9
- <% if realm.build_git && realm.build_git_lint %>
6
+ <% if configuration.build_git && configuration.build_git_lint %>
10
7
  require "git/lint/rake/setup"
11
8
  <% end %>
12
- <% if realm.build_reek %>
9
+ <% if configuration.build_reek %>
13
10
  require "reek/rake/task"
14
11
  <% end %>
15
- <% if realm.build_rspec %>
12
+ <% if configuration.build_rspec %>
16
13
  require "rspec/core/rake_task"
17
14
  <% end %>
18
- <% if realm.build_rubocop %>
15
+ <% if configuration.build_rubocop %>
19
16
  require "rubocop/rake_task"
20
17
  <% end %>
21
- <% if realm.build_ruby_critic %>
18
+ <% if configuration.build_ruby_critic %>
22
19
  require "rubycritic/rake_task"
23
20
  <% end %>
24
21
 
25
- <% if realm.build_bundler_audit %>
26
- Bundler::Audit::Task.new
27
- <% end %>
28
- <% if realm.build_bundler_leak %>
22
+ <% if configuration.build_bundler_leak %>
29
23
  Bundler::Plumber::Task.new
30
24
  <% end %>
31
- <% if realm.build_reek %>
25
+ <% if configuration.build_reek %>
32
26
  Reek::Rake::Task.new
33
27
  <% end %>
34
- <% if realm.build_rspec %>
28
+ <% if configuration.build_rspec %>
35
29
  RSpec::Core::RakeTask.new :spec
36
30
  <% end %>
37
- <% if realm.build_rubocop %>
31
+ <% if configuration.build_rubocop %>
38
32
  RuboCop::RakeTask.new
39
33
  <% end %>
40
- <% if realm.build_ruby_critic %>
34
+ <% if configuration.build_ruby_critic %>
41
35
  RubyCritic::RakeTask.new
42
36
  <% end %>
43
37
 
44
38
  desc "Run code quality checks"
45
- task code_quality: %i[<% if realm.build_bundler_audit %>bundle:audit<% end %> <% if realm.build_bundler_leak %>bundle:leak<% end %> <% if realm.build_git && realm.build_git_lint %>git_lint<% end %> <% if realm.build_reek %>reek<% end %> <% if realm.build_rubocop %>rubocop<% end %> <% if realm.build_ruby_critic %>rubycritic<% end %>]
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 %>]
46
40
 
47
- task default: %i[code_quality <% if realm.build_rspec %>spec<% end %>]
41
+ 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/<%= realm.project_name %>"
6
+ require_relative "../lib/<%= configuration.project_name %>"
7
7
  require "irb"
8
8
 
9
9
  IRB.start __FILE__
@@ -1,3 +1,3 @@
1
1
  # The project namespace.
2
- module <%= realm.project_class %>
2
+ module <%= configuration.project_class %>
3
3
  end
@@ -1,15 +1,20 @@
1
1
  require "bundler/setup"
2
2
  Bundler.require :tools
3
3
 
4
- <% if realm.build_simple_cov %>
4
+ <% if configuration.build_simple_cov %>
5
5
  require "simplecov"
6
6
  SimpleCov.start { enable_coverage :branch }
7
7
  <% end %>
8
8
 
9
- require "<%= realm.project_name %>"
10
- <% if realm.build_refinements %>
9
+ require "<%= configuration.project_name %>"
10
+ <% if configuration.build_refinements %>
11
11
  require "refinements"
12
+ <% end %>
13
+
14
+ GC.auto_compact = true
15
+ GC.verify_compaction_references double_heap: true, toward: :empty
12
16
 
17
+ <% if configuration.build_refinements %>
13
18
  using Refinements::Pathnames
14
19
 
15
20
  Pathname.require_tree __dir__, "support/shared_contexts/**/*.rb"
@@ -1,11 +1,11 @@
1
- RSpec.shared_context "with temporary directory", :temp_dir do
2
- <% if realm.build_refinements %>using Refinements::Pathnames<% end %>
1
+ RSpec.shared_context "with temporary directory" do
2
+ <% if configuration.build_refinements %>using Refinements::Pathnames<% end %>
3
3
 
4
4
  let(:temp_dir) { Bundler.root.join "tmp/rspec" }
5
5
 
6
6
  around do |example|
7
- <%= realm.build_refinements ? "temp_dir.make_path" : "FileUtils.mkdir_p temp_dir" %>
7
+ <%= configuration.build_refinements ? "temp_dir.make_path" : "FileUtils.mkdir_p temp_dir" %>
8
8
  example.run
9
- <%= realm.build_refinements ? "temp_dir.remove_tree" : "FileUtils.rm_rf temp_dir" %>
9
+ <%= configuration.build_refinements ? "temp_dir.remove_tree" : "FileUtils.rm_rf temp_dir" %>
10
10
  end
11
11
  end
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.8.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbz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G9KsrmIydlzYfsD09aXKx0t6Xy4
28
- 2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
- QWc=
23
+ 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAEjpaOXHHp8s/7GL2qCb
24
+ YAs7urOLv9VHSPfQWAwaTMVnSsIf3Sw4xzISOP/mmfEPBPXtz61K5esrE/uTFtgb
25
+ FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
26
+ 66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
27
+ cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
28
+ lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
+ W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-12-30 00:00:00.000000000 Z
31
+ date: 2021-08-08 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pragmater
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.5'
67
+ version: '1.14'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '1.5'
74
+ version: '1.14'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: runcom
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -117,8 +117,10 @@ files:
117
117
  - lib/rubysmith/builders/rubocop/setup.rb
118
118
  - lib/rubysmith/builders/ruby_critic.rb
119
119
  - lib/rubysmith/builders/setup.rb
120
- - lib/rubysmith/cli/configuration.rb
121
- - lib/rubysmith/cli/defaults.yml
120
+ - lib/rubysmith/cli/configuration/content.rb
121
+ - lib/rubysmith/cli/configuration/defaults.yml
122
+ - lib/rubysmith/cli/configuration/loader.rb
123
+ - lib/rubysmith/cli/parsers.rb
122
124
  - lib/rubysmith/cli/parsers/assembler.rb
123
125
  - lib/rubysmith/cli/parsers/build.rb
124
126
  - lib/rubysmith/cli/parsers/core.rb
@@ -127,7 +129,6 @@ files:
127
129
  - lib/rubysmith/cli/shell.rb
128
130
  - lib/rubysmith/identity.rb
129
131
  - lib/rubysmith/pathway.rb
130
- - lib/rubysmith/realm.rb
131
132
  - lib/rubysmith/renderers/erb.rb
132
133
  - lib/rubysmith/renderers/namespace.rb
133
134
  - lib/rubysmith/templates/%project_name%/.reek.yml.erb
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  - !ruby/object:Gem::Version
181
182
  version: '0'
182
183
  requirements: []
183
- rubygems_version: 3.2.3
184
+ rubygems_version: 3.2.25
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "pathname"
4
- require "refinements/hashes"
5
- require "runcom"
6
- require "yaml"
7
-
8
- module Rubysmith
9
- module CLI
10
- # Represents the fully assembled Command Line Interface (CLI) configuration.
11
- class Configuration
12
- using Refinements::Hashes
13
-
14
- DEFAULTS = YAML.load_file(Pathname(__dir__).join("defaults.yml")).freeze
15
- CLIENT = Runcom::Config.new "#{Identity::NAME}/configuration.yml", defaults: DEFAULTS
16
-
17
- def initialize client: CLIENT
18
- @client = client
19
- end
20
-
21
- def to_h
22
- client.to_h.flatten_keys
23
- end
24
-
25
- private
26
-
27
- attr_reader :client
28
- end
29
- end
30
- end
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "pathname"
4
- require "refinements/strings"
5
-
6
- module Rubysmith
7
- REALM_KEYS = %i[
8
- config
9
- template_root
10
- template_path
11
- build_root
12
- project_name
13
- author_name
14
- author_email
15
- author_url
16
- now
17
- documentation_format
18
- documentation_license
19
- build_minimum
20
- build_amazing_print
21
- build_bundler_audit
22
- build_bundler_leak
23
- build_console
24
- build_documentation
25
- build_git
26
- build_git_lint
27
- build_guard
28
- build_pry
29
- build_reek
30
- build_refinements
31
- build_rspec
32
- build_rubocop
33
- build_ruby_critic
34
- build_setup
35
- build_simple_cov
36
- builders_pragmater_comments
37
- builders_pragmater_includes
38
- version
39
- help
40
- ].freeze
41
-
42
- # Represents the common context in which all builders and templates operate in.
43
- Realm = Struct.new(*REALM_KEYS, keyword_init: true) do
44
- using Refinements::Strings
45
-
46
- def initialize *arguments
47
- super
48
-
49
- self[:template_root] ||= Pathname(__dir__).join("templates").expand_path
50
- self[:build_root] ||= Pathname.pwd
51
- freeze
52
- end
53
-
54
- def with attributes
55
- self.class.new to_h.merge(attributes)
56
- end
57
-
58
- def project_label
59
- project_name.titleize
60
- end
61
-
62
- def project_class
63
- project_name.camelcase
64
- end
65
-
66
- def project_root
67
- build_root.join project_name
68
- end
69
-
70
- def to_pathway
71
- Pathway[start_root: template_root, start_path: template_path, end_root: build_root]
72
- end
73
- end
74
- end