Last active
December 10, 2015 21:48
-
-
Save slumos/4497379 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MyApp | |
| class Application < Rails::Application | |
| # Allows us to read configuration from unconventional places | |
| # (e.g. /etc). | |
| # | |
| # To use: | |
| # config/config_paths.yml: | |
| # development: | |
| # config/blah: config/blah.yml | |
| # | |
| # config/initializers/blah.rb: | |
| # BLAH_CONFIG = YAML.load_file(Rails.application.paths['config/blah'].first) | |
| # | |
| def paths | |
| return @paths if @paths | |
| @paths = super | |
| config_paths = YAML.load_file("#{config.root}/config/config_paths.yml") rescue {} | |
| if config_paths[Rails.env] then | |
| config_paths[Rails.env].each do |key, path| | |
| @paths.add key, :with => path | |
| end | |
| end | |
| return @paths | |
| end | |
| end | |
| end |
This file contains hidden or 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
| development: | |
| config/blah: config/blah.yml | |
| production: | |
| config/blah: /etc/myapp/blah.yml | |
| config/database: /etc/myapp/database.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment