Install config gem for settings management
This commit is contained in:
parent
e01a0e7124
commit
7b08270526
8 changed files with 88 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -13,3 +13,7 @@ doc
|
|||
.ruby-version
|
||||
.idea
|
||||
coverage
|
||||
|
||||
config/settings.local.yml
|
||||
config/settings/*.local.yml
|
||||
config/environments/*.local.yml
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -48,6 +48,7 @@ gem "actionpack-page_caching"
|
|||
gem "active_record_union"
|
||||
gem "cancancan"
|
||||
gem "composite_primary_keys", "~> 11.1.0"
|
||||
gem "config"
|
||||
gem "delayed_job_active_record"
|
||||
gem "dynamic_form"
|
||||
gem "http_accept_language", "~> 2.0.0"
|
||||
|
|
34
Gemfile.lock
34
Gemfile.lock
|
@ -92,6 +92,10 @@ GEM
|
|||
composite_primary_keys (11.1.0)
|
||||
activerecord (~> 5.2.1)
|
||||
concurrent-ruby (1.1.4)
|
||||
config (1.7.1)
|
||||
activesupport (>= 3.0)
|
||||
deep_merge (~> 1.2.1)
|
||||
dry-validation (>= 0.12.2)
|
||||
coveralls (0.8.22)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov (~> 0.16.1)
|
||||
|
@ -103,12 +107,41 @@ GEM
|
|||
crass (1.0.4)
|
||||
dalli (2.7.9)
|
||||
debug_inspector (0.0.3)
|
||||
deep_merge (1.2.1)
|
||||
delayed_job (4.1.5)
|
||||
activesupport (>= 3.0, < 5.3)
|
||||
delayed_job_active_record (4.1.3)
|
||||
activerecord (>= 3.0, < 5.3)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
docile (1.3.1)
|
||||
dry-configurable (0.8.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
dry-core (~> 0.4, >= 0.4.7)
|
||||
dry-container (0.7.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
dry-configurable (~> 0.1, >= 0.1.3)
|
||||
dry-core (0.4.7)
|
||||
concurrent-ruby (~> 1.0)
|
||||
dry-equalizer (0.2.2)
|
||||
dry-inflector (0.1.2)
|
||||
dry-logic (0.5.0)
|
||||
dry-container (~> 0.2, >= 0.2.6)
|
||||
dry-core (~> 0.2)
|
||||
dry-equalizer (~> 0.2)
|
||||
dry-types (0.14.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
dry-container (~> 0.3)
|
||||
dry-core (~> 0.4, >= 0.4.4)
|
||||
dry-equalizer (~> 0.2)
|
||||
dry-inflector (~> 0.1, >= 0.1.2)
|
||||
dry-logic (~> 0.5, >= 0.5)
|
||||
dry-validation (0.13.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
dry-configurable (~> 0.1, >= 0.1.3)
|
||||
dry-core (~> 0.2, >= 0.2.1)
|
||||
dry-equalizer (~> 0.2)
|
||||
dry-logic (~> 0.5, >= 0.5.0)
|
||||
dry-types (~> 0.14, >= 0.14)
|
||||
dynamic_form (1.1.4)
|
||||
erubi (1.8.0)
|
||||
execjs (2.7.0)
|
||||
|
@ -401,6 +434,7 @@ DEPENDENCIES
|
|||
capybara (~> 2.13)
|
||||
coffee-rails (~> 4.2)
|
||||
composite_primary_keys (~> 11.1.0)
|
||||
config
|
||||
coveralls
|
||||
dalli
|
||||
delayed_job_active_record
|
||||
|
|
49
config/initializers/config.rb
Normal file
49
config/initializers/config.rb
Normal file
|
@ -0,0 +1,49 @@
|
|||
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
|
||||
|
||||
# Overwrite an existing value when merging a `nil` value.
|
||||
# When set to `false`, the existing value is retained after merge.
|
||||
#
|
||||
# config.merge_nil_values = true
|
||||
|
||||
# Overwrite arrays found in previously loaded settings file. When set to `false`, arrays will be merged.
|
||||
#
|
||||
# config.overwrite_arrays = true
|
||||
|
||||
# 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 = :downcase
|
||||
|
||||
# Parse numeric values as integers instead of strings.
|
||||
#
|
||||
# config.env_parse_values = true
|
||||
|
||||
# Validate presence and type of specific config values. Check https://github.com/dry-rb/dry-validation for details.
|
||||
#
|
||||
# config.schema do
|
||||
# required(:name).filled
|
||||
# required(:age).maybe(:int?)
|
||||
# required(:email).filled(format?: EMAIL_REGEX)
|
||||
# end
|
||||
end
|
0
config/settings.yml
Normal file
0
config/settings.yml
Normal file
0
config/settings/development.yml
Normal file
0
config/settings/development.yml
Normal file
0
config/settings/production.yml
Normal file
0
config/settings/production.yml
Normal file
0
config/settings/test.yml
Normal file
0
config/settings/test.yml
Normal file
Loading…
Add table
Add a link
Reference in a new issue