diff --git a/.gitignore b/.gitignore index 5b61ab0..f9501c9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ /log/* !/log/.keep /tmp + +config/settings.local.yml +config/settings/*.local.yml +config/environments/*.local.yml diff --git a/Gemfile b/Gemfile index c950628..0ae80a8 100644 --- a/Gemfile +++ b/Gemfile @@ -8,3 +8,4 @@ gem 'puma', '~> 2.9.1' gem 'capybara' gem 'poltergeist', '>= 1.9.0' gem 'launchy' +gem 'config' diff --git a/Gemfile.lock b/Gemfile.lock index a5e9d0b..9b53e46 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,6 +50,10 @@ GEM xpath (~> 2.0) cliver (0.3.2) concurrent-ruby (1.0.2) + config (1.2.1) + activesupport (>= 3.0) + deep_merge (~> 1.0, >= 1.0.1) + deep_merge (1.0.1) erubis (2.7.0) faker (1.6.3) i18n (~> 0.5) @@ -130,6 +134,7 @@ PLATFORMS DEPENDENCIES active_model_serializers capybara + config faker launchy pg (~> 0.15) @@ -138,4 +143,4 @@ DEPENDENCIES rails (= 4.2.6) BUNDLED WITH - 1.11.2 + 1.12.3 diff --git a/config/initializers/config.rb b/config/initializers/config.rb new file mode 100644 index 0000000..66c6f3e --- /dev/null +++ b/config/initializers/config.rb @@ -0,0 +1,32 @@ +Config.setup do |config| + # Name of the constant exposing loaded settings + config.const_name = 'Settings' + + # Ability to remove elements of the array set in earlier loaded settings file. For example value: '--'. + # + # config.knockout_prefix = nil + + # Load environment variables from the `ENV` object and override any settings defined in files. + # + # config.use_env = false + + # Define ENV variable prefix deciding which variables to load into config. + # + # config.env_prefix = 'Settings' + + # What string to use as level separator for settings loaded from ENV variables. Default value of '.' works well + # with Heroku, but you might want to change it for example for '__' to easy override settings from command line, where + # using dots in variable names might not be allowed (eg. Bash). + # + # config.env_separator = '.' + + # Ability to process variables names: + # * nil - no change + # * :downcase - convert to lower case + # + # config.env_converter = nil + + # Parse numeric values as integers instead of strings. + # + # config.env_parse_values = false +end diff --git a/config/settings.yml b/config/settings.yml new file mode 100644 index 0000000..e69de29 diff --git a/config/settings/development.yml b/config/settings/development.yml new file mode 100644 index 0000000..e69de29 diff --git a/config/settings/production.yml b/config/settings/production.yml new file mode 100644 index 0000000..e69de29 diff --git a/config/settings/test.yml b/config/settings/test.yml new file mode 100644 index 0000000..e69de29