Skip to content

Commit

Permalink
Merge pull request #22801 from jrafanie/there_can_be_only_one_autoloa…
Browse files Browse the repository at this point in the history
…der_zeitwerk

There can be only one autoloader: zeitwerk

(cherry picked from commit 7a3c4a6)
  • Loading branch information
Fryguy committed Jan 5, 2024
1 parent 4b3220b commit adfada4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 73 deletions.
22 changes: 10 additions & 12 deletions config/initializers/zeitwerk.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
if Rails.application.config.autoloader == :zeitwerk && Rails.autoloaders.main
if ENV['DEBUG_MANAGEIQ_ZEITWERK'].present?
Zeitwerk::Loader.default_logger = method(:puts)
Rails.autoloaders.main.logger = Logger.new($stdout)
end

# These specific directories are for code organization, not namespacing:
# TODO: these should be either renamed with good names, the intermediate directory removed
# and/or both.
Rails.autoloaders.main.collapse(Rails.root.join("lib/manageiq/reporting/charting"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator"))
if ENV['DEBUG_MANAGEIQ_ZEITWERK'].present?
Zeitwerk::Loader.default_logger = method(:puts)
Rails.autoloaders.main.logger = Logger.new($stdout)
end

# These specific directories are for code organization, not namespacing:
# TODO: these should be either renamed with good names, the intermediate directory removed
# and/or both.
Rails.autoloaders.main.collapse(Rails.root.join("lib/manageiq/reporting/charting"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator"))
31 changes: 0 additions & 31 deletions lib/extensions/as_dependencies_interlock.rb

This file was deleted.

30 changes: 0 additions & 30 deletions spec/initializers/yaml_autoloader_spec.rb

This file was deleted.

0 comments on commit adfada4

Please sign in to comment.