💾 Archived View for nanako.mooo.com › programming › remiconf.gmi captured on 2023-05-24 at 17:58:10. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
A small library to help define configuration files.
require "remiconf" require "json" module SomeProgram # Define a class to represent a configuration file. @[RemiConf::ConfigOpts(filename: "test.json", format: :json)] class Config include ::RemiConf::ConfigFile property username : String = "" end # Define a resolver that will automatically locate config files. res = RemiConf::Resolver.xdg("some-program") # Read the config config = Config.readConfig(res) puts config.username end