Skip to content

Instantly share code, notes, and snippets.

Avatar

Haojian Jin haojian

View GitHub Profile
@jnunemaker
jnunemaker / harmony.rb
Created Nov 10, 2009
simple app configuration
View harmony.rb
module Harmony
# Allows accessing config variables from harmony.yml like so:
# Harmony[:domain] => harmonyapp.com
def self.[](key)
unless @config
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml")
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
end
@config[key]
end
You can’t perform that action at this time.