Class: Ace::Review::Molecules::ContextExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/review/molecules/context_extractor.rb

Overview

Extracts context (background information) for reviews Delegates to ContextComposer for context.md pattern and ace-bundle integration

Defined Under Namespace

Classes: ContextExtractorError

Instance Method Summary collapse

Constructor Details

#initializeContextExtractor

Returns a new instance of ContextExtractor.



11
12
13
# File 'lib/ace/review/molecules/context_extractor.rb', line 11

def initialize
  @preset_manager = nil # Lazy load to avoid circular dependency
end

Instance Method Details

#extract(context_config, cache_dir = nil) ⇒ String

Extract context from configuration

Parameters:

  • context_config (String, Hash, nil)

    context configuration

  • cache_dir (String, nil) (defaults to: nil)

    Optional cache directory for context.md

Returns:

  • (String)

    extracted context content



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ace/review/molecules/context_extractor.rb', line 19

def extract(context_config, cache_dir = nil)
  case context_config
  when nil, "none", false
    ""
  when "project", "auto", true
    extract_project_context(cache_dir)
  when String
    extract_from_string(context_config, cache_dir)
  when Hash
    extract_from_hash(context_config, cache_dir)
  else
    ""
  end
end