tapioca 0.11.10 → 0.11.11

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: dd1124c2c3feac470d361a45577dc6384e85873e93f19a2bea4eb91b01da593c
4
- data.tar.gz: 0d6a664089314ff666abd93615dae440274af183b0a7ef2d60035cee73299de9
3
+ metadata.gz: 84489402f0ea53d60251615f8b40358f946e88fd302d33d2b06adb09bfadfeb6
4
+ data.tar.gz: 34f1790682595d9f63479463c6a3e76dbff2682e40680e9d0971fb7ce3fd7de8
5
5
  SHA512:
6
- metadata.gz: b599a8e5a0dbee29e0e64ff458eb7a6e7c85c3beb0ffae20ae3487fb1d080714e80490d0e0c089bc32ab9dd33670901692396fc2d25c2064d0ab8012158dbb4b
7
- data.tar.gz: b2a58b28c77a0b33c9f83f48f2663c106b9dc465ae137c6f71ac04601dbf3ec63ca8c6b7fde45820577c2d0bd237a65ce07a45f440195b5514a20614f33e80e5
6
+ metadata.gz: 8defde6f57d9d373d2982e7450ac217e0ba7e3cc2402ec740b124bdd0a7e1def41bf8bc8432699029016c98c83fd0c036248879ec6532869b350facdde4a4bc5
7
+ data.tar.gz: f8225d925a796ba74424637b6b843c5a53a14fb52de6e5fcce4751a136639f3738d48373f053111cc5958ba55e3bbda055d00259b629b94cd0b80b2f4c815b44
@@ -80,8 +80,6 @@ module Tapioca
80
80
  def load_rails_engines
81
81
  return if engines.empty?
82
82
 
83
- normalize_eager_load_paths_configuration!
84
-
85
83
  with_rails_application do
86
84
  run_initializers
87
85
 
@@ -112,7 +110,7 @@ module Tapioca
112
110
  autoloader = Zeitwerk::Loader.new
113
111
 
114
112
  engines.each do |engine|
115
- engine.config.all_eager_load_paths.each do |path|
113
+ eager_load_paths(engine).each do |path|
116
114
  # Zeitwerk only accepts existing directories in `push_dir`.
117
115
  next unless File.directory?(path)
118
116
  # We should not add directories that are already managed by a Zeitwerk loader.
@@ -133,7 +131,7 @@ module Tapioca
133
131
  # We can't use `Rails::Engine#eager_load!` directly because it will raise as soon as it encounters
134
132
  # an error, which is not what we want. We want to try to load as much as we can.
135
133
  engines.each do |engine|
136
- engine.config.all_eager_load_paths.each do |load_path|
134
+ eager_load_paths(engine).each do |load_path|
137
135
  Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
138
136
  require_dependency file
139
137
  end
@@ -181,19 +179,6 @@ module Tapioca
181
179
  .reject { |engine| gem_in_app_dir?(project_path, engine.config.root.to_path) }
182
180
  end
183
181
 
184
- # Rails 7.2 renamed `eager_load_paths` to `all_eager_load_paths`, which maintains the same original functionality.
185
- # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some
186
- # engine paths. The following commit is the change:
187
- # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
188
- #
189
- # Here we make sure that the new `all_eager_load_paths` is always defined for every Rails version below 7.2, so
190
- # that we can use it everywhere
191
- def normalize_eager_load_paths_configuration!
192
- return if Rails::VERSION::MAJOR >= 7 && Rails::VERSION::MINOR >= 2
193
-
194
- engines.each { |e| e.config.all_eager_load_paths = e.config.eager_load_paths }
195
- end
196
-
197
182
  sig { params(path: String).void }
198
183
  def safe_require(path)
199
184
  require path
@@ -239,6 +224,17 @@ module Tapioca
239
224
 
240
225
  require(file)
241
226
  end
227
+
228
+ # Rails 7.2 renamed `eager_load_paths` to `all_eager_load_paths`, which maintains the same original functionality.
229
+ # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some
230
+ # engine paths. The following commit is the change:
231
+ # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
232
+ sig { params(engine: T.class_of(Rails::Engine)).returns(T::Array[String]) }
233
+ def eager_load_paths(engine)
234
+ config = engine.config
235
+
236
+ (config.respond_to?(:all_eager_load_paths) && config.all_eager_load_paths) || config.eager_load_paths
237
+ end
242
238
  end
243
239
  end
244
240
  end
@@ -27,7 +27,15 @@ module Tapioca
27
27
 
28
28
  return Set.new unless gem_engine
29
29
 
30
- paths = gem_engine.config.all_eager_load_paths.flat_map do |load_path|
30
+ # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
31
+ config = gem_engine.config
32
+ eager_load_paths = if config.respond_to?(:all_eager_load_paths)
33
+ config.all_eager_load_paths
34
+ else
35
+ config.eager_load_paths
36
+ end
37
+
38
+ paths = eager_load_paths.flat_map do |load_path|
31
39
  Pathname.glob("#{load_path}/**/*.rb")
32
40
  end
33
41
 
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.11.10"
5
+ VERSION = "0.11.11"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.10
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2023-10-31 00:00:00.000000000 Z
14
+ date: 2023-11-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -59,22 +59,22 @@ dependencies:
59
59
  name: rbi
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
63
- - !ruby/object:Gem::Version
64
- version: 0.1.0
65
62
  - - ">="
66
63
  - !ruby/object:Gem::Version
67
- version: 0.1.0
64
+ version: 0.1.4
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.2'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.1.0
75
72
  - - ">="
76
73
  - !ruby/object:Gem::Version
77
- version: 0.1.0
74
+ version: 0.1.4
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: '0.2'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: sorbet-static-and-runtime
80
80
  requirement: !ruby/object:Gem::Requirement