Login
RemiConf
Login

RemiConf

RemiConf is a small library to help build configuration files that are easy to handle in code.

Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.

Buy Me a Coffee at ko-fi.com Donate using Liberapay

How do I get set up?

Add this to your shard.yml file:

dependencies:
  remiconf:
    fossil: https://chiselapp.com/user/MistressRemilia/repository/remiconf

You will need Fossil installed to clone this repo. You will also need Shards v0.17.1 or later. If you have an earlier version of Shards, you will need to to build the latest version manually.

Usage

Example usage using JSON (HJSON and YAML are also supported):

require "remiconf"
require "json"

module SomeProgram
  # Define a class to represent a configuration file named "test.json".
  @[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.  Since we're using an xdg resolver, this will look for the
  # file at $XDG_CONFIG_HOME/some-program/test.json
  config = Config.readConfig(res)
  puts config.username
end

Development

Style info

I use a somewhat non-standard style for my code.

How do I contribute?

  1. Go to https://chiselapp.com/user/MistressRemilia/repository/remiconf and clone the Fossil repository.
  2. Create a new branch for your feature.
  3. Push locally to the new branch.
  4. Create a bundle with Fossil that contains your changes.
  5. Get in contact with me.

Contributors

Links and Licenses

RemiConf itself is under the GNU Affero General Public License version 3.