0.0
No commit activity in last 3 years
No release in over 3 years
The configuration loader to load rc config file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12.3
~> 3.7
~> 0.55.0

Runtime

~> 2.1
 Project Readme

mysticonfig

license Gem Gem Libraries.io for GitHub Travis

🔮 The configuration loader for wizard.


A library to load .appnamerc, .appnamerc.json or .appnamerc.yaml config file easily.

mysticonfig will lookup for your config file.
It keeps traversing up until it finds the config file or reaches your home directory.

Gem's name inspired by cosmiconfig

Installation

gem install mysticonfig

Usage

Normal

require 'mysticonfig'

loader = Mysticonfig::Loader.new 'appname'
config = loader.load # Automatically detect and load config
json_config = loader.load_json # Only load config from JSON file
yaml_config = loader.load_yaml # Only load config from YAML file (.yaml or .yml)

With default config fallback

require 'mysticonfig'

DEFAULT_CONFIG = {
	'a' => 'A',
	'b' => 'B',
	'c' => 'C'
}

loader = Mysticonfig::Loader.new('appname', DEFAULT_CONFIG)
config = loader.load # Automatically detect and load config
json_config = loader.load_json # Only load config from JSON file
yaml_config = loader.load_yaml # Only load config from YAML file (.yaml or .yml)

Documentation

See https://gluons.github.io/mysticonfig/