orthoses-rails 1.11.0 → 1.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c9482134d9de45a876c64bbf68c79d4a2f6f27fd34ac465a79286c39a46165
4
- data.tar.gz: 2856b80e4f71791520d1bdee1b245d241d408083a59c17792dc26b071695c952
3
+ metadata.gz: a5c988c0b04839966cef88722575bce1ce8e39d540e40260e41f49411574453f
4
+ data.tar.gz: 1ec7e0b8adf350623d846c18e97864fb92f099ba7db89eed4501da2ee496cc0a
5
5
  SHA512:
6
- metadata.gz: 5e66c9cb25787230c8ecc4e54ce503d6a6902b4b8bf0330ed29dac808a43ff1dc2792f8b8a2bcf4b08c7e49eb0527363b9db4f39ce221dd267cee5deeae54562
7
- data.tar.gz: c3c1e76d84e60daac79d556e83e0872fca4f33bac9450d04ceb628fa3c9e58ddc67f0195eeee0cf2f17e16cf22e84d1ce6e5e172bc1fc5ae70d648d22b6d577a
6
+ metadata.gz: 8e0cc69bf6e79be6c95f98dbe19a9c1896c6f649783040df8c23bfab233471a3643e2dce434ee3343107de64370ea7a28dafeb17a265da336d6fa447dc24b8dc
7
+ data.tar.gz: 30dd1747716e4952810425f750175b6e2071583a22f790ab959311231bdaa452467d670945e54294c676fad439ce43126922e63e9356c68609f90bb4884a242b
data/README.md CHANGED
@@ -26,7 +26,9 @@ $ bundle exec rails orthoses:rails
26
26
 
27
27
  Output is stored in the `sig/orthoses` directory.
28
28
 
29
- ## Output example
29
+ ## Example
30
+
31
+ ### Inputs
30
32
 
31
33
  ```rb
32
34
  class User < ApplicationRecord
@@ -34,6 +36,8 @@ class User < ApplicationRecord
34
36
  end
35
37
  ```
36
38
 
39
+ ### Outputs
40
+
37
41
  ```rbs
38
42
  class User < ::ApplicationRecord
39
43
  include User::GeneratedAssociationMethods
@@ -43,6 +43,7 @@ module Orthoses
43
43
 
44
44
  store[class_specific_proxy].tap do |c|
45
45
  c.header = "class #{class_specific_proxy} < ::ActiveRecord::Associations::CollectionProxy"
46
+ c << "include #{class_specific_generated_relation_methods}"
46
47
  c << "include _ActiveRecord_Relation[#{model_name}, #{primary_key}]"
47
48
  c << "include Enumerable[#{model_name}]"
48
49
  end
@@ -43,6 +43,11 @@ module Orthoses
43
43
  use Orthoses::ActiveSupport::Delegation
44
44
  use Orthoses::ActiveSupport::Configurable
45
45
  use Orthoses::ActiveSupport::MattrAccessor
46
+
47
+ if defined?(::Zeitwerk)
48
+ use Orthoses::Zeitwerk
49
+ end
50
+
46
51
  reset_runner loader
47
52
  end.call
48
53
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Orthoses
4
4
  module Rails
5
- VERSION = "1.11.0"
5
+ VERSION = "1.12.0"
6
6
  end
7
7
  end
@@ -9,6 +9,7 @@ require_relative 'active_record'
9
9
  require_relative 'active_storage'
10
10
  require_relative 'active_support'
11
11
  require_relative 'railties'
12
+ require_relative 'zeitwerk'
12
13
 
13
14
  require_relative "rails/application"
14
15
  require_relative "rails/version"
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orthoses
4
+ class Zeitwerk
5
+ def initialize(loader)
6
+ @loader = loader
7
+ end
8
+
9
+ def call
10
+ tracer = Orthoses::CallTracer::Lazy.new
11
+ tracer.trace('Zeitwerk::Cref#set') do
12
+ @loader.call
13
+ end.tap do |store|
14
+ tracer.captures.each do |capture|
15
+ value = capture.argument[:value]
16
+ name = Orthoses::Utils.module_name(value) or next
17
+ next unless value.is_a?(Module)
18
+
19
+ store[name].header = "module #{name}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orthoses-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-11 00:00:00.000000000 Z
10
+ date: 2025-07-15 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: orthoses
@@ -69,6 +69,7 @@ files:
69
69
  - lib/orthoses/railties.rb
70
70
  - lib/orthoses/railties/mixin.rb
71
71
  - lib/orthoses/shims.rb
72
+ - lib/orthoses/zeitwerk.rb
72
73
  - sig/orthoses/rails.rbs
73
74
  homepage: https://github.com/ksss/orthoses-rails
74
75
  licenses: