aosmith / simple-settings

A simple gem for settings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SimpleSettings

A gem for managing a settings file.

<img src=“https://travis-ci.org/aosmith/simple-settings.png?branch=master” />

Usage

At some point you’ll need to load settings. In a rails project I’d do this in config/initializers/01_settings.rb:

“‘

SimpleSettings.load

“‘

If you’re not using a rails project you’ll need to set the location of the settings.yml and your current environment via:

“‘

SimpleSettings.file_path = "~/path_to/settings.yml"
SimpleSettings.env = "development"

“‘

These values will default to ./config/settings.yml and development.

Env is read from: 1- Rails 2- ENV

Your yaml file will be available via: “‘

SimpleSettings.config[:setting_name]
SimpleSettings.config[:nested_attributes][:work_too]

“‘

About

A simple gem for settings

License:MIT License


Languages

Language:Ruby 100.0%