Skip to content

Instantly share code, notes, and snippets.

@tsyber1an
Forked from jnunemaker/harmony.rb
Last active August 29, 2015 14:11
Show Gist options
  • Save tsyber1an/cf0073371adcac921d91 to your computer and use it in GitHub Desktop.
Save tsyber1an/cf0073371adcac921d91 to your computer and use it in GitHub Desktop.
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
DEFAULTS: &DEFAULTS
email: no-reply@harmonyapp.com
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