Add zeitwerk for code loading
Currently we're leaning on require_relative
throughout the application to make sure all the dependent files for a given file are loaded. This works, but is brittle. And at the moment certain tests will not run in isolation as a result of, likely, lacking require_relative
statements where they need to be (test files or otherwise).
Rails and some of our surfliner products use zeitwerk for handling loading. So, it seems like we would benefit from doing the same. The dry-rb
gem(s) we're using also already depend on it, and so it's already getting pulled via bundler
and in our Gemfile.lock
.
Acceptance Criteria:
-
Zeitwerk is explicitly added to Gemfile
(despite already being installed via thedry-transaction
dependency -
configuration is put in place for zeitwerk setup -
files moved/renamed if needed to comply with zeitwerk expectations -
require_relative
lines removed from the project