Yamload
- YAML files loading
- Recursive conversion to immutable objects
- Default values
Installation
Add this line to your application's Gemfile:
gem 'yamload'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yamload
Usage
Set up the YAML files directory
Yamload.dir = File.join(File.dirname(File.expand_path(__FILE__)),'config')
e.g. config/test.yml
---
test: true
Load YAML files from the directory and access keys
# Load config/test.yml
loader = Yamload::Loader.new(:test)
loader.content('attribute')
# => true
loader.obj.attribute
# => true
Define defaults
loader.defaults = { 'test' => true , 'coverage' => { 'minimum' => 0.95 } }
Release
To publish a new version of this gem the following steps must be taken.
- Update the version in the following files
CHANGELOG.md lib/yamload/version.rb
- Create a tag using the format v0.1.0
- Follow build progress in GitHub actions
Contributing
- Fork it ( https://github.com/sealink/yamload/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request