Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zeitwerk loader #105

Merged
merged 3 commits into from
Dec 16, 2023
Merged

Fix zeitwerk loader #105

merged 3 commits into from
Dec 16, 2023

Conversation

hasghari
Copy link
Contributor

Currently, none of the files in this gem are auto-loaded when this gem is included in the Gemfile as:

gem 'cloudflare-rails`

The reason is that bundler will automatically require a file from the gem load path with exactly the same name, but the file cloudflare-rails.rb does not exist in this gem so none of the files are required. When I manually required the correct file using:

gem 'cloudflare-rails`, require: 'cloudflare_rails'

I got the error NameError: uninitialized constant CloudflareRails

A quick look into Zeitwerk revealed that loader.eager_load should be called after the CloudflareRails constant has been defined.

@modosc modosc merged commit aeb9677 into modosc:main Dec 16, 2023
2 checks passed
@modosc
Copy link
Owner

modosc commented Dec 16, 2023

@hasghari i just released 5.0.1 with your fix, thanks again!

@hasghari hasghari deleted the fix-zeitwerk branch December 16, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants