Project

kori

0.0
No commit activity in last 3 years
No release in over 3 years
Deep frozen objects from yaml or hash.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

~> 0.11
 Project Readme

Kori

Gem Version Build Status Code Climate Test Coverage Dependency Status

Kori generate deep frozen objects from yaml or hash. It using a ice_nine, inspired by Settingslogic.

Kori(kōri) means Ice in japanese.

Installation

$ gem install kori

Usage

require 'kori'

# From Hash
config = Kori.freeze({ a: 1, b: { c: 'abc' } })
config.a                # 1
config[:a]              # 1
config['a']             # 1
config.b                # { c: 'abc' }
config.b.class          # Kori
config.b.c              # 'abc'
config.forzen?          # true
config.a.frozen?        # true
config.b.frozen?        # true
config.b.c.frozen?      # true

# From YAML
config = Kori.freeze('app_config.yml')          # load from ./app_config.yml
config = Kori.freeze('/path/to/app_config.yml') # load from /path/to/app_config.yml

# If you are using Rails, it is possible to use as `Rails.application.config_for`
config = Kori.freeze(:app_config)               # load from /rails_root/config/app_config.yml
config = Kori.freeze('subdir/app_config')       # load from /rails_root/config/subdir/app_config.yml

License

MIT License

see LICENSE.txt.