onload 1.0.4 → 1.0.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/onload/core_ext/kernel_zeitwerk.rb +6 -1
- data/lib/onload/ext/bootsnap/autoload.rb +3 -0
- data/lib/onload/version.rb +1 -1
- data/spec/rails/controllers/home_controller_spec.rb +9 -0
- data/spec/rails/dummy/app/views/home/action_list.html.erb +1 -0
- data/spec/rails/dummy/config/application.rb +2 -0
- data/spec/rails/dummy/config/routes.rb +2 -1
- data/spec/rails/dummy/lib/primer/alpha/action_list/item.rb +11 -0
- data/spec/rails/dummy/lib/primer/alpha/action_list/item.up +11 -0
- data/spec/rails/dummy/lib/primer/alpha/action_list.rb +9 -0
- data/spec/rails/dummy/lib/primer/alpha/action_list.up +9 -0
- data/spec/rails/dummy/log/test.log +2150 -0
- data/spec/rails/dummy/tmp/local_secret.txt +1 -0
- data/spec/spec_setup.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e3e322ccf2b92d128fb3bf904426cff77ba86e88ec47eb8ba9c5101dd0ae28
|
4
|
+
data.tar.gz: 5495ff350b972c47e6c992f744245d12baa57c0929d7878241f6c9a91922f17c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fd824da5c6ee8cd78342b5e0cb945353147970ebe26a4c6e16005bf8245cd5e743223441c76b7ab04216dd1757a8b3925a71b32825402d1f4becf7cbbf488c0
|
7
|
+
data.tar.gz: 8f296f7561c97af7ff6863a87fb73c3ef1c2bccb6379ca4aceb5300c13ccde937d17189de93e877c6016ab76a62f12225ce04e2494e77e229f59172c5dfd0de7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.0.5
|
2
|
+
* Fix issues with Zeitwerk v2.7.3 and later.
|
3
|
+
* Don't attempt to autoload directories.
|
4
|
+
|
1
5
|
## 1.0.4
|
2
6
|
* Fix issues with Zeitwerk v2.6.13 and later.
|
3
7
|
- Zeitwerk introduced the `Cref` class, which encapsulates a `mod` and `cname`. A number of internal methods used to return both of these things individually; now they are wrapped in `Cref`s.
|
@@ -15,7 +15,12 @@ module Kernel
|
|
15
15
|
# in order to load the resulting file. Otherwise you get an error about
|
16
16
|
# an uninitialized constant, and it's like... yeah, I _know_ it's
|
17
17
|
# uninitialized, that's why I'm loading this file. Whatevs.
|
18
|
-
loader = Zeitwerk::Registry.loader_for
|
18
|
+
loader = if Zeitwerk::Registry.respond_to?(:loader_for)
|
19
|
+
Zeitwerk::Registry.loader_for(file)
|
20
|
+
else
|
21
|
+
Zeitwerk::Registry.autoloads.registered?(file)
|
22
|
+
end
|
23
|
+
|
19
24
|
parent, cname = loader.send(:autoloads)[file]
|
20
25
|
|
21
26
|
if defined?(Zeitwerk::Cref) && parent.is_a?(Zeitwerk::Cref)
|
@@ -3,6 +3,9 @@
|
|
3
3
|
module Onload
|
4
4
|
module BootsnapAutoloadPatch
|
5
5
|
def autoload(const, path)
|
6
|
+
# only autoload files, not directories
|
7
|
+
return super if ::File.directory?(path)
|
8
|
+
|
6
9
|
# Bootsnap monkeypatches Module.autoload in order to leverage its load
|
7
10
|
# path cache, which effectively converts a relative path into an absolute
|
8
11
|
# one without incurring the cost of searching the load path.
|
data/lib/onload/version.rb
CHANGED
@@ -38,5 +38,14 @@ describe HomeController, type: :request do
|
|
38
38
|
)
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
it "supports file shadowing" do
|
43
|
+
get "/action_list"
|
44
|
+
|
45
|
+
expect(response).to have_http_status(:ok)
|
46
|
+
expect(response.body).to(
|
47
|
+
have_selector("div", text: "LIST ITEM")
|
48
|
+
)
|
49
|
+
end
|
41
50
|
end
|
42
51
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<div><%= Primer::Alpha::ActionList.new.list %></div>
|