Skip to content

Instantly share code, notes, and snippets.

@SeanRoberts
Created July 7, 2011 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanRoberts/1069554 to your computer and use it in GitHub Desktop.
Save SeanRoberts/1069554 to your computer and use it in GitHub Desktop.
# config/thingy.yml
development:
key: SLKJSDFLKJDF
secret: SLKDJFSLKJLKJGLKJLKJGLKJDLKJLkj21l3k432lkj
test:
key: SLKJSDFLKJDF
secret: SLKDJFSLKJLKJGLKJLKJGLKJDLKJLkj21l3k432lkj
production:
key: SLKJSDFLKJDF
secret: SLKDJFSLKJLKJGLKJLKJGLKJDLKJLkj21l3k432lkj
# in an initializer
THINGY_CONFIG = YAML::load(File.open(Rails.root + 'config/thingy.yml'))[Rails.env].stringify_keys
# Anywhere
key = THINGY_CONFIG[:key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment