Class: Woods::Extractors::EngineExtractor
- Inherits:
-
Object
- Object
- Woods::Extractors::EngineExtractor
- Includes:
- SharedUtilityMethods
- Defined in:
- lib/woods/extractors/engine_extractor.rb
Overview
EngineExtractor handles Rails engine and mountable gem extraction via runtime introspection.
Reads ‘Rails::Engine.subclasses` to discover engines, then inspects each engine’s routes, mount point, and configuration. Each engine becomes one ExtractedUnit with metadata about its name, root path, mount point, route count, and isolation.
Instance Method Summary collapse
-
#extract_all ⇒ Array<ExtractedUnit>
Extract all Rails engines as ExtractedUnits.
-
#initialize ⇒ EngineExtractor
constructor
A new instance of EngineExtractor.
Methods included from SharedUtilityMethods
#app_source?, #condition_label, #count_loc, #detect_entry_points, #extract_action_filter_actions, #extract_callback_conditions, #extract_class_methods, #extract_class_name, #extract_custom_errors, #extract_initialize_params, #extract_namespace, #extract_parent_class, #extract_public_methods, #resolve_source_location, #skip_file?
Constructor Details
#initialize ⇒ EngineExtractor
Returns a new instance of EngineExtractor.
21 22 23 |
# File 'lib/woods/extractors/engine_extractor.rb', line 21 def initialize # No directories to scan — this is runtime introspection end |
Instance Method Details
#extract_all ⇒ Array<ExtractedUnit>
Extract all Rails engines as ExtractedUnits
28 29 30 31 32 33 34 35 36 |
# File 'lib/woods/extractors/engine_extractor.rb', line 28 def extract_all return [] unless engines_available? engines = engine_subclasses return [] if engines.empty? mount_map = build_mount_map engines.filter_map { |engine| extract_engine(engine, mount_map) } end |