config 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +113 -43
- data/CONTRIBUTING.md +1 -1
- data/README.md +90 -33
- data/config.gemspec +17 -19
- data/lib/config.rb +5 -4
- data/lib/config/integrations/rails/railtie.rb +1 -1
- data/lib/config/options.rb +8 -52
- data/lib/config/sources/env_source.rb +73 -0
- data/lib/config/sources/yaml_source.rb +8 -2
- data/lib/config/validation/schema.rb +2 -0
- data/lib/config/version.rb +1 -1
- data/lib/generators/config/templates/config.rb +3 -0
- metadata +31 -43
- data/lib/config/integrations/rails/engine.rb +0 -9
- data/spec/app/rails_5.0/README.md +0 -24
- data/spec/app/rails_5.1/README.md +0 -24
- data/spec/app/rails_5.2/README.md +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee641c05cf97c8e76b7076ba7b9c66e490999d307cf4be1b6c404f5cabfc38a5
|
4
|
+
data.tar.gz: 9c9b4f47ca0259234082bd4339df446370e0f8cda3be6e8dfb25aff347c2ac75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 374734550ff18a367d2932d10601dda32cfd29640b7ce7e647c00b11b5f3dbd85afbcb57d9e3dd369cbd5d9b1c44e66af4ed7b4c5bc438136ed9474d9797741f
|
7
|
+
data.tar.gz: '093ca60e0208e03bd6b4cf624084c2eeead073b531c702196d325aff5f9d48bfaf1da326d3725bb7d79702ff66a6332942e478a553e14b02dea54cc6a491619a'
|
data/CHANGELOG.md
CHANGED
@@ -2,129 +2,199 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
...
|
6
|
+
|
7
|
+
## 3.1.0
|
8
|
+
|
9
|
+
### New features
|
10
|
+
|
11
|
+
* Evaluating ERB in YAML files can now be disabled with `Config.evaluate_erb_in_yaml = false`. The default value for this option is `true` for backwards-compatibility. ([#303](https://github.com/rubyconfig/config/pull/303))
|
12
|
+
|
13
|
+
## 3.0.0
|
14
|
+
|
15
|
+
### BREAKING CHANGES
|
16
|
+
|
17
|
+
* After upgrade behaviour of `to_h` would change and match behaviour of `to_hash`. Check [#217](https://github.com/rubyconfig/config/issues/217#issuecomment-741953382) for more details.
|
18
|
+
* `Config::Options#load_env!` and `Config::Options#reload_env!` have been removed. If you need to reload settings after modifying the `ENV` hash, use `Config.reload!` or `Config::Options#reload!` instead.
|
19
|
+
|
20
|
+
### Bug fixes
|
21
|
+
|
22
|
+
* Added alias `to_h` for `to_hash` ([#277](https://github.com/railsconfig/config/issues/277))
|
23
|
+
|
24
|
+
### Changes
|
25
|
+
|
26
|
+
* Add `Config::Sources::EnvSource` for loading settings from flat `Hash`es with `String` keys and `String` values, such as from AWS SecretsManager ([#299](https://github.com/railsconfig/config/pull/299))
|
27
|
+
|
28
|
+
## 2.2.3
|
29
|
+
|
30
|
+
### Bug fixes
|
31
|
+
|
32
|
+
* Revert added alias to_h for to_hash ([#277](https://github.com/railsconfig/config/issues/277))
|
33
|
+
|
34
|
+
### Changes
|
35
|
+
|
36
|
+
* Raise explicit error on environment variable conflicts ([#293](https://github.com/railsconfig/config/issues/293))
|
37
|
+
|
38
|
+
## 2.2.2
|
39
|
+
|
40
|
+
### Bug fixes
|
41
|
+
|
42
|
+
* Added alias to_h for to_hash ([#277](https://github.com/railsconfig/config/issues/277))
|
43
|
+
* Prevent unnecessary doubled loading of environment variables ([#291](https://github.com/rubyconfig/config/pull/291))
|
44
|
+
* Return `Hash` from `Config::Options#as_json` instead of `Array` of pairs when using ActiveSupport Core Extensions ([#292](https://github.com/rubyconfig/config/pull/292))
|
45
|
+
|
46
|
+
### Changes
|
47
|
+
|
48
|
+
* Add JRuby 9.2 to the test matrix ([#228](https://github.com/railsconfig/config/issues/228))
|
49
|
+
* Add exit! to reserved keywords ([#289](https://github.com/railsconfig/config/issues/289))
|
50
|
+
|
51
|
+
## 2.2.1
|
52
|
+
|
53
|
+
### Performance improvements
|
54
|
+
|
55
|
+
* Get rid of unused Rails Engine class definition ([#247](https://github.com/rubyconfig/config/pull/247))
|
56
|
+
* Require dry-validation only when schema is specified ([#253](https://github.com/rubyconfig/config/pull/253))
|
57
|
+
* Defer modification of `ActionController::Base` to when it is loaded in Rails integration ([#250](https://github.com/rubyconfig/config/pull/250))
|
58
|
+
|
59
|
+
### Bug fixes
|
60
|
+
|
61
|
+
* Fix missing new_ostruct_member in Ruby 2.7 ([#255](https://github.com/rubyconfig/config/pull/255))
|
62
|
+
* Fix validation contract documentation ([#260](https://github.com/rubyconfig/config/pull/260))
|
63
|
+
* Excluded test application's *.md files from the gem build ([#267](https://github.com/rubyconfig/config/pull/267))
|
64
|
+
|
65
|
+
### Changes
|
66
|
+
|
67
|
+
* Use sprockets 3.x when running unit tests for Rails 4.2 ([#256](https://github.com/rubyconfig/config/pull/256))
|
68
|
+
* Cleanup example Rails application used for testing ([#263](https://github.com/rubyconfig/config/pull/263))
|
69
|
+
* Upgrade markdown linter and fix errors ([#265](https://github.com/rubyconfig/config/pull/265))
|
70
|
+
* Upgrade development dependencies and test matrix with latest Ruby and Rails versions ([#264](https://github.com/rubyconfig/config/pull/264))
|
71
|
+
* Replace Travis CI with GitHub Actions ([#266](https://github.com/rubyconfig/config/pull/266))
|
72
|
+
* Add Rails 6.0 to the test matrix ([#258](https://github.com/rubyconfig/config/pull/258))
|
73
|
+
* Rename GitHub organization name from `railsconfig` to `rubyconfig` ([#268](https://github.com/rubyconfig/config/pull/268))
|
74
|
+
|
5
75
|
## 2.1.0
|
6
76
|
|
7
77
|
### New features
|
8
78
|
|
9
|
-
* Add dry-validation contract support ([#238](https://github.com/
|
79
|
+
* Add dry-validation contract support ([#238](https://github.com/rubyconfig/config/pull/238))
|
10
80
|
|
11
81
|
### Changes
|
12
82
|
|
13
|
-
* Get rid of activesupport dependency ([#230](https://github.com/
|
14
|
-
* Ignore .local files in test environment ([#135](https://github.com/
|
15
|
-
* Execute default rspec against latest Rails app and load appropriate development dependencies dynamically ([#241](https://github.com/
|
16
|
-
* Fix inconsistent documentation for ENV prefix and default value in generator ([#246](https://github.com/
|
83
|
+
* Get rid of activesupport dependency ([#230](https://github.com/rubyconfig/config/pull/230))
|
84
|
+
* Ignore .local files in test environment ([#135](https://github.com/rubyconfig/config/issues/135), [#233](https://github.com/rubyconfig/config/pull/233))
|
85
|
+
* Execute default rspec against latest Rails app and load appropriate development dependencies dynamically ([#241](https://github.com/rubyconfig/config/pull/241))
|
86
|
+
* Fix inconsistent documentation for ENV prefix and default value in generator ([#246](https://github.com/rubyconfig/config/pull/246))
|
17
87
|
|
18
88
|
### Bug fixes
|
19
89
|
|
20
|
-
* Fix warnings when running tests in Rails 5 scope ([#240](https://github.com/
|
21
|
-
* Do not run incompatible code coverage on truffleruby ([#242](https://github.com/
|
90
|
+
* Fix warnings when running tests in Rails 5 scope ([#240](https://github.com/rubyconfig/config/issues/240)
|
91
|
+
* Do not run incompatible code coverage on truffleruby ([#242](https://github.com/rubyconfig/config/issues/242)
|
22
92
|
|
23
93
|
## 2.0.0
|
24
94
|
|
25
95
|
### BREAKING CHANGES
|
26
96
|
|
27
97
|
After upgrade to dry-schema 1.0 we had to drop support for Rails `< 4.2` and Ruby `< 2.4`.
|
28
|
-
If you need older version of Ruby or Rails, please stick to 1.x version of this gem.
|
98
|
+
If you need older version of Ruby or Rails, please stick to 1.x version of this gem.
|
29
99
|
|
30
100
|
### New features
|
31
101
|
|
32
|
-
* Add `merge_hash_arrays` as a configuration option ([#214](https://github.com/
|
102
|
+
* Add `merge_hash_arrays` as a configuration option ([#214](https://github.com/rubyconfig/config/pull/214))
|
33
103
|
|
34
104
|
### Changes
|
35
105
|
|
36
|
-
* Upgraded dry-validation dependency to dry-schema 1.0 ([#224](https://github.com/
|
37
|
-
* Moved constant to be defined on `Object` instead of `Kernel` ([#227](https://github.com/
|
38
|
-
* Add TruffleRuby to the test matrix ([#229](https://github.com/
|
106
|
+
* Upgraded dry-validation dependency to dry-schema 1.0 ([#224](https://github.com/rubyconfig/config/pull/224))
|
107
|
+
* Moved constant to be defined on `Object` instead of `Kernel` ([#227](https://github.com/rubyconfig/config/issues/227))
|
108
|
+
* Add TruffleRuby to the test matrix ([#229](https://github.com/rubyconfig/config/issues/229))
|
39
109
|
|
40
110
|
## 1.7.2
|
41
111
|
|
42
112
|
### Bug fixes
|
43
113
|
|
44
|
-
* Lock max version of dry-validation depending on the ruby version ([#223](https://github.com/
|
114
|
+
* Lock max version of dry-validation depending on the ruby version ([#223](https://github.com/rubyconfig/config/pull/223))
|
45
115
|
|
46
116
|
## 1.7.1
|
47
117
|
|
48
118
|
### New features
|
49
119
|
|
50
|
-
* Upgrade dependencies ([#211](https://github.com/
|
120
|
+
* Upgrade dependencies ([#211](https://github.com/rubyconfig/config/pull/211))
|
51
121
|
|
52
122
|
### Changes
|
53
123
|
|
54
|
-
* Add Ruby 2.5 and Rails 5.1 to the testing matrix on Travis ([#201](https://github.com/
|
55
|
-
* Add Ruby 2.6
|
56
|
-
* Add Rails 5.2 to the test matrix ([#212](https://github.com/
|
124
|
+
* Add Ruby 2.5 and Rails 5.1 to the testing matrix on Travis ([#201](https://github.com/rubyconfig/config/pull/201))
|
125
|
+
* Add Ruby 2.6 to the test matrix ([#210](https://github.com/rubyconfig/config/pull/210))
|
126
|
+
* Add Rails 5.2 to the test matrix ([#212](https://github.com/rubyconfig/config/pull/212))
|
57
127
|
|
58
128
|
## 1.7.0
|
59
129
|
|
60
130
|
### New features
|
61
131
|
|
62
|
-
* **WARNING:** `nil` values will from now on overwrite an existing value when merging configs! This change of behavior can be reverted via `config.merge_nil_values = false` in your Config initializer ([#196](https://github.com/
|
132
|
+
* **WARNING:** `nil` values will from now on overwrite an existing value when merging configs! This change of behavior can be reverted via `config.merge_nil_values = false` in your Config initializer ([#196](https://github.com/rubyconfig/config/pull/196))
|
63
133
|
|
64
134
|
## 1.6.1
|
65
135
|
|
66
136
|
### Bug fixes
|
67
137
|
|
68
|
-
* Make dry-validation dependency less strict allowing to use newer versions ([#183](https://github.com/
|
69
|
-
* Fix `key?` and `has_key?`, which raise NoMethodError in non Rails environment, by using ActiveSupport `#delegate` implicitly ([#185](https://github.com/
|
70
|
-
* Update `deep_merge` dependency to latest version (v1.2.1) ([#191](https://github.com/
|
71
|
-
* Upgrade `rubocop` to version 0.52.1 ([#193](https://github.com/
|
72
|
-
* Add `zip` to the list of reserved keywords ([#197](https://github.com/
|
138
|
+
* Make dry-validation dependency less strict allowing to use newer versions ([#183](https://github.com/rubyconfig/config/pull/183))
|
139
|
+
* Fix `key?` and `has_key?`, which raise NoMethodError in non Rails environment, by using ActiveSupport `#delegate` implicitly ([#185](https://github.com/rubyconfig/config/pull/185))
|
140
|
+
* Update `deep_merge` dependency to latest version (v1.2.1) ([#191](https://github.com/rubyconfig/config/pull/191))
|
141
|
+
* Upgrade `rubocop` to version 0.52.1 ([#193](https://github.com/rubyconfig/config/pull/193))
|
142
|
+
* Add `zip` to the list of reserved keywords ([#197](https://github.com/rubyconfig/config/pull/197))
|
73
143
|
|
74
144
|
## 1.6.0
|
75
145
|
|
76
146
|
### New features
|
77
147
|
|
78
148
|
* `Config#fail_on_missing` option (default `false`) to raise a `KeyError` exception when accessing a non-existing key
|
79
|
-
* Add ability to test if a value was set for a given key with `key?` and `has_key?` ([#182](https://github.com/
|
149
|
+
* Add ability to test if a value was set for a given key with `key?` and `has_key?` ([#182](https://github.com/rubyconfig/config/pull/182))
|
80
150
|
|
81
151
|
## 1.5.1
|
82
152
|
|
83
153
|
### New features
|
84
154
|
|
85
|
-
* Add parsing of ENV variable values to Boolean type ([#180](https://github.com/
|
155
|
+
* Add parsing of ENV variable values to Boolean type ([#180](https://github.com/rubyconfig/config/pull/180))
|
86
156
|
|
87
157
|
## 1.5.0
|
88
158
|
|
89
159
|
### New features
|
90
160
|
|
91
|
-
* Add ability to validate config schema ([#155](https://github.com/
|
92
|
-
* Add count to the reserved names list ([#167](https://github.com/
|
161
|
+
* Add ability to validate config schema ([#155](https://github.com/rubyconfig/config/pull/155) thanks to [@ok32](https://github.com/ok32))
|
162
|
+
* Add count to the reserved names list ([#167](https://github.com/rubyconfig/config/pull/167) thanks to [@carbonin](https://github.com/carbonin))
|
93
163
|
|
94
164
|
### Bug fixes
|
95
165
|
|
96
|
-
* Correctly parse `env_prefix`, which contains `env_separator` ([#177](https://github.com/
|
166
|
+
* Correctly parse `env_prefix`, which contains `env_separator` ([#177](https://github.com/rubyconfig/config/pull/177) thanks to [@rdodson41](https://github.com/rdodson41))
|
97
167
|
|
98
168
|
## 1.4.0
|
99
169
|
|
100
170
|
### New features
|
101
171
|
|
102
|
-
* Added support for passing a raw ruby hash into to both `Settings.add_source!` and `Settings.prepend_source!` ([#108](https://github.com/
|
172
|
+
* Added support for passing a raw ruby hash into to both `Settings.add_source!` and `Settings.prepend_source!` ([#108](https://github.com/rubyconfig/config/pull/159) thanks to [@halloffame](https://github.com/halloffame))
|
103
173
|
|
104
174
|
### Bug fixes
|
105
175
|
|
106
|
-
* Added new reserved name `test` ([#158](https://github.com/
|
107
|
-
* `to_hash` should not replace nested config objects with Hash ([#160](https://github.com/
|
176
|
+
* Added new reserved name `test` ([#158](https://github.com/rubyconfig/config/pull/158) thanks to [@milushov](https://github.com/milushov))
|
177
|
+
* `to_hash` should not replace nested config objects with Hash ([#160](https://github.com/rubyconfig/config/issues/160) thanks to [@seikichi](https://github.com/seikichi))
|
108
178
|
|
109
179
|
## 1.3.0
|
110
180
|
|
111
|
-
* **WARNING:** Overwrite arrays found in previously loaded settings file ([#137](https://github.com/
|
181
|
+
* **WARNING:** Overwrite arrays found in previously loaded settings file ([#137](https://github.com/rubyconfig/config/pull/137) thanks to [@Fryguy](https://github.com/Fryguy) and [@dtaniwaki](https://github.com/dtaniwaki)) - this is a change breaking previous behaviour. If you want to keep Config to work as before, which is merging arrays found in following loaded settings file, please add `config.overwrite_arrays = false` to your Config initializer
|
112
182
|
* Changed default ENV variables loading settings to downcase variable names and parse values
|
113
183
|
* Added parsing ENV variables values to Float type
|
114
|
-
* Change method definition order in Rails integration module to prevent undefined method `preload` error (based on [@YaroSpace](https://github.com/YaroSpace) suggestion in [#111](https://github.com/
|
184
|
+
* Change method definition order in Rails integration module to prevent undefined method `preload` error (based on [@YaroSpace](https://github.com/YaroSpace) suggestion in [#111](https://github.com/rubyconfig/config/issues/111)
|
115
185
|
|
116
186
|
## 1.2.1
|
117
187
|
|
118
|
-
* Fixed support for multilevel settings loaded from ENV variables (inspired by [@cbeer](https://github.com/cbeer) in [#144](https://github.com/
|
188
|
+
* Fixed support for multilevel settings loaded from ENV variables (inspired by [@cbeer](https://github.com/cbeer) in [#144](https://github.com/rubyconfig/config/pull/144))
|
119
189
|
|
120
190
|
## 1.2.0
|
121
191
|
|
122
|
-
* Add ability to load settings from ENV variables ([#108](https://github.com/
|
123
|
-
* Removed Rails 5 deprecation warnings for prepend_before_filter ([#141](https://github.com/
|
192
|
+
* Add ability to load settings from ENV variables ([#108](https://github.com/rubyconfig/config/issues/108) thanks to [@vinceve](https://github.com/vinceve) and [@spalladino](https://github.com/spalladino))
|
193
|
+
* Removed Rails 5 deprecation warnings for prepend_before_filter ([#141](https://github.com/rubyconfig/config/pull/141))
|
124
194
|
|
125
195
|
## 1.1.1
|
126
196
|
|
127
|
-
* Downgrade minimum ruby version to 2.0.0 ([#136](https://github.com/
|
197
|
+
* Downgrade minimum ruby version to 2.0.0 ([#136](https://github.com/rubyconfig/config/issues/136))
|
128
198
|
|
129
199
|
## 1.1.0
|
130
200
|
|
@@ -133,12 +203,12 @@ If you need older version of Ruby or Rails, please stick to 1.x version of this
|
|
133
203
|
|
134
204
|
## 1.0.0
|
135
205
|
|
136
|
-
* `
|
137
|
-
* Fixed array descent when converting to hash ([#89](https://github.com/
|
138
|
-
* Catch OpenStruct reserved keywords ([#95](https://github.com/
|
139
|
-
* Allows loading before app configuration process ([#107](https://github.com/
|
140
|
-
* `deep_merge` is now properly managed via gemspec ([#110](https://github.com/
|
141
|
-
* Added `prepend_source!` ([#102](https://github.com/
|
206
|
+
* `rubyconfig` is now officially renamed to `Config`
|
207
|
+
* Fixed array descent when converting to hash ([#89](https://github.com/rubyconfig/config/pull/89))
|
208
|
+
* Catch OpenStruct reserved keywords ([#95](https://github.com/rubyconfig/config/pull/95) by [@dudo](https://github.com/dudo))
|
209
|
+
* Allows loading before app configuration process ([#107](https://github.com/rubyconfig/config/pull/107) by [@Antiarchitect](https://github.com/Antiarchitect))
|
210
|
+
* `deep_merge` is now properly managed via gemspec ([#110](https://github.com/rubyconfig/config/pull/110))
|
211
|
+
* Added `prepend_source!` ([#102](https://github.com/rubyconfig/config/pull/102))
|
142
212
|
|
143
213
|
## 0.99
|
144
214
|
|
data/CONTRIBUTING.md
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Config
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![Financial Contributors on Open Collective](https://opencollective.com/rubyconfig/all/badge.svg?label=
|
3
|
+
[![Version](https://img.shields.io/gem/v/config)](https://rubygems.org/gems/config)
|
4
|
+
[![Downloads Total](https://img.shields.io/gem/dt/config)](https://rubygems.org/gems/config)
|
5
|
+
[![Build](https://img.shields.io/github/workflow/status/rubyconfig/config/tests)](https://rubygems.org/gems/config)
|
6
|
+
[![Tests](https://github.com/rubyconfig/config/workflows/tests/badge.svg)](https://github.com/rubyconfig/config/actions?query=branch%3Amaster)
|
7
|
+
[![Financial Contributors on Open Collective](https://opencollective.com/rubyconfig/all/badge.svg?label=backers)](https://opencollective.com/rubyconfig)
|
8
8
|
|
9
9
|
## Summary
|
10
10
|
|
@@ -21,11 +21,14 @@ Config helps you easily manage environment specific settings in an easy and usab
|
|
21
21
|
|
22
22
|
## Compatibility
|
23
23
|
|
24
|
+
Current version supports and is [tested](.github/workflows/tests.yml#L19) for the following interpreters and frameworks:
|
25
|
+
|
24
26
|
* Interpreters
|
25
|
-
* [Ruby](https://www.ruby-lang.org
|
26
|
-
* [
|
27
|
+
* [Ruby](https://www.ruby-lang.org) `>= 2.4`
|
28
|
+
* [JRuby](https://www.jruby.org) `>= 9.2`
|
29
|
+
* [TruffleRuby](https://github.com/oracle/truffleruby) `>= 19.3`
|
27
30
|
* Application frameworks
|
28
|
-
* Rails `>= 4.2` and `
|
31
|
+
* Rails `>= 4.2`, `5` and `6`
|
29
32
|
* Padrino
|
30
33
|
* Sinatra
|
31
34
|
|
@@ -42,6 +45,7 @@ Add `gem 'config'` to your `Gemfile` and run `bundle install` to install it. The
|
|
42
45
|
which will generate customizable config file `config/initializers/config.rb` and set of default settings files:
|
43
46
|
|
44
47
|
config/settings.yml
|
48
|
+
config/settings.local.yml
|
45
49
|
config/settings/development.yml
|
46
50
|
config/settings/production.yml
|
47
51
|
config/settings/test.yml
|
@@ -186,8 +190,9 @@ Settings.add_source!("#{Rails.root}/config/settings/local.yml")
|
|
186
190
|
Settings.reload!
|
187
191
|
```
|
188
192
|
|
189
|
-
> Note: this is an example usage, it is easier to just use the default local
|
190
|
-
settings
|
193
|
+
> Note: this is an example usage, it is easier to just use the default local
|
194
|
+
> files `settings.local.yml`, `settings/#{Rails.env}.local.yml` and
|
195
|
+
> `environments/#{Rails.env}.local.yml` for your developer specific settings.
|
191
196
|
|
192
197
|
You also have the option to add a raw hash as a source. One use case might be storing settings in the database or in environment variables that overwrite what is in the YML files.
|
193
198
|
|
@@ -200,7 +205,9 @@ You may pass a hash to `prepend_source!` as well.
|
|
200
205
|
|
201
206
|
## Embedded Ruby (ERB)
|
202
207
|
|
203
|
-
Embedded Ruby is allowed in the configuration files.
|
208
|
+
Embedded Ruby is allowed in the YAML configuration files. ERB will be evaluated at load time by default, and when the `evaluate_erb_in_yaml` configuration is set to `true`.
|
209
|
+
|
210
|
+
Consider the two following config files.
|
204
211
|
|
205
212
|
* ```#{Rails.root}/config/settings.yml```
|
206
213
|
|
@@ -261,6 +268,7 @@ After installing `Config` in Rails, you will find automatically generated file t
|
|
261
268
|
### General
|
262
269
|
|
263
270
|
* `const_name` - name of the object holing you settings. Default: `'Settings'`
|
271
|
+
* `evaluate_erb_in_yaml` - evaluate ERB in YAML config files. Set to false if the config file contains ERB that should not be evaluated at load time. Default: `true`
|
264
272
|
|
265
273
|
### Merge customization
|
266
274
|
|
@@ -321,7 +329,7 @@ class ConfigContract < Dry::Validation::Contract
|
|
321
329
|
end
|
322
330
|
|
323
331
|
Config.setup do |config|
|
324
|
-
config.validation_contract = ConfigContract
|
332
|
+
config.validation_contract = ConfigContract.new
|
325
333
|
end
|
326
334
|
```
|
327
335
|
|
@@ -415,6 +423,21 @@ ENV['Settings.section.server'] = 'google.com'
|
|
415
423
|
|
416
424
|
It won't work with arrays, though.
|
417
425
|
|
426
|
+
It is considered an error to use environment variables to simutaneously assign a "flat" value and a multi-level value to a key.
|
427
|
+
|
428
|
+
```ruby
|
429
|
+
# Raises an error when settings are loaded
|
430
|
+
ENV['BACKEND_DATABASE'] = 'development'
|
431
|
+
ENV['BACKEND_DATABASE_USER'] = 'postgres'
|
432
|
+
```
|
433
|
+
|
434
|
+
Instead, specify keys of equal depth in the environment variable names:
|
435
|
+
|
436
|
+
```ruby
|
437
|
+
ENV['BACKEND_DATABASE_NAME'] = 'development'
|
438
|
+
ENV['BACKEND_DATABASE_USER'] = 'postgres'
|
439
|
+
```
|
440
|
+
|
418
441
|
### Working with Heroku
|
419
442
|
|
420
443
|
Heroku uses ENV object to store sensitive settings. You cannot upload such files to Heroku because it's ephemeral filesystem gets recreated from the git sources on each instance refresh. To use config with Heroku just set the `use_env` var to `true` as mentioned above.
|
@@ -460,14 +483,56 @@ Settings.section.server # => 'google.com'
|
|
460
483
|
Settings.section.ssl_enabled # => false
|
461
484
|
```
|
462
485
|
|
486
|
+
### Working with AWS Secrets Manager
|
487
|
+
|
488
|
+
It is possible to parse variables stored in an AWS Secrets Manager Secret as if they were environment variables by using `Config::Sources::EnvSource`.
|
489
|
+
|
490
|
+
For example, the plaintext secret might look like this:
|
491
|
+
|
492
|
+
```json
|
493
|
+
{
|
494
|
+
"Settings.foo": "hello",
|
495
|
+
"Settings.bar": "world",
|
496
|
+
}
|
497
|
+
```
|
498
|
+
|
499
|
+
In order to load those settings, fetch the settings from AWS Secrets Manager, parse the plaintext as JSON, pass the resulting `Hash` into a new `EnvSource`, load the new source, and reload.
|
500
|
+
|
501
|
+
```ruby
|
502
|
+
# fetch secrets from AWS
|
503
|
+
client = Aws::SecretsManager::Client.new
|
504
|
+
response = client.get_secret_value(secret_id: "#{ENV['ENVIRONMENT']}/my_application")
|
505
|
+
secrets = JSON.parse(response.secret_string)
|
506
|
+
|
507
|
+
# load secrets into config
|
508
|
+
secret_source = Config::Sources::EnvSource.new(secrets)
|
509
|
+
Settings.add_source!(secret_source)
|
510
|
+
Settings.reload!
|
511
|
+
```
|
512
|
+
|
513
|
+
In this case, the following settings will be available:
|
514
|
+
|
515
|
+
```ruby
|
516
|
+
Settings.foo # => "hello"
|
517
|
+
Settings.bar # => "world"
|
518
|
+
```
|
519
|
+
|
520
|
+
By default, `EnvSource` will use configuration for `env_prefix`, `env_separator`, `env_converter`, and `env_parse_values`, but any of these can be overridden in the constructor.
|
521
|
+
|
522
|
+
```ruby
|
523
|
+
secret_source = Config::Sources::EnvSource.new(secrets,
|
524
|
+
prefix: 'MyConfig',
|
525
|
+
separator: '__',
|
526
|
+
converter: nil,
|
527
|
+
parse_values: false)
|
528
|
+
```
|
529
|
+
|
463
530
|
## Contributing
|
464
531
|
|
465
532
|
You are very warmly welcome to help. Please follow our [contribution guidelines](CONTRIBUTING.md)
|
466
533
|
|
467
534
|
Any and all contributions offered in any form, past present or future are understood to be in complete agreement and acceptance with [MIT](LICENSE) license.
|
468
535
|
|
469
|
-
|
470
|
-
|
471
536
|
## Authors
|
472
537
|
|
473
538
|
* [Piotr Kuczynski](http://github.com/pkuczynski)
|
@@ -479,32 +544,24 @@ Any and all contributions offered in any form, past present or future are unders
|
|
479
544
|
|
480
545
|
### Code Contributors
|
481
546
|
|
482
|
-
This project exists thanks to all the people who contribute. [
|
483
|
-
<a href="https://github.com/railsconfig/config/graphs/contributors"><img src="https://opencollective.com/rubyconfig/contributors.svg?width=890&button=false" /></a>
|
547
|
+
This project exists thanks to all the people who contribute and you are very warmly welcome to help. Please follow our [contribution guidelines](CONTRIBUTING.md).
|
484
548
|
|
485
|
-
|
549
|
+
Any and all contributions offered in any form, past present or future are understood to be in complete agreement and acceptance with the [MIT](LICENSE) license.
|
486
550
|
|
487
|
-
[[
|
551
|
+
[![Contributors](https://opencollective.com/rubyconfig/contributors.svg?width=890&button=false)](https://github.com/rubyconfig/config/graphs/contributors)
|
552
|
+
|
553
|
+
### Financial Contributors
|
488
554
|
|
489
|
-
|
555
|
+
[Become a backer](https://opencollective.com/rubyconfig#backer) and support us with a small monthly donation to help us continue our activities. Thank you if you already one! 🙏
|
490
556
|
|
491
|
-
|
557
|
+
[![Backers](https://opencollective.com/rubyconfig/backers.svg?width=890)](https://opencollective.com/rubyconfig)
|
492
558
|
|
493
|
-
####
|
559
|
+
#### Sponsors
|
494
560
|
|
495
|
-
Support this project
|
561
|
+
Support this project by becoming a [sponsor](https://opencollective.com/rubyconfig#sponsor). Your logo will show up here with a link to your website.
|
496
562
|
|
497
|
-
|
498
|
-
<a href="https://opencollective.com/rubyconfig/organization/1/website"><img src="https://opencollective.com/rubyconfig/organization/1/avatar.svg"></a>
|
499
|
-
<a href="https://opencollective.com/rubyconfig/organization/2/website"><img src="https://opencollective.com/rubyconfig/organization/2/avatar.svg"></a>
|
500
|
-
<a href="https://opencollective.com/rubyconfig/organization/3/website"><img src="https://opencollective.com/rubyconfig/organization/3/avatar.svg"></a>
|
501
|
-
<a href="https://opencollective.com/rubyconfig/organization/4/website"><img src="https://opencollective.com/rubyconfig/organization/4/avatar.svg"></a>
|
502
|
-
<a href="https://opencollective.com/rubyconfig/organization/5/website"><img src="https://opencollective.com/rubyconfig/organization/5/avatar.svg"></a>
|
503
|
-
<a href="https://opencollective.com/rubyconfig/organization/6/website"><img src="https://opencollective.com/rubyconfig/organization/6/avatar.svg"></a>
|
504
|
-
<a href="https://opencollective.com/rubyconfig/organization/7/website"><img src="https://opencollective.com/rubyconfig/organization/7/avatar.svg"></a>
|
505
|
-
<a href="https://opencollective.com/rubyconfig/organization/8/website"><img src="https://opencollective.com/rubyconfig/organization/8/avatar.svg"></a>
|
506
|
-
<a href="https://opencollective.com/rubyconfig/organization/9/website"><img src="https://opencollective.com/rubyconfig/organization/9/avatar.svg"></a>
|
563
|
+
[![Sponsors](https://opencollective.com/rubyconfig/sponsors.svg?width=890)](https://opencollective.com/rubyconfig)
|
507
564
|
|
508
565
|
## License
|
509
566
|
|
510
|
-
|
567
|
+
Copyright (C) Piotr Kuczynski. Released under the [MIT License](LICENSE.md).
|
data/config.gemspec
CHANGED
@@ -11,46 +11,44 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = 'Effortless multi-environment settings in Rails, Sinatra, Pandrino and others'
|
12
12
|
s.description = 'Easiest way to manage multi-environment settings in any ruby project or framework: ' +
|
13
13
|
'Rails, Sinatra, Pandrino and others'
|
14
|
-
s.homepage = 'https://github.com/
|
14
|
+
s.homepage = 'https://github.com/rubyconfig/config'
|
15
15
|
s.license = 'MIT'
|
16
16
|
s.extra_rdoc_files = %w[README.md CHANGELOG.md CONTRIBUTING.md LICENSE.md]
|
17
17
|
s.rdoc_options = ['--charset=UTF-8']
|
18
|
-
s.post_install_message = "\n\e[33mThanks for installing Config\e[0m
|
18
|
+
s.post_install_message = "\n\e[33mThanks for installing Config\e[0m
|
19
19
|
Please consider donating to our open collective to help us maintain this project.
|
20
20
|
\n
|
21
|
-
|
21
|
+
Donate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
|
22
22
|
|
23
23
|
s.files = `git ls-files`.split($/)
|
24
|
-
s.files.select! { |file| /(^lib
|
25
|
-
s.files += Dir.glob('doc/**/*')
|
24
|
+
s.files.select! { |file| /(^lib\/|^\w+.md$|\.gemspec$)/ =~ file }
|
26
25
|
|
27
26
|
s.require_paths = ['lib']
|
28
27
|
s.required_ruby_version = '>= 2.4.0'
|
29
28
|
|
30
29
|
s.add_dependency 'deep_merge', '~> 1.2', '>= 1.2.1'
|
31
|
-
s.add_dependency 'dry-validation', '~> 1.0'
|
30
|
+
s.add_dependency 'dry-validation', '~> 1.0', '>= 1.0.0'
|
32
31
|
|
33
32
|
s.add_development_dependency 'rake', '~> 12.0', '>= 12.0.0'
|
34
33
|
|
35
34
|
# Testing
|
36
|
-
s.add_development_dependency 'appraisal', '~> 2.
|
37
|
-
s.add_development_dependency 'rspec', '~> 3.
|
35
|
+
s.add_development_dependency 'appraisal', '~> 2.3', '>= 2.3.0'
|
36
|
+
s.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
|
38
37
|
|
39
38
|
# Default RSpec run will test against latest Rails app
|
40
|
-
unless ENV['APPRAISAL_INITIALIZED']
|
41
|
-
|
39
|
+
unless ENV['APPRAISAL_INITIALIZED'] || ENV['GITHUB_ACTIONS']
|
40
|
+
gems_to_install = /gem "(.*?)", "(.*?)"(?!, platform: (?!\[:ruby\]))/
|
41
|
+
File.read(Dir['gemfiles/rails*.gemfile'].sort.last).scan(gems_to_install) do |name, version|
|
42
42
|
s.add_development_dependency name, version
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
s.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.9'
|
54
|
-
s.add_development_dependency 'simplecov', '~> 0.13.0'
|
46
|
+
if ENV['GITHUB_ACTIONS']
|
47
|
+
# Code coverage is needed only in CI
|
48
|
+
s.add_development_dependency 'simplecov', '~> 0.18.5' if RUBY_ENGINE == 'ruby'
|
49
|
+
else
|
50
|
+
# Static code analysis to be used locally
|
51
|
+
s.add_development_dependency 'mdl', '~> 0.9', '>= 0.9.0'
|
52
|
+
s.add_development_dependency 'rubocop', '~> 0.85.0'
|
55
53
|
end
|
56
54
|
end
|
data/lib/config.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require 'dry-validation'
|
2
1
|
require 'config/compatibility'
|
3
2
|
require 'config/options'
|
4
3
|
require 'config/configuration'
|
5
4
|
require 'config/version'
|
6
|
-
require 'config/integrations/rails/engine' if defined?(::Rails)
|
7
5
|
require 'config/sources/yaml_source'
|
8
6
|
require 'config/sources/hash_source'
|
7
|
+
require 'config/sources/env_source'
|
9
8
|
require 'config/validation/schema'
|
10
9
|
require 'deep_merge'
|
11
10
|
|
@@ -25,7 +24,8 @@ module Config
|
|
25
24
|
merge_nil_values: true,
|
26
25
|
overwrite_arrays: true,
|
27
26
|
merge_hash_arrays: false,
|
28
|
-
validation_contract: nil
|
27
|
+
validation_contract: nil,
|
28
|
+
evaluate_erb_in_yaml: true
|
29
29
|
)
|
30
30
|
|
31
31
|
def self.setup
|
@@ -43,8 +43,9 @@ module Config
|
|
43
43
|
config.add_source!(file.to_s)
|
44
44
|
end
|
45
45
|
|
46
|
+
config.add_source!(Sources::EnvSource.new(ENV)) if Config.use_env
|
47
|
+
|
46
48
|
config.load!
|
47
|
-
config.load_env! if use_env
|
48
49
|
config
|
49
50
|
end
|
50
51
|
|
@@ -23,7 +23,7 @@ module Config
|
|
23
23
|
# Development environment should reload settings on every request
|
24
24
|
if ::Rails.env.development?
|
25
25
|
initializer :config_reload_on_development do
|
26
|
-
|
26
|
+
ActiveSupport.on_load :action_controller_base do
|
27
27
|
if ::Rails::VERSION::MAJOR >= 4
|
28
28
|
prepend_before_action { ::Config.reload! }
|
29
29
|
else
|
data/lib/config/options.rb
CHANGED
@@ -31,42 +31,6 @@ module Config
|
|
31
31
|
@config_sources.unshift(source)
|
32
32
|
end
|
33
33
|
|
34
|
-
def reload_env!
|
35
|
-
return self if ENV.nil? || ENV.empty?
|
36
|
-
|
37
|
-
hash = Hash.new
|
38
|
-
|
39
|
-
ENV.each do |variable, value|
|
40
|
-
separator = Config.env_separator
|
41
|
-
prefix = (Config.env_prefix || Config.const_name).to_s.split(separator)
|
42
|
-
|
43
|
-
keys = variable.to_s.split(separator)
|
44
|
-
|
45
|
-
next if keys.shift(prefix.size) != prefix
|
46
|
-
|
47
|
-
keys.map! { |key|
|
48
|
-
case Config.env_converter
|
49
|
-
when :downcase then
|
50
|
-
key.downcase.to_sym
|
51
|
-
when nil then
|
52
|
-
key.to_sym
|
53
|
-
else
|
54
|
-
raise "Invalid ENV variables name converter: #{Config.env_converter}"
|
55
|
-
end
|
56
|
-
}
|
57
|
-
|
58
|
-
leaf = keys[0...-1].inject(hash) { |h, key|
|
59
|
-
h[key] ||= {}
|
60
|
-
}
|
61
|
-
|
62
|
-
leaf[keys.last] = Config.env_parse_values ? __value(value) : value
|
63
|
-
end
|
64
|
-
|
65
|
-
merge!(hash)
|
66
|
-
end
|
67
|
-
|
68
|
-
alias :load_env! :reload_env!
|
69
|
-
|
70
34
|
# look through all our sources and rebuild the configuration
|
71
35
|
def reload!
|
72
36
|
conf = {}
|
@@ -91,7 +55,6 @@ module Config
|
|
91
55
|
# swap out the contents of the OStruct with a hash (need to recursively convert)
|
92
56
|
marshal_load(__convert(conf).marshal_dump)
|
93
57
|
|
94
|
-
reload_env! if Config.use_env
|
95
58
|
validate!
|
96
59
|
|
97
60
|
self
|
@@ -118,6 +81,8 @@ module Config
|
|
118
81
|
result
|
119
82
|
end
|
120
83
|
|
84
|
+
alias :to_h :to_hash
|
85
|
+
|
121
86
|
def each(*args, &block)
|
122
87
|
marshal_dump.each(*args, &block)
|
123
88
|
end
|
@@ -127,6 +92,10 @@ module Config
|
|
127
92
|
to_hash.to_json(*args)
|
128
93
|
end
|
129
94
|
|
95
|
+
def as_json(options = nil)
|
96
|
+
to_hash.as_json(options)
|
97
|
+
end
|
98
|
+
|
130
99
|
def merge!(hash)
|
131
100
|
current = to_hash
|
132
101
|
DeepMerge.deep_merge!(
|
@@ -143,7 +112,7 @@ module Config
|
|
143
112
|
end
|
144
113
|
|
145
114
|
# Some keywords that don't play nicely with OpenStruct
|
146
|
-
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max].freeze
|
115
|
+
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max exit!].freeze
|
147
116
|
|
148
117
|
# An alternative mechanism for property access.
|
149
118
|
# This let's you do foo['bar'] along with foo.bar.
|
@@ -201,7 +170,6 @@ module Config
|
|
201
170
|
|
202
171
|
h.each do |k, v|
|
203
172
|
k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)
|
204
|
-
s.new_ostruct_member(k)
|
205
173
|
|
206
174
|
if v.is_a?(Hash)
|
207
175
|
v = v["type"] == "hash" ? v["contents"] : __convert(v)
|
@@ -209,21 +177,9 @@ module Config
|
|
209
177
|
v = v.collect { |e| e.instance_of?(Hash) ? __convert(e) : e }
|
210
178
|
end
|
211
179
|
|
212
|
-
s
|
180
|
+
s[k] = v
|
213
181
|
end
|
214
182
|
s
|
215
183
|
end
|
216
|
-
|
217
|
-
# Try to convert string to a correct type
|
218
|
-
def __value(v)
|
219
|
-
case v
|
220
|
-
when 'false'
|
221
|
-
false
|
222
|
-
when 'true'
|
223
|
-
true
|
224
|
-
else
|
225
|
-
Integer(v) rescue Float(v) rescue v
|
226
|
-
end
|
227
|
-
end
|
228
184
|
end
|
229
185
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Config
|
2
|
+
module Sources
|
3
|
+
# Allows settings to be loaded from a "flat" hash with string keys, like ENV.
|
4
|
+
class EnvSource
|
5
|
+
attr_reader :prefix
|
6
|
+
attr_reader :separator
|
7
|
+
attr_reader :converter
|
8
|
+
attr_reader :parse_values
|
9
|
+
|
10
|
+
def initialize(env,
|
11
|
+
prefix: Config.env_prefix || Config.const_name,
|
12
|
+
separator: Config.env_separator,
|
13
|
+
converter: Config.env_converter,
|
14
|
+
parse_values: Config.env_parse_values)
|
15
|
+
@env = env
|
16
|
+
@prefix = prefix.to_s.split(separator)
|
17
|
+
@separator = separator
|
18
|
+
@converter = converter
|
19
|
+
@parse_values = parse_values
|
20
|
+
end
|
21
|
+
|
22
|
+
def load
|
23
|
+
return {} if @env.nil? || @env.empty?
|
24
|
+
|
25
|
+
hash = Hash.new
|
26
|
+
|
27
|
+
@env.each do |variable, value|
|
28
|
+
keys = variable.to_s.split(separator)
|
29
|
+
|
30
|
+
next if keys.shift(prefix.size) != prefix
|
31
|
+
|
32
|
+
keys.map! { |key|
|
33
|
+
case converter
|
34
|
+
when :downcase then
|
35
|
+
key.downcase
|
36
|
+
when nil then
|
37
|
+
key
|
38
|
+
else
|
39
|
+
raise "Invalid ENV variables name converter: #{converter}"
|
40
|
+
end
|
41
|
+
}
|
42
|
+
|
43
|
+
leaf = keys[0...-1].inject(hash) { |h, key|
|
44
|
+
h[key] ||= {}
|
45
|
+
}
|
46
|
+
|
47
|
+
unless leaf.is_a?(Hash)
|
48
|
+
conflicting_key = (prefix + keys[0...-1]).join(separator)
|
49
|
+
raise "Environment variable #{variable} conflicts with variable #{conflicting_key}"
|
50
|
+
end
|
51
|
+
|
52
|
+
leaf[keys.last] = parse_values ? __value(value) : value
|
53
|
+
end
|
54
|
+
|
55
|
+
hash
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
# Try to convert string to a correct type
|
61
|
+
def __value(v)
|
62
|
+
case v
|
63
|
+
when 'false'
|
64
|
+
false
|
65
|
+
when 'true'
|
66
|
+
true
|
67
|
+
else
|
68
|
+
Integer(v) rescue Float(v) rescue v
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -5,14 +5,20 @@ module Config
|
|
5
5
|
module Sources
|
6
6
|
class YAMLSource
|
7
7
|
attr_accessor :path
|
8
|
+
attr_reader :evaluate_erb
|
8
9
|
|
9
|
-
def initialize(path)
|
10
|
+
def initialize(path, evaluate_erb: Config.evaluate_erb_in_yaml)
|
10
11
|
@path = path.to_s
|
12
|
+
@evaluate_erb = !!evaluate_erb
|
11
13
|
end
|
12
14
|
|
13
15
|
# returns a config hash from the YML file
|
14
16
|
def load
|
15
|
-
|
17
|
+
if @path and File.exist?(@path)
|
18
|
+
file_contents = IO.read(@path)
|
19
|
+
file_contents = ERB.new(file_contents).result if evaluate_erb
|
20
|
+
result = YAML.load(file_contents)
|
21
|
+
end
|
16
22
|
|
17
23
|
result || {}
|
18
24
|
|
data/lib/config/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Kuczynski
|
8
8
|
- Fred Wu
|
9
9
|
- Jacques Crocker
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: deep_merge
|
@@ -36,6 +36,9 @@ dependencies:
|
|
36
36
|
name: dry-validation
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 1.0.0
|
39
42
|
- - "~>"
|
40
43
|
- !ruby/object:Gem::Version
|
41
44
|
version: '1.0'
|
@@ -43,6 +46,9 @@ dependencies:
|
|
43
46
|
prerelease: false
|
44
47
|
version_requirements: !ruby/object:Gem::Requirement
|
45
48
|
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 1.0.0
|
46
52
|
- - "~>"
|
47
53
|
- !ruby/object:Gem::Version
|
48
54
|
version: '1.0'
|
@@ -72,40 +78,40 @@ dependencies:
|
|
72
78
|
requirements:
|
73
79
|
- - ">="
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
81
|
+
version: 2.3.0
|
76
82
|
- - "~>"
|
77
83
|
- !ruby/object:Gem::Version
|
78
|
-
version: '2.
|
84
|
+
version: '2.3'
|
79
85
|
type: :development
|
80
86
|
prerelease: false
|
81
87
|
version_requirements: !ruby/object:Gem::Requirement
|
82
88
|
requirements:
|
83
89
|
- - ">="
|
84
90
|
- !ruby/object:Gem::Version
|
85
|
-
version: 2.
|
91
|
+
version: 2.3.0
|
86
92
|
- - "~>"
|
87
93
|
- !ruby/object:Gem::Version
|
88
|
-
version: '2.
|
94
|
+
version: '2.3'
|
89
95
|
- !ruby/object:Gem::Dependency
|
90
96
|
name: rspec
|
91
97
|
requirement: !ruby/object:Gem::Requirement
|
92
98
|
requirements:
|
93
99
|
- - ">="
|
94
100
|
- !ruby/object:Gem::Version
|
95
|
-
version: 3.
|
101
|
+
version: 3.9.0
|
96
102
|
- - "~>"
|
97
103
|
- !ruby/object:Gem::Version
|
98
|
-
version: '3.
|
104
|
+
version: '3.9'
|
99
105
|
type: :development
|
100
106
|
prerelease: false
|
101
107
|
version_requirements: !ruby/object:Gem::Requirement
|
102
108
|
requirements:
|
103
109
|
- - ">="
|
104
110
|
- !ruby/object:Gem::Version
|
105
|
-
version: 3.
|
111
|
+
version: 3.9.0
|
106
112
|
- - "~>"
|
107
113
|
- !ruby/object:Gem::Version
|
108
|
-
version: '3.
|
114
|
+
version: '3.9'
|
109
115
|
- !ruby/object:Gem::Dependency
|
110
116
|
name: bootsnap
|
111
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,14 +132,14 @@ dependencies:
|
|
126
132
|
requirements:
|
127
133
|
- - '='
|
128
134
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
135
|
+
version: 6.0.3.1
|
130
136
|
type: :development
|
131
137
|
prerelease: false
|
132
138
|
version_requirements: !ruby/object:Gem::Requirement
|
133
139
|
requirements:
|
134
140
|
- - '='
|
135
141
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
142
|
+
version: 6.0.3.1
|
137
143
|
- !ruby/object:Gem::Dependency
|
138
144
|
name: rspec-rails
|
139
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,54 +154,40 @@ dependencies:
|
|
148
154
|
- - "~>"
|
149
155
|
- !ruby/object:Gem::Version
|
150
156
|
version: '3.7'
|
151
|
-
- !ruby/object:Gem::Dependency
|
152
|
-
name: sqlite3
|
153
|
-
requirement: !ruby/object:Gem::Requirement
|
154
|
-
requirements:
|
155
|
-
- - "<"
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: 1.4.0
|
158
|
-
type: :development
|
159
|
-
prerelease: false
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
161
|
-
requirements:
|
162
|
-
- - "<"
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
version: 1.4.0
|
165
157
|
- !ruby/object:Gem::Dependency
|
166
158
|
name: mdl
|
167
159
|
requirement: !ruby/object:Gem::Requirement
|
168
160
|
requirements:
|
169
161
|
- - ">="
|
170
162
|
- !ruby/object:Gem::Version
|
171
|
-
version: 0.
|
163
|
+
version: 0.9.0
|
172
164
|
- - "~>"
|
173
165
|
- !ruby/object:Gem::Version
|
174
|
-
version: '0.
|
166
|
+
version: '0.9'
|
175
167
|
type: :development
|
176
168
|
prerelease: false
|
177
169
|
version_requirements: !ruby/object:Gem::Requirement
|
178
170
|
requirements:
|
179
171
|
- - ">="
|
180
172
|
- !ruby/object:Gem::Version
|
181
|
-
version: 0.
|
173
|
+
version: 0.9.0
|
182
174
|
- - "~>"
|
183
175
|
- !ruby/object:Gem::Version
|
184
|
-
version: '0.
|
176
|
+
version: '0.9'
|
185
177
|
- !ruby/object:Gem::Dependency
|
186
178
|
name: rubocop
|
187
179
|
requirement: !ruby/object:Gem::Requirement
|
188
180
|
requirements:
|
189
181
|
- - "~>"
|
190
182
|
- !ruby/object:Gem::Version
|
191
|
-
version:
|
183
|
+
version: 0.85.0
|
192
184
|
type: :development
|
193
185
|
prerelease: false
|
194
186
|
version_requirements: !ruby/object:Gem::Requirement
|
195
187
|
requirements:
|
196
188
|
- - "~>"
|
197
189
|
- !ruby/object:Gem::Version
|
198
|
-
version:
|
190
|
+
version: 0.85.0
|
199
191
|
description: 'Easiest way to manage multi-environment settings in any ruby project
|
200
192
|
or framework: Rails, Sinatra, Pandrino and others'
|
201
193
|
email:
|
@@ -219,11 +211,11 @@ files:
|
|
219
211
|
- lib/config/compatibility.rb
|
220
212
|
- lib/config/configuration.rb
|
221
213
|
- lib/config/integrations/heroku.rb
|
222
|
-
- lib/config/integrations/rails/engine.rb
|
223
214
|
- lib/config/integrations/rails/railtie.rb
|
224
215
|
- lib/config/integrations/sinatra.rb
|
225
216
|
- lib/config/options.rb
|
226
217
|
- lib/config/rack/reloader.rb
|
218
|
+
- lib/config/sources/env_source.rb
|
227
219
|
- lib/config/sources/hash_source.rb
|
228
220
|
- lib/config/sources/yaml_source.rb
|
229
221
|
- lib/config/tasks/heroku.rake
|
@@ -238,16 +230,12 @@ files:
|
|
238
230
|
- lib/generators/config/templates/settings/development.yml
|
239
231
|
- lib/generators/config/templates/settings/production.yml
|
240
232
|
- lib/generators/config/templates/settings/test.yml
|
241
|
-
|
242
|
-
- spec/app/rails_5.1/README.md
|
243
|
-
- spec/app/rails_5.2/README.md
|
244
|
-
homepage: https://github.com/railsconfig/config
|
233
|
+
homepage: https://github.com/rubyconfig/config
|
245
234
|
licenses:
|
246
235
|
- MIT
|
247
236
|
metadata: {}
|
248
|
-
post_install_message: "\n\e[33mThanks for installing Config\e[0m
|
249
|
-
|
250
|
-
\ Donate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
|
237
|
+
post_install_message: "\n\e[33mThanks for installing Config\e[0m\nPlease consider
|
238
|
+
donating to our open collective to help us maintain this project.\n\n\nDonate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
|
251
239
|
rdoc_options:
|
252
240
|
- "--charset=UTF-8"
|
253
241
|
require_paths:
|
@@ -263,8 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
251
|
- !ruby/object:Gem::Version
|
264
252
|
version: '0'
|
265
253
|
requirements: []
|
266
|
-
rubygems_version: 3.0.
|
267
|
-
signing_key:
|
254
|
+
rubygems_version: 3.0.3
|
255
|
+
signing_key:
|
268
256
|
specification_version: 4
|
269
257
|
summary: Effortless multi-environment settings in Rails, Sinatra, Pandrino and others
|
270
258
|
test_files: []
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|