Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (40 sloc) 801 Bytes

TimedConfig

Load a YAML config every X minutes

Requirements

gem install timed_config

Install

Rails 2

config/environment.rb

config.gem 'timed_config'

Rails 3

Gemfile

gem 'timed_config'

Other

require 'timed_config'

Defaults

If you are using Rails, TimedConfig will try to locate the YAML config at config/timed_config.yml.

By default, the refresh period is set to 1 minute.

Changing defaults

TimedConfig.period = 120 # change period to two minutes
TimedConfig.path = "path/to/yaml.yml"

The config will reload any time a setting changes.

Accessing the config

TimedConfig.config