Project

yamload

0.0
Low commit activity in last 3 years
No release in over a year
YAML files loader with validation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Yamload

Ruby Style Guide Gem Version Build Status Coverage Status

  • 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

  1. Fork it ( https://github.com/sealink/yamload/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request