config 5.3.0 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 777b7f8139564b25204ca8c3d375044d16d7ed58132d898493404f04133f7a22
4
- data.tar.gz: 8ce204241f891f5cf9b2130d02c0d03c12999624dd6a12efc653462bc4e781f1
3
+ metadata.gz: 9695bee8465b0c65165242a23d7df19a04047c78d131587f87b5c0e356930a6c
4
+ data.tar.gz: 13b9ee27af8ad78c2450111854c1f8498b1019d0cd8c358eaa986bd0d01b8541
5
5
  SHA512:
6
- metadata.gz: 143d0364fd88bfacfceb6032d82bdd7e8cf74179f4bef6b9439dc966e94692ebfd41c166a85b31dbfa052b57004cfbc91dccb6fb80646d23764ee5a9466f1902
7
- data.tar.gz: a71272f604d882b05eab6958bddbb0aac72894dc62463668aaedcd3d98814d6eada6ab480cffd0679763bb0d8a125e792e7d02577b118a7771738dace0ad6af3
6
+ metadata.gz: a15b3c5112f4f776f2df92d28fa4ac8d6d0dc92eeb294b863b0be055696d8a3cc7de4abbd44aab28cd31c9e2d716e8debbcae84a439758bd1ac9d5c4415da264
7
+ data.tar.gz: 65b04c96cf9e826fccceeff15a5897c19e2a617ab131922c1ab395dfe4aad8fe6320c5c5916b07f80c75c98369460cd9a252201d684da667a37a543edea4651e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.4.0
4
+
5
+ ### New features
6
+
7
+ * Add configuration option `environment` to override the use of `Rails.env` ([#356](https://github.com/rubyconfig/config/pull/356))
8
+
3
9
  ## 5.3.0
4
10
 
5
11
  * Remove `dry-validation` from dependencies ([#333](https://github.com/rubyconfig/config/pull/333))
data/README.md CHANGED
@@ -53,6 +53,8 @@ which will generate customizable config file `config/initializers/config.rb` and
53
53
 
54
54
  You can now edit them to adjust to your needs.
55
55
 
56
+ > Note: By default, the config environment will match the Rails environment (`Rails.env`). This can be changed by setting `config.environment`.
57
+
56
58
  ### Installing on Padrino
57
59
 
58
60
  Add the gem to your `Gemfile` and run `bundle install` to install it. Then edit `app.rb` and register `Config`
@@ -9,7 +9,7 @@ module Config
9
9
 
10
10
  # Parse the settings before any of the initializers
11
11
  Config.load_and_set_settings(
12
- Config.setting_files(::Rails.root.join('config'), ::Rails.env)
12
+ Config.setting_files(::Rails.root.join('config'), Config.environment.nil? ? ::Rails.env : Config.environment.to_sym)
13
13
  )
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Config
2
- VERSION = '5.3.0'.freeze
2
+ VERSION = '5.4.0'.freeze
3
3
  end
data/lib/config.rb CHANGED
@@ -27,7 +27,8 @@ module Config
27
27
  overwrite_arrays: true,
28
28
  merge_hash_arrays: false,
29
29
  validation_contract: nil,
30
- evaluate_erb_in_yaml: true
30
+ evaluate_erb_in_yaml: true,
31
+ environment: nil
31
32
  )
32
33
 
33
34
  def self.setup
@@ -15,6 +15,11 @@ Config.setup do |config|
15
15
  #
16
16
  # config.overwrite_arrays = true
17
17
 
18
+ # Defines current environment, affecting which settings file will be loaded.
19
+ # Default: `Rails.env`
20
+ #
21
+ # config.environment = ENV.fetch('ENVIRONMENT', :development)
22
+
18
23
  # Load environment variables from the `ENV` object and override any settings defined in files.
19
24
  #
20
25
  # config.use_env = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Kuczynski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-03-01 00:00:00.000000000 Z
13
+ date: 2024-03-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: deep_merge