Module: Assistant::RbsGenerator

Defined in:
lib/assistant/rbs_generator.rb,
lib/assistant/rbs_generator/cli.rb,
lib/assistant/rbs_generator/writer.rb

Overview

Per-class RBS generator for Assistant::Service subclasses. The generic RBS shipped in lib/assistant/service.rbs cannot describe the per-input getter / predicate methods produced by the Assistant::InputBuilder DSL because their names and return types are only known at class-definition time. Users with Steep run this generator over their service files to obtain accurate signatures for their own subclasses.

The generator is intentionally not loaded by require 'assistant' -- it is a developer-time tool. The shipped exe/assistant-rbs binary requires it explicitly.

Marked Experimental in docs/v1/01-api-surface.md so the output format may evolve within 1.x.

See docs/v1/02-features.md (M11) for the contract.

Defined Under Namespace

Modules: Renderer Classes: Cli, Writer

Constant Summary collapse

MARKER =

Header marker written as the first line of every generated .rbs file. Writer refuses to overwrite a file whose first line is not this exact string, so hand-edited signatures are preserved.

Returns:

  • (String)
'# Generated by assistant-rbs; do not edit.'
DEFAULT_OUTPUT_DIR =

Default value for the --output DIR option of exe/assistant-rbs.

Returns:

  • (String)
'sig'
DEFAULT_INPUT_PATHS =

Default value for the positional PATH arguments of exe/assistant-rbs when none are supplied.

Returns:

  • (Array<String>)
['lib'].freeze