rubysmith 5.8.0 → 5.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 568f4c4199f483d0db9ee5b6b05cfd4fccc199e85713312df8e244df9f8ceeb8
4
- data.tar.gz: 3ff0234f2b8ecd0fcaadcff596df5e2320f7421b05a7ecab729ffa095b574c4e
3
+ metadata.gz: 9d18353c1dce13dfdc3f143b94e12dcc800ad74a790a64a3afb218b7e79710e1
4
+ data.tar.gz: 8a96b5eae4af1d8ba2ce38a9c1140b8088e50b84de7942ce958e895174d6292b
5
5
  SHA512:
6
- metadata.gz: 0d034108bc24dca79413973ceaa423cf7aca6d0c8c8fb1f83969bef4f8ca56e6cb754ff6048c377fe4f960f277c01a44f92a2f676d9dc1a6c6f8a6869d615b27
7
- data.tar.gz: b2e84e51d928d44e9a529258ae4cc6ae27ed1720f436a19f040335e86a10069b16870affd0fe9acb5c7800c0f9cfeb3f3072f44dcca7b34a3a3260fb3acc86f2
6
+ metadata.gz: 2bcccf6876cc8fb44785288892a9dcf2136061823400fb2e6cd72d61e6a18a58a002ca027aa2d9f19ce38c1e02e591bb3e7b6960d07d7b24003779c304eab80d
7
+ data.tar.gz: 98f760e9ed26dcb232daaa4ac0fe89793fd7a809848d237ffe283bfa9fec811ee56138272a4ff8206dc5e7707e9440bb9874d1fc75c5b1dbae690578378a092e
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- ��Յ��X�":
2
- \����s3��@�R�ꆩ�W�7�N�(�gcTy�!����ʩ0�4���>Tm�t�ۂm�v/�Ě�j��Ǿ�P<_��T[E����s�}�v�P��0�v .�]���o�U1���$���*�[qj������vA1U%�s%��u��(Q}��D)��u��(T���Ϟ~IH�e��(�o��$L�uMY�{\M�튰��Q& Z��
1
+ U��
2
+ 9Sv��ĺC�7(���4�_�ߑ����{��x���#o"W'�Ґ�>_E?� ĒGy�׹/Oy
3
+ �QKnQ�l�D���_�'V:��r��M�sy�xIfK�s���%-=1X=�h������j�}�F>��̘G=�Q@�т��sP3�y}�nTqA��x��:�4�B�{�c/�-��O�[dv`36����
4
+ >!E����|60D)��T������\�E��
@@ -18,18 +18,28 @@ module Rubysmith
18
18
  end
19
19
 
20
20
  def call
21
+ render_implementation
22
+ render_specification
23
+ configuration
24
+ end
25
+
26
+ private
27
+
28
+ def render_implementation
21
29
  builder.call(configuration.merge(template_path: "%project_name%/lib/%project_path%.rb.erb"))
22
30
  .render
23
31
  .replace(" require", "require")
24
32
  .replace(/ (?=(Zeit|loader|end))/, "")
25
33
  .replace("\n \n", "\n\n")
26
34
  .insert_before("module #{module_name}", "#{indentation}# Main namespace.\n")
27
- .replace("end\n end", " end\n end")
28
-
29
- configuration
30
35
  end
31
36
 
32
- private
37
+ def render_specification
38
+ return unless configuration.build_zeitwerk
39
+
40
+ path = "%project_name%/spec/lib/%project_path%_spec.rb.erb"
41
+ builder.call(configuration.merge(template_path: path)).render
42
+ end
33
43
 
34
44
  def indentation = ::Core::EMPTY_STRING.indent configuration.project_levels
35
45
 
@@ -2,12 +2,14 @@
2
2
 
3
3
  require "bundler"
4
4
  require "bundler/cli"
5
+ require "refinements/ios"
5
6
  require "refinements/pathnames"
6
7
 
7
8
  module Rubysmith
8
9
  module Extensions
9
10
  # Ensures gem dependencies are installed.
10
11
  class Bundler
12
+ using Refinements::IOs
11
13
  using Refinements::Pathnames
12
14
 
13
15
  def self.call(...) = new(...).call
@@ -18,7 +20,11 @@ module Rubysmith
18
20
  end
19
21
 
20
22
  def call
21
- configuration.project_root.change_dir { client.start %w[install --quiet] }
23
+ configuration.project_root.change_dir do
24
+ client.start %w[install --quiet]
25
+ STDOUT.squelch { client.start %w[lock --add-platform x86_64-linux --update] }
26
+ end
27
+
22
28
  configuration
23
29
  end
24
30
 
@@ -8,20 +8,20 @@ jobs:
8
8
  - checkout
9
9
 
10
10
  - restore_cache:
11
- name: Bundler Restore
11
+ name: Gems Restore
12
12
  keys:
13
13
  - gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
14
14
  - gem-cache-
15
15
 
16
16
  - run:
17
- name: Bundler Install
17
+ name: Gems Install
18
18
  command: |
19
19
  gem update --system
20
20
  bundle config set path "vendor/bundle"
21
21
  bundle install
22
22
 
23
23
  - save_cache:
24
- name: Bundler Store
24
+ name: Gems Store
25
25
  key: gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
26
26
  paths:
27
27
  - vendor/bundle
@@ -32,7 +32,7 @@ jobs:
32
32
 
33
33
  <% if configuration.build_simple_cov %>
34
34
  - store_artifacts:
35
- name: SimpleCov Artifacts Upload
35
+ name: SimpleCov Report
36
36
  path: ~/project/coverage
37
37
  destination: coverage
38
38
  <% end %>
@@ -11,16 +11,16 @@ jobs:
11
11
  - name: Checkout
12
12
  uses: actions/checkout@v3
13
13
 
14
- - name: Setup Ruby
14
+ - name: Ruby Setup
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  bundler-cache: true
18
18
 
19
- - name: Rake
19
+ - name: Build
20
20
  run: bundle exec rake
21
21
 
22
22
  <% if configuration.build_simple_cov %>
23
- - name: Archive SimpleCov Report
23
+ - name: SimpleCov Report
24
24
  uses: actions/upload-artifact@v3
25
25
  with:
26
26
  name: coverage
@@ -16,7 +16,15 @@
16
16
  <% end %>
17
17
  <% if configuration.build_zeitwerk %>
18
18
  <% namespace do %>
19
- def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
19
+ <% if configuration.project_levels.positive? %>
20
+ def self.loader registry = Zeitwerk::Registry
21
+ @loader ||= registry.loaders.find { |loader| loader.tag == "<%= configuration.project_name %>" }
22
+ end
23
+ <% else %>
24
+ def self.loader registry = Zeitwerk::Registry
25
+ @loader ||= registry.loaders.find { |loader| loader.tag == File.basename(__FILE__, ".rb") }
26
+ end
27
+ <% end %>
20
28
  <% end %>
21
29
  <% else %>
22
30
  <% namespace %>
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe <%= configuration.project_namespaced_class %> do
4
+ describe ".loader" do
5
+ it "eager loads" do
6
+ expectation = proc { described_class.loader.eager_load force: true }
7
+ expect(&expectation).not_to raise_error
8
+ end
9
+
10
+ it "answers unique tag" do
11
+ expect(described_class.loader.tag).to eq("<%= configuration.project_name %>")
12
+ end
13
+ end
14
+ end
data/lib/rubysmith.rb CHANGED
@@ -15,5 +15,7 @@ end
15
15
 
16
16
  # Main namespace.
17
17
  module Rubysmith
18
- def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
18
+ def self.loader registry = Zeitwerk::Registry
19
+ @loader ||= registry.loaders.find { |loader| loader.tag == File.basename(__FILE__, ".rb") }
20
+ end
19
21
  end
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 = "5.8.0"
5
+ spec.version = "5.9.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/rubysmith"
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = "~> 3.2"
25
+ spec.required_ruby_version = [">= 3.2", "<= 3.3"]
26
26
  spec.add_dependency "cogger", "~> 0.12"
27
27
  spec.add_dependency "dry-container", "~> 0.11"
28
28
  spec.add_dependency "dry-monads", "~> 1.6"
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: 5.8.0
4
+ version: 5.9.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: 2023-10-15 00:00:00.000000000 Z
38
+ date: 2023-12-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -396,6 +396,7 @@ files:
396
396
  - lib/rubysmith/templates/%project_name%/bin/rubocop.erb
397
397
  - lib/rubysmith/templates/%project_name%/bin/setup.erb
398
398
  - lib/rubysmith/templates/%project_name%/lib/%project_path%.rb.erb
399
+ - lib/rubysmith/templates/%project_name%/spec/lib/%project_path%_spec.rb.erb
399
400
  - lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb
400
401
  - lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb
401
402
  - lib/rubysmith/text/inserter.rb
@@ -417,16 +418,19 @@ require_paths:
417
418
  - lib
418
419
  required_ruby_version: !ruby/object:Gem::Requirement
419
420
  requirements:
420
- - - "~>"
421
+ - - ">="
421
422
  - !ruby/object:Gem::Version
422
423
  version: '3.2'
424
+ - - "<="
425
+ - !ruby/object:Gem::Version
426
+ version: '3.3'
423
427
  required_rubygems_version: !ruby/object:Gem::Requirement
424
428
  requirements:
425
429
  - - ">="
426
430
  - !ruby/object:Gem::Version
427
431
  version: '0'
428
432
  requirements: []
429
- rubygems_version: 3.4.20
433
+ rubygems_version: 3.4.22
430
434
  signing_key:
431
435
  specification_version: 4
432
436
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file