Class: RailsAiContext::Introspectors::AutoloadIntrospector
- Inherits:
-
Object
- Object
- RailsAiContext::Introspectors::AutoloadIntrospector
- Defined in:
- lib/rails_ai_context/introspectors/autoload_introspector.rb
Overview
Extracts the autoloading configuration: Zeitwerk vs Classic, custom inflections, autoload/eager-load paths, collapsed dirs, and ignored paths. Covers RAILS_NERVOUS_SYSTEM.md §3 (Autoloading — Zeitwerk).
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#call ⇒ Hash
Autoloader configuration.
-
#initialize(app) ⇒ AutoloadIntrospector
constructor
A new instance of AutoloadIntrospector.
Constructor Details
#initialize(app) ⇒ AutoloadIntrospector
Returns a new instance of AutoloadIntrospector.
11 12 13 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 11 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
9 10 11 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 9 def app @app end |
Instance Method Details
#call ⇒ Hash
Returns autoloader configuration.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 16 def call { mode: detect_mode, zeitwerk_available: zeitwerk_available?, autoloaders: extract_autoloaders, autoload_paths: relativize(app.config.autoload_paths), autoload_once_paths: relativize(app.config.autoload_once_paths), eager_load_paths: relativize(app.config.eager_load_paths), eager_load: !!app.config.eager_load, custom_inflections: extract_custom_inflections } rescue => e $stderr.puts "[rails-ai-context] AutoloadIntrospector#call failed: #{e.}" if ENV["DEBUG"] { error: e. } end |