diff options
author | Xavier Noria <fxn@hashref.com> | 2019-02-12 09:45:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 09:45:08 -0800 |
commit | ed9acb4fcc793ce1ab68a0e5076dc9458cc7f218 (patch) | |
tree | af4d3c2e10518d8d0cf51da2dd3329132ff0f006 /railties/lib/rails.rb | |
parent | 2edeb438e6d5289cd0227fb73ab731839177fed6 (diff) | |
parent | 96de00e5a7f07c1641e1b7ac8a64ba5c0c7af209 (diff) | |
download | rails-ed9acb4fcc793ce1ab68a0e5076dc9458cc7f218.tar.gz rails-ed9acb4fcc793ce1ab68a0e5076dc9458cc7f218.tar.bz2 rails-ed9acb4fcc793ce1ab68a0e5076dc9458cc7f218.zip |
Merge pull request #35235 from rails/fxn/zeitwerk
Zeitwerk integration
Diffstat (limited to 'railties/lib/rails.rb')
-rw-r--r-- | railties/lib/rails.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 092105d502..bca2cf34e1 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -110,5 +110,25 @@ module Rails def public_path application && Pathname.new(application.paths["public"].first) end + + def autoloader + if configuration.autoloader == :zeitwerk + @autoloader ||= Zeitwerk::Loader.new + end + end + + def once_autoloader + if configuration.autoloader == :zeitwerk + @once_autoloader ||= Zeitwerk::Loader.new + end + end + + def autoloaders + if configuration.autoloader == :zeitwerk + [autoloader, once_autoloader] + else + [] + end + end end end |