Commit 7f9aec69 by Tô Ngọc Ánh

replace gem config to settingslogic

parent 2550b768
Pipeline #1056 failed with stages
in 0 seconds
...@@ -30,7 +30,3 @@ ...@@ -30,7 +30,3 @@
/public/uploads/ /public/uploads/
.env .env
config/settings.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
...@@ -71,5 +71,5 @@ gem 'kaminari' ...@@ -71,5 +71,5 @@ gem 'kaminari'
gem 'devise' gem 'devise'
gem 'carrierwave', '~> 2.0' gem 'carrierwave', '~> 2.0'
gem 'rsolr' gem 'rsolr'
gem 'config' gem 'settingslogic'
## ##
...@@ -81,11 +81,7 @@ GEM ...@@ -81,11 +81,7 @@ GEM
execjs execjs
coffee-script-source (1.12.2) coffee-script-source (1.12.2)
concurrent-ruby (1.1.6) concurrent-ruby (1.1.6)
config (2.2.1)
deep_merge (~> 1.2, >= 1.2.1)
dry-validation (~> 1.0, >= 1.0.0)
crass (1.0.6) crass (1.0.6)
deep_merge (1.2.1)
devise (4.7.1) devise (4.7.1)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
...@@ -96,44 +92,6 @@ GEM ...@@ -96,44 +92,6 @@ GEM
dotenv-rails (2.7.6) dotenv-rails (2.7.6)
dotenv (= 2.7.6) dotenv (= 2.7.6)
railties (>= 3.2) railties (>= 3.2)
dry-configurable (0.11.6)
concurrent-ruby (~> 1.0)
dry-core (~> 0.4, >= 0.4.7)
dry-equalizer (~> 0.2)
dry-container (0.7.2)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (0.4.9)
concurrent-ruby (~> 1.0)
dry-equalizer (0.3.0)
dry-inflector (0.2.0)
dry-initializer (3.0.3)
dry-logic (1.0.7)
concurrent-ruby (~> 1.0)
dry-core (~> 0.2)
dry-equalizer (~> 0.2)
dry-schema (1.5.3)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.8, >= 0.8.3)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-initializer (~> 3.0)
dry-logic (~> 1.0)
dry-types (~> 1.4)
dry-types (1.4.0)
concurrent-ruby (~> 1.0)
dry-container (~> 0.3)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer (~> 0.3)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
dry-validation (1.5.4)
concurrent-ruby (~> 1.0)
dry-container (~> 0.7, >= 0.7.1)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-initializer (~> 3.0)
dry-schema (~> 1.5)
erubi (1.9.0) erubi (1.9.0)
execjs (2.7.0) execjs (2.7.0)
faraday (1.0.1) faraday (1.0.1)
...@@ -243,6 +201,7 @@ GEM ...@@ -243,6 +201,7 @@ GEM
selenium-webdriver (3.142.7) selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0) childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2) rubyzip (>= 1.2.2)
settingslogic (2.0.9)
spring (2.1.0) spring (2.1.0)
spring-watcher-listen (2.0.1) spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
...@@ -289,7 +248,6 @@ DEPENDENCIES ...@@ -289,7 +248,6 @@ DEPENDENCIES
carrierwave (~> 2.0) carrierwave (~> 2.0)
chromedriver-helper chromedriver-helper
coffee-rails (~> 4.2) coffee-rails (~> 4.2)
config
devise devise
dotenv-rails dotenv-rails
jbuilder (~> 2.5) jbuilder (~> 2.5)
...@@ -303,6 +261,7 @@ DEPENDENCIES ...@@ -303,6 +261,7 @@ DEPENDENCIES
rubyzip rubyzip
sass-rails (~> 5.0) sass-rails (~> 5.0)
selenium-webdriver selenium-webdriver
settingslogic
spring spring
spring-watcher-listen (~> 2.0.0) spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5) turbolinks (~> 5)
......
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env
end
solr_server: 'http://192.168.1.133:8983/solr/venjob' development:
solr_server: 'http://192.168.1.133:8983/solr/venjob'
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.
#
# Reading variables from ENV is case-sensitive. If you define lowercase value below, ensure your ENV variables are
# prefixed in the same way.
#
# When not set it defaults to `config.const_name`.
#
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment