Load a YAML config every X minutes
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
rails
spec
.gitignore
LICENSE
README.md
Rakefile
init.rb
timed_config.gemspec

README.md

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