Class: AnnotateRb::EagerLoader
- Inherits:
-
Object
- Object
- AnnotateRb::EagerLoader
- Defined in:
- lib/annotate_rb/eager_loader.rb
Overview
Not sure what this does just yet
Class Method Summary collapse
Class Method Details
.call(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/annotate_rb/eager_loader.rb', line 7 def call() [:require].count > 0 && [:require].each { |path| require path } if defined?(::Rails::Application) if defined?(::Zeitwerk) # Delegate to Zeitwerk to load stuff as needed else klass = ::Rails::Application.send(:subclasses).first klass.eager_load! end else [:model_dir].each do |dir| ::Rake::FileList["#{dir}/**/*.rb"].each do |fname| require File.(fname) end end end end |