Project

yamlcon

0.0
No release in over 3 years
Low commit activity in last 3 years
Utility for easily loading YAML files as configuration objects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 9.0
~> 3.4
~> 0.7
~> 0.11
 Project Readme

YAMLCon - YAML Config Loader

Gem Version Build Status Maintainability


A utility for loading and saving YAML files with dot.notation.

Install

Add to your gemfile

gem 'yamlcon'

Usage

Load a single file

config = YAML.load_config 'path/to/config.yml'
puts config.any_option.or_nested

You can then modify and save the file

config.some_setting = 'value'
YAML.save_config 'filename.yml', config

Load multiple files by providing a glob pattern. In this case, each loaded file will get its own prefix, using the basename of the file.

For example, given two files config/one.yml and config/two.yml, you can do this:

config = YAML.load_config 'config/*.yml'
puts config.one.option
puts config.two.option