Class: RailsAiContext::Introspectors::AutoloadIntrospector
- Inherits:
-
Object
- Object
- RailsAiContext::Introspectors::AutoloadIntrospector
- Extended by:
- StaticTier
- 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).
Constant Summary collapse
- INFLECTION_DIRECTIVES =
%i[acronym plural singular irregular uncountable human].freeze
Constants included from StaticTier
StaticTier::ALTERNATE_SOURCE, StaticTier::FILES_ONLY, StaticTier::KINDS, StaticTier::RUNTIME_ONLY
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.
Methods included from StaticTier
answers_statically?, static_tier, static_tier_declared?, unavailable_reason, validate_static_tier!
Constructor Details
#initialize(app) ⇒ AutoloadIntrospector
Returns a new instance of AutoloadIntrospector.
16 17 18 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 16 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
14 15 16 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 14 def app @app end |
Instance Method Details
#call ⇒ Hash
Returns autoloader configuration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rails_ai_context/introspectors/autoload_introspector.rb', line 21 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 |