Documentation
¶
Overview ¶
Package rubyextractor provides a tree-sitter based extractor for Ruby files. It implements types.Extractor and produces declaration nodes and syntactic call/import edges without type resolution.
Supported file extensions: .rb Excluded: files under vendor/ directories
Node types extracted:
- class -> "type" nodes with nested "method" nodes
- module -> "type" nodes
- method (def) -> "function" (top-level) or "method" (inside class/module)
- singleton_method (def self.foo) -> "method" nodes
- require/require_relative -> "imports" edges
- call/method_call -> "calls" edges
- class Foo < Bar -> "extends" edge
- include/extend ModuleName -> "implements" edges
- Rails-style class-level method calls -> "decorates" edges
- Rails route patterns in config/routes.rb -> "handles_route" edges
All edges use provenance "ast_inferred" and confidence 0.7, since without type resolution cross-module calls are heuristic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RubyExtractor ¶
type RubyExtractor struct {
// contains filtered or unexported fields
}
RubyExtractor implements types.Extractor for Ruby files using tree-sitter AST parsing.
func NewRubyExtractor ¶
func NewRubyExtractor() *RubyExtractor
NewRubyExtractor creates a new RubyExtractor with a tree-sitter parser configured for Ruby.
func (*RubyExtractor) CanHandle ¶
func (e *RubyExtractor) CanHandle(path string) bool
CanHandle returns true for .rb files that are not in vendor/ directories.
func (*RubyExtractor) Extract ¶
func (e *RubyExtractor) Extract(ctx context.Context, opts types.ExtractOptions) (*types.ExtractResult, error)
Extract parses the Ruby file with tree-sitter and produces nodes for declarations and edges for calls and imports.