Crinit::TokenEngine
Evaluates and interpolates substitution tokens across file contents and paths.
Constants
ESCAPED_CLOSE = "\u0000CRINIT_ESC_CLOSE\u0000"
ESCAPED_OPEN = "\u0000CRINIT_ESC_OPEN\u0000"
TOKEN_REGEX = /\{\{([a-zA-Z0-9_]+)\}\}/
Constructors
Class methods
Converts project identifiers to valid Crystal module names. Hyphens indicate nested namespaces (e.g. foo-bar -> Foo::Bar). Underscores convert to PascalCase within the same namespace (e.g. foo_bar -> FooBar). Numeric segments fold into preceding identifier (e.g. service-2 -> Service2).
Instance methods
dictionary
SourceRenders a string template, substituting recognized tokens while preserving unmapped macro delimiters and unescaping explicit macro escapes.