Skip to content

Instantly share code, notes, and snippets.

Haojian Jin haojian

Block or report user

Report or block haojian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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.