Created
December 18, 2013 11:00
-
-
Save tbprojects/8020541 to your computer and use it in GitHub Desktop.
We are using figaro for storing services api_keys and we had a problem when one developer changed application.yml and forgot to inform other developers about it (but he did update application.example.yml). As a result of this the other developer experienced "bugs" in the application. Put this file to initializers to detect mismatch between appli…
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
require 'yaml' | |
example_vars = YAML.load_file('config/application.example.yml').keys | |
live_vars = Rails.env.production? ? (ENV.keys & example_vars) : YAML.load_file('config/application.yml').keys | |
unless live_vars.sort == example_vars.sort | |
raise 'There is a mismatch between application.yml and application.example.yml' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment