parsers.ruby

Ruby regex-based parser. Extracts classes, modules, and method definitions from Ruby source files.

📄 /home/runner/work/autoredocs/autoredocs/src/autoredocs/parsers/ruby.py

Classes

class
class RubyParser(BaseParser)
Regex-based parser for Ruby source files.
📍 Line 26

Methods

def
def parse_file(self, filepath: str | Path) -> ModuleDoc | None
Parse a file and extract module documentation. Args: filepath: The path to the file to parse. Can be a string or a Path object. Returns: A ModuleDoc object representing the module, or None if the file does not exist or cannot be read. Raises: None
def
def _extract_class_methods(self, source: str, class_start: int) -> list[FunctionDoc]

Functions

def
def _extract_ruby_body(source: str, start: int) -> str
📍 Line 122
def
def _build_rdoc_map(source: str) -> dict[int, str]
📍 Line 138
def
def _clean_rdoc(raw: str) -> str
📍 Line 145
def
def _parse_ruby_params(raw: str) -> list[ArgInfo]
📍 Line 158