AmebaConfig::YamlValue
Helpers for converting between Crystal scalars and YAML::Any, and for
rendering YAML::Any values into the output format we want for
.ameba.yml.
Constants
Maximum line width for inline ([a, b, c]) array rendering when an
array sits to the right of key:. Arrays whose inline form would
exceed this width fall back to block (- a / - b / - c) form.
Instance methods
Compare two YAML::Any values for "logical" equality (raw-level).
Parse a user-supplied scalar from the CLI (e.g. set Foo/Bar Setting=value)
into a YAML::Any. Recognises true/false/nil/integers/floats/~, otherwise
treats the value as a string. Quoted strings ("..." or '...') are
unwrapped.
Render a YAML::Any value as it should appear on the right-hand side of
key: value (for scalars) or, if too complex, as a multi-line YAML
subtree indented under the key.
Returns a String, possibly multi-line. The first line never has any
leading indent — the caller writes key: <result> for scalars and
key:\n<result> for collections.
Convenience: render a key: value (or key:\n ...) pair as a
multi-line string at the given indent. Includes a trailing newline.
Arrays of scalar elements are rendered inline ([a, b, c]) when the
resulting line fits within INLINE_ARRAY_MAX_WIDTH; otherwise they
drop to block form.