This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made app configurable without modifying any files
Settings are loaded from the file pointed to by the SETTINGS_PATH environment variable. That file contains the location of all settings, including a path for the database configuration and for logging. This allows the executor of this application to customize all settings without creating or modifying any files within the application.
- Loading branch information
David Stevenson and Ian Lesperance
committed
Sep 30, 2013
1 parent
34acf6e
commit 1f9f3d1
Showing
9 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file should not be used in deployed environments. Instead, set | ||
# the SETTINGS_PATH environment variable to point to a configuration | ||
# file that contains these settings. | ||
|
||
defaults: &defaults | ||
database_config_path: 'config/database.yml' | ||
log_path: 'log/<%= Rails.env %>.log' | ||
auth_token: 'secret' | ||
|
||
development: | ||
<<: *defaults | ||
|
||
test: | ||
<<: *defaults |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ENV['SETTINGS_PATH'] ||= File.expand_path('../../config/settings.yml', __FILE__) | ||
|
||
class Settings < Settingslogic | ||
source ENV['SETTINGS_PATH'] | ||
namespace Rails.env | ||
end |
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
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