module

Fluxion::Config::Loader

Reads a profile off disk and turns it into a Profile.

The two frontends are detected rather than declared, because asking the user to say which schema they wrote would be asking them to repeat something the document already makes obvious.

Constants

MAX_CONFIG_BYTES = (8_i64 * 1024) * 1024

A profile is a hand-written config file. Anything this large is either a mistake or an attempt to exhaust memory before parsing even starts.

Instance methods

default_path

The default profile location, used when -c is not given.

Source
detect(root : Node, path : String = "config") : Schema
Source
load(path : String, host : HostFacts = HostFacts.new, strict : Bool = false) : Profile

Loads and validates a profile. Raises ValidationError carrying every diagnostic, so the caller can print them all at once.

Source
load_with_diagnostics(path : String, host : HostFacts = HostFacts.new) : Tuple(Profile, Array(Diagnostic))

Loads without raising, returning the profile alongside its diagnostics. validate and lint need the findings even when the profile is usable.

Source
parse(context : Context, document : YAML::Any, path : String) : Profile
Source
read(path : String) : YAML::Any

Reads the file with the checks that have to happen before parsing: a symlinked or oversized config is refused rather than followed.

Source

Nested types