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

Add Zeitwerk loader support #62

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

ofedoren
Copy link
Contributor

No description provided.

@ofedoren ofedoren force-pushed the feat-support-zeitwerk branch 2 times, most recently from 2473158 to 03110b9 Compare August 1, 2024 11:43
@ofedoren ofedoren force-pushed the feat-support-zeitwerk branch 2 times, most recently from e19c1f4 to 298925e Compare September 3, 2024 14:10
@evgeni
Copy link
Member

evgeni commented Sep 10, 2024

Any idea why the link test now fails?

@ofedoren
Copy link
Contributor Author

Isn't this because something wasn't updated for the tests? Like #70

@evgeni
Copy link
Member

evgeni commented Sep 10, 2024

No

@ekohl
Copy link
Contributor

ekohl commented Sep 10, 2024

 NoMethodError: undefined method `empty?' for nil:NilClass
/home/runner/work/foreman_theme_satellite/foreman_theme_satellite/foreman_theme_satellite/test/link_checker.rb:50:in `navigate_path'

I think the way it gets loaded doesn't work. The rake task doesn't load the whole Rails environment but loads one file directly.

In #58 I've taken a more native approach, but I still have to finish that.

@@ -47,7 +47,7 @@ def navigate_path(path, hash = @toc)

inner_hash = hash[first]

return inner_hash if rest.empty?
return inner_hash if rest.nil? or rest.empty?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before Zeitwerk, Rails was loaded when this test was running and Rails in its endless wisdom adds empty? to NilClass. With Zeitweirk, no Rails is present here, and so no NilClass.empty?. Let's catch that via nil? first.

@evgeni evgeni merged commit fd43f8e into RedHatSatellite:develop Sep 11, 2024
21 checks passed
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.

3 participants