Created
November 10, 2009 01:20
-
-
Save jnunemaker/230531 to your computer and use it in GitHub Desktop.
simple app configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
def self.[]=(key, value) | |
@config[key.to_sym] = value | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFAULTS: &DEFAULTS | |
email: [email protected] | |
email_signature: | | |
Regards, | |
The Harmony Team | |
development: | |
domain: harmonyapp.local | |
<<: *DEFAULTS | |
test: | |
domain: harmonyapp.com | |
<<: *DEFAULTS | |
production: | |
domain: harmonyapp.com | |
<<: *DEFAULTS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment