Hey. I’m seeing strange behavior when teaching Zeitwork how to account for non-standard files/constants. Here’s my setup:
# demo/config/app.rb module Demo class App < Hanami::App autoloader.inflector.inflect "subject_url" => "SubjectURL" autoloader.logger = method :puts end end
# lib/demo/subject_url.rb module Demo class SubjectURL end end
When jumping into the console or RSpec, I never see this class load and end up with this error instead:
NameError: uninitialized constant Demo::SubjectURL
When looking at the Zeitwork logs being printed straight to the terminal, I should see the following:
Zeitwerk@demo: constant Demo::SubjectURL loaded from file demo/lib/demo/subject_url.rb
Instead I get no output because I think by the time I attempt to configure the autoloader, it’s already been setup via Dry System/Hanami so my custom setting is being ignored.
Is this the wrong way to configure Zeitwerk within Hanami? What should I be doing different?