Class: DocGen::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_gen/parser.rb

Overview

Parses Ruby test files using Prism and builds a tree of Context and Spec objects.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse_files(paths) ⇒ Object

Parse an array of file paths and return an array of root Context objects.



158
159
160
# File 'lib/doc_gen/parser.rb', line 158

def self.parse_files(paths)
  new.parse_files(paths)
end

Instance Method Details

#parse_files(paths) ⇒ Object



162
163
164
165
# File 'lib/doc_gen/parser.rb', line 162

def parse_files(paths)
  raw = Array(paths).flat_map { |path| parse_file(path) }
  NamespaceBuilder.new.build(raw)
end