Skip to main content
rb.config reads and writes TOML files and strings. A script reaches for it to keep settings in a file a person can open and edit by hand. This script loads its settings from its data folder, starts from defaults when it cannot read the file, changes a value and saves it:
write_toml follows the same path rules, and read_toml and write_toml both take @data/ paths. read_toml raises when the file is missing, and parse_toml and read_toml raise on text that is not valid TOML. TOML dates read as strings. A whole number writes as a TOML integer. A nil value, a function, or another type TOML cannot hold raises.