Skip to content

nalabjp/kori

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Deep frozen objects from yaml or hash.

Resources

License

Stars

Watchers

Forks

Packages

No packages published