config_reader 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +25 -27
- data/checksums/config_reader-2.0.2.gem.sha512 +1 -0
- data/config_reader.gemspec +0 -3
- data/lib/config_reader/version.rb +1 -1
- data/lib/config_reader.rb +12 -4
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d62b191e4d30a81325a11a994d3d663eb2f528bc02307731baae267f2fa08948
|
4
|
+
data.tar.gz: ad668aaecbf1670c81f11d277caa7567630d241b0ee6f94cef5d76c2121001b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e2530d3e104ecc1251283aa2e85b9d0a26b4f42eaf8478c8ec34d6d85e2c9a65ba1f0c3da7dec5b75e276591f7dde37fd19ee1aae0a9c8e866fe0852066c71
|
7
|
+
data.tar.gz: 63cbd8684f90f35a78c42b91ddb6f88872704b8c5468d5f0d485672c601d73105b2fb11c9083458112030101d5a854cda1f4d2d43723f785ca6d119bd7051560
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,43 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
config_reader (2.0.
|
5
|
-
deep_merge
|
4
|
+
config_reader (2.0.2)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: http://rubygems.org/
|
9
8
|
specs:
|
10
9
|
arrayfields (4.9.2)
|
11
10
|
chronic (0.10.2)
|
12
|
-
coderay (1.1.
|
11
|
+
coderay (1.1.3)
|
13
12
|
coerce (0.0.8)
|
14
13
|
chronic (>= 0.6.2)
|
15
|
-
|
16
|
-
diff-lcs (1.3)
|
14
|
+
diff-lcs (1.5.0)
|
17
15
|
fattr (2.4.0)
|
18
16
|
highline (1.7.10)
|
19
|
-
main (6.
|
20
|
-
arrayfields (~> 4.
|
21
|
-
chronic (~> 0.
|
22
|
-
fattr (~> 2.
|
23
|
-
map (~> 6.
|
17
|
+
main (6.3.0)
|
18
|
+
arrayfields (~> 4.9, >= 4.9.2)
|
19
|
+
chronic (~> 0.10, >= 0.10.2)
|
20
|
+
fattr (~> 2.4, >= 2.4.0)
|
21
|
+
map (~> 6.6, >= 6.6.0)
|
24
22
|
map (6.6.0)
|
25
|
-
method_source (0.
|
26
|
-
pry (0.
|
27
|
-
coderay (~> 1.1
|
28
|
-
method_source (~>
|
29
|
-
rake (13.0.
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.
|
32
|
-
rspec-expectations (~> 3.
|
33
|
-
rspec-mocks (~> 3.
|
34
|
-
rspec-core (3.
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-expectations (3.
|
23
|
+
method_source (1.0.0)
|
24
|
+
pry (0.14.2)
|
25
|
+
coderay (~> 1.1)
|
26
|
+
method_source (~> 1.0)
|
27
|
+
rake (13.0.6)
|
28
|
+
rspec (3.12.0)
|
29
|
+
rspec-core (~> 3.12.0)
|
30
|
+
rspec-expectations (~> 3.12.0)
|
31
|
+
rspec-mocks (~> 3.12.0)
|
32
|
+
rspec-core (3.12.1)
|
33
|
+
rspec-support (~> 3.12.0)
|
34
|
+
rspec-expectations (3.12.2)
|
37
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
36
|
+
rspec-support (~> 3.12.0)
|
37
|
+
rspec-mocks (3.12.3)
|
40
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
39
|
+
rspec-support (~> 3.12.0)
|
40
|
+
rspec-support (3.12.0)
|
43
41
|
sekrets (1.13.0)
|
44
42
|
coerce (~> 0.0.3)
|
45
43
|
fattr (~> 2.2)
|
@@ -58,4 +56,4 @@ DEPENDENCIES
|
|
58
56
|
sekrets (~> 1)
|
59
57
|
|
60
58
|
BUNDLED WITH
|
61
|
-
|
59
|
+
2.3.13
|
@@ -0,0 +1 @@
|
|
1
|
+
ecd65abf0eef2de025cf028a84de56bddeb3f6fae18c78565e8f647a3bc79eec777b542c5de26bb74c1c5f7b5cf2ad6eaf71e8061f3729141ac6d38e48367aa7
|
data/config_reader.gemspec
CHANGED
@@ -16,9 +16,6 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
|
-
# specify any dependencies here; for example:
|
20
|
-
s.add_dependency 'deep_merge'
|
21
|
-
|
22
19
|
s.add_development_dependency 'rake'
|
23
20
|
s.add_development_dependency 'rspec', '~> 3.9'
|
24
21
|
s.add_development_dependency 'sekrets', '~> 1'
|
data/lib/config_reader.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'config_reader/version'
|
2
2
|
require 'config_reader/magic_hash'
|
3
3
|
require 'yaml'
|
4
|
-
require 'deep_merge'
|
5
4
|
|
6
5
|
begin
|
7
6
|
require 'erb'
|
@@ -83,9 +82,9 @@ class ConfigReader
|
|
83
82
|
env = configuration.environment
|
84
83
|
|
85
84
|
_conf = conf['defaults']
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
deep_merge!(_conf, sekrets['defaults']) if sekrets && sekrets['defaults']
|
86
|
+
deep_merge!(_conf, conf[env]) if conf[env]
|
87
|
+
deep_merge!(_conf, sekrets[env]) if sekrets && sekrets[env]
|
89
88
|
|
90
89
|
MagicHash.convert_hash(_conf, configuration.ignore_missing_keys)
|
91
90
|
end
|
@@ -99,6 +98,15 @@ class ConfigReader
|
|
99
98
|
@configuration ||= Configuration.new
|
100
99
|
end
|
101
100
|
|
101
|
+
def deep_merge!(hash, other_hash)
|
102
|
+
hash.merge!(other_hash) do |key, this_val, other_val|
|
103
|
+
if this_val.is_a?(Hash) && other_val.is_a?(Hash)
|
104
|
+
deep_merge!(this_val, other_val)
|
105
|
+
else
|
106
|
+
other_val
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
102
110
|
end
|
103
111
|
|
104
112
|
class Configuration
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Moen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: deep_merge
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,6 +81,7 @@ files:
|
|
95
81
|
- License.txt
|
96
82
|
- README.rdoc
|
97
83
|
- Rakefile
|
84
|
+
- checksums/config_reader-2.0.2.gem.sha512
|
98
85
|
- config_reader.gemspec
|
99
86
|
- lib/config_reader.rb
|
100
87
|
- lib/config_reader/magic_hash.rb
|
@@ -125,8 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
112
|
- !ruby/object:Gem::Version
|
126
113
|
version: '0'
|
127
114
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
129
|
-
signing_key:
|
115
|
+
rubygems_version: 3.2.33
|
116
|
+
signing_key:
|
130
117
|
specification_version: 4
|
131
118
|
summary: Provides a way to manage environment specific configuration settings.
|
132
119
|
test_files:
|