Class: RailsAiBridge::RubydexAdapter::Indexer

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_bridge/rubydex_adapter/indexer.rb

Overview

Builds the rubydex graph index from Ruby source files.

Scans a project root for +.rb+ files, excluding common non-source directories, creates a graph, indexes all matching files, and resolves references.

Constant Summary collapse

EXCLUDED_DIRS =
%w[node_modules tmp log vendor .git .bundle].freeze

Instance Method Summary collapse

Instance Method Details

#build(root) ⇒ Rubydex::Graph

Builds and returns a resolved rubydex graph for the given root.

Parameters:

  • root (String)

    the project root directory path

Returns:

  • (Rubydex::Graph)

    indexed and resolved graph

Raises:

  • (StandardError)

    when indexing or resolving fails



18
19
20
21
22
23
# File 'lib/rails_ai_bridge/rubydex_adapter/indexer.rb', line 18

def build(root)
  graph = ::Rubydex::Graph.new
  graph.index_all(source_files(root))
  graph.resolve
  graph
end