Skip to content

Instantly share code, notes, and snippets.

@codingfoo
Last active October 7, 2015 00:07
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 codingfoo/3073836 to your computer and use it in GitHub Desktop.
Save codingfoo/3073836 to your computer and use it in GitHub Desktop.
Load a secrets file
require 'ostruct'
require 'yaml'
::Secrets = OpenStruct.new(YAML.load_file(File.expand_path('../secrets.yml', __FILE__))[Rails.env])
default: &DEFAULT
# Default Configuration
production:
<<: *DEFAULT
# Add production specific secrets
staging:
<<: *DEFAULT
# Add staging specific secrets
development:
<<: *DEFAULT
# Development specific secrets
test:
<<: *DEFAULT
# Test specific secrets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment