mirror of https://github.com/rails/rails
bump Zeitwerk to 2.2
This commit is contained in:
parent
a3d54d2afe
commit
245f255318
|
@ -74,7 +74,7 @@ PATH
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
zeitwerk (~> 2.1, >= 2.1.8)
|
zeitwerk (~> 2.2)
|
||||||
rails (6.1.0.alpha)
|
rails (6.1.0.alpha)
|
||||||
actioncable (= 6.1.0.alpha)
|
actioncable (= 6.1.0.alpha)
|
||||||
actionmailbox (= 6.1.0.alpha)
|
actionmailbox (= 6.1.0.alpha)
|
||||||
|
@ -534,7 +534,7 @@ GEM
|
||||||
websocket-extensions (0.1.3)
|
websocket-extensions (0.1.3)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
zeitwerk (2.1.9)
|
zeitwerk (2.2.0)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
java
|
java
|
||||||
|
|
|
@ -34,5 +34,5 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency "tzinfo", "~> 1.1"
|
s.add_dependency "tzinfo", "~> 1.1"
|
||||||
s.add_dependency "minitest", "~> 5.1"
|
s.add_dependency "minitest", "~> 5.1"
|
||||||
s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
|
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
|
end
|
||||||
|
|
|
@ -300,18 +300,13 @@ As you see, that still uses `String#camelize` as fallback. If you instead prefer
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# config/initializers/zeitwerk.rb
|
# 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|
|
Rails.autoloaders.each do |autoloader|
|
||||||
autoloader.inflector = inflector
|
autoloader.inflector = Zeitwerk::Inflector.new
|
||||||
|
autoloader.inflector.inflect("html_parser" => "HTMLParser")
|
||||||
end
|
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
|
Troubleshooting
|
||||||
---------------
|
---------------
|
||||||
|
|
Loading…
Reference in New Issue