diff --git a/Gemfile.lock b/Gemfile.lock index 97fd8efb499a39220c28e1ca25a8600f59bcb5aa..0d8b182c1137eaafec9e2e4e9f0cd4e5ba6a8b20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,7 +71,7 @@ PATH i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.1, >= 2.1.8) + zeitwerk (~> 2.2) rails (6.0.0) actioncable (= 6.0.0) actionmailbox (= 6.0.0) @@ -529,7 +529,7 @@ GEM websocket-extensions (0.1.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.1.9) + zeitwerk (2.2.0) PLATFORMS java diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index da295a0d35819764a29834e4574c689a735d98c5..5ccb655e0693082964e4e99d6b4583163cea8b89 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -34,5 +34,5 @@ s.add_dependency "tzinfo", "~> 1.1" s.add_dependency "minitest", "~> 5.1" s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2" - s.add_dependency "zeitwerk", "~> 2.1", ">= 2.1.8" + s.add_dependency "zeitwerk", "~> 2.2" end diff --git a/guides/source/autoloading_and_reloading_constants.md b/guides/source/autoloading_and_reloading_constants.md index 2fb14203ad9914e66fbbdea29020a37049194177..a8d56bb6b6ecd8c2dd3c7a9b85cefceedae1c7b8 100644 --- a/guides/source/autoloading_and_reloading_constants.md +++ b/guides/source/autoloading_and_reloading_constants.md @@ -300,18 +300,13 @@ As you see, that still uses `String#camelize` as fallback. If you instead prefer ```ruby # config/initializers/zeitwerk.rb -inflector = Class.new(Zeitwerk::Inflector) do - def camelize(basename, _abspath) - basename == "html_parser" ? "HTMLParser" : super - end -end.new - Rails.autoloaders.each do |autoloader| - autoloader.inflector = inflector + autoloader.inflector = Zeitwerk::Inflector.new + autoloader.inflector.inflect("html_parser" => "HTMLParser") end ``` -Please, check the [Zeitwerk documentation](https://github.com/fxn/zeitwerk#custom-inflector) for further details. +You can even define a custom inflector for full flexibility. Please, check the [Zeitwerk documentation](https://github.com/fxn/zeitwerk#custom-inflector) for further details. Troubleshooting ---------------