dry-config 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -5
- data/lib/dry/config/base.rb +3 -3
- data/lib/dry/config/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676591550dec732ede12a3bb7b72452ab2ea6347
|
4
|
+
data.tar.gz: 9f140632b65169bafc5306c6f945cd846626be91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc431b635f0f9284b37366051ffa57a28073d2eb64a35ee7bc0278c317982240dd984ea3dd07d435489d1268c3529add547bf25ab195983db1468ce7a0c9c2f
|
7
|
+
data.tar.gz: 6100ea47ef1e198cfab7d024b09ad8f7b5d00f6ee1835313e4dbf48b9271b0078db15181e20b129fc633be14586ec5e3ae94cb6ce92cefc43d7258ac6d7afba3
|
data/README.md
CHANGED
@@ -149,13 +149,10 @@ The default configuration is provided below, override any of these values on con
|
|
149
149
|
symbolize: true, # provide symbol based key access for everything i.e. access :development instead of 'development' as a rule
|
150
150
|
unsymbolize_to_yaml: true, # on to_yaml or write_yaml_file unsymbolize keys (several external tools do not do well with symbolized keys i.e. write `development:` instead of `:development:`
|
151
151
|
default_configuration: {}, # seed configuration (file contents overlay this)
|
152
|
-
|
153
|
-
[:development, :test, :staging, :production] # used for pruning (optional)
|
152
|
+
prune:
|
153
|
+
[:development, :test, :staging, :production] # used for pruning final configuration (optional - nice to have cleanup)
|
154
154
|
}
|
155
155
|
```
|
156
|
-
- Expected environments are `[:development, :test, :staging, :production]`. Expand or redefine `@potential_environments` these by overriding the `#initialize` or doing so in your optional `#seed_default_configuration`. This is used in the used in the overlay pruning process to prevent unused branches of configuration from showing up in the resolved configuration.
|
157
|
-
- An optional `#seed_default_configuration` allows you to provide a configuration base
|
158
|
-
- `#clear` will restore to the seed configuration, allowing you to `#load!` new settings.
|
159
156
|
|
160
157
|
## Contributing
|
161
158
|
|
data/lib/dry/config/base.rb
CHANGED
@@ -28,13 +28,13 @@ module Dry
|
|
28
28
|
symbolize: true, # provide symbol based key access for everything
|
29
29
|
unsymbolize_to_yaml: true, # on to_yaml or write_yaml_file unsymbolize keys
|
30
30
|
default_configuration: {}, # seed configuration
|
31
|
-
|
31
|
+
prune: [:development, :test, :staging, :production] # used for pruning (optional)
|
32
32
|
}.merge options
|
33
33
|
|
34
34
|
@default_configuration = @options[:default_configuration]
|
35
35
|
|
36
36
|
# (optional) used for pruning initial base set. See #resolve_config
|
37
|
-
@
|
37
|
+
@prune = @options[:prune]
|
38
38
|
|
39
39
|
# setup a default configuration
|
40
40
|
clear
|
@@ -69,7 +69,7 @@ module Dry
|
|
69
69
|
should_overlay_environment = environment && config[environment]
|
70
70
|
|
71
71
|
# Prune all known environments so that we end up with the top-level configuration.
|
72
|
-
@
|
72
|
+
@prune.each do |env|
|
73
73
|
config.delete(env)
|
74
74
|
end
|
75
75
|
|
data/lib/dry/config/version.rb
CHANGED