config_files 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +5 -3
- data/lib/config_files/version.rb +1 -1
- data/lib/config_files.rb +2 -1
- data/test/config_files_test.rb +3 -3
- data/test/etc/dummy.yml +2 -2
- metadata +5 -6
- data/Gemfile.lock +0 -34
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dabb2b8b5d0fb25738c2d55d02068fd4710f2085425b4236ad8b2da6b62a2167
|
|
4
|
+
data.tar.gz: b10790c4f63c114122a4ccd0aa2a31bbaf897ae22e926838af1ddc2363d65152
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 742b8d8e6955a5c65dcaa5e62c789f9bd0acd24decc3957f7c58d22086d6ce16a25b29b68703ff98c769049350d7c9195deb7144391ca5d179454633de7db164
|
|
7
|
+
data.tar.gz: 623b886403b441802957faeebe5484a29b92fd9bd3b082e67c51270c6d53d5974b8ff0278699602bf2345861eb6c6788027a957677a19679e769a896b8d9ba3e
|
data/.gitignore
CHANGED
data/lib/config_files/version.rb
CHANGED
data/lib/config_files.rb
CHANGED
|
@@ -2,6 +2,7 @@ require 'config_files/file_factory'
|
|
|
2
2
|
require 'config_files/loader_factory'
|
|
3
3
|
require 'config_files/loaders'
|
|
4
4
|
require 'config_files/version'
|
|
5
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
|
5
6
|
require 'active_support/core_ext/hash/deep_merge'
|
|
6
7
|
require 'active_support/core_ext/object/blank'
|
|
7
8
|
|
|
@@ -52,7 +53,7 @@ module ConfigFiles
|
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
def merged_hash(file)
|
|
55
|
-
config_files(file).inject(
|
|
56
|
+
config_files(file).inject(::HashWithIndifferentAccess.new) { |master, file| master.deep_merge(FileFactory.(file)) }
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
def build_combined(file)
|
data/test/config_files_test.rb
CHANGED
|
@@ -3,12 +3,12 @@ require 'minitest/autorun'
|
|
|
3
3
|
require 'config_files'
|
|
4
4
|
class Dummy
|
|
5
5
|
include ConfigFiles
|
|
6
|
-
config_directories :
|
|
6
|
+
config_directories etc: ['test/etc', 'test/nofiles/etc']
|
|
7
7
|
static_config_files :dummy, :broken
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
class Dummy2 < Dummy
|
|
11
|
-
config_directories
|
|
11
|
+
config_directories config: ['test/etc', 'test/nofiles/etc']
|
|
12
12
|
class << self
|
|
13
13
|
def config_key
|
|
14
14
|
"config"
|
|
@@ -51,6 +51,6 @@ class ConfigFilesTest < MiniTest::Test
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def test_defaults_are_picked_up_when_no_directories_used
|
|
54
|
-
assert_equal(
|
|
54
|
+
assert_equal(nil, Defaults.dummy[:config_test])
|
|
55
55
|
end
|
|
56
56
|
end
|
data/test/etc/dummy.yml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
config_test: test
|
|
2
|
+
only_in_yaml: yaml_file
|
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: config_files
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul McKibbin
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2012-11-11 00:00:00.000000000 Z
|
|
@@ -48,7 +48,6 @@ extra_rdoc_files: []
|
|
|
48
48
|
files:
|
|
49
49
|
- ".gitignore"
|
|
50
50
|
- Gemfile
|
|
51
|
-
- Gemfile.lock
|
|
52
51
|
- LICENCE.txt
|
|
53
52
|
- README.md
|
|
54
53
|
- Rakefile
|
|
@@ -71,7 +70,7 @@ homepage: https://github.com/blackrat/config_files
|
|
|
71
70
|
licenses:
|
|
72
71
|
- MIT
|
|
73
72
|
metadata: {}
|
|
74
|
-
post_install_message:
|
|
73
|
+
post_install_message:
|
|
75
74
|
rdoc_options: []
|
|
76
75
|
require_paths:
|
|
77
76
|
- lib
|
|
@@ -86,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
86
85
|
- !ruby/object:Gem::Version
|
|
87
86
|
version: '0'
|
|
88
87
|
requirements: []
|
|
89
|
-
rubygems_version: 3.1.
|
|
90
|
-
signing_key:
|
|
88
|
+
rubygems_version: 3.1.6
|
|
89
|
+
signing_key:
|
|
91
90
|
specification_version: 4
|
|
92
91
|
summary: ConfigFiles is a configuration file access tool. It parses multiple configuration
|
|
93
92
|
files in multiple formats and presents a consistent block to the application with
|
data/Gemfile.lock
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
config_files (0.1.5)
|
|
5
|
-
activesupport (>= 2.2.1)
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: https://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
activesupport (6.0.3.3)
|
|
11
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
12
|
-
i18n (>= 0.7, < 2)
|
|
13
|
-
minitest (~> 5.1)
|
|
14
|
-
tzinfo (~> 1.1)
|
|
15
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
|
16
|
-
concurrent-ruby (1.1.7)
|
|
17
|
-
i18n (1.8.5)
|
|
18
|
-
concurrent-ruby (~> 1.0)
|
|
19
|
-
minitest (5.14.2)
|
|
20
|
-
rake (13.0.1)
|
|
21
|
-
thread_safe (0.3.6)
|
|
22
|
-
tzinfo (1.2.7)
|
|
23
|
-
thread_safe (~> 0.1)
|
|
24
|
-
zeitwerk (2.4.0)
|
|
25
|
-
|
|
26
|
-
PLATFORMS
|
|
27
|
-
ruby
|
|
28
|
-
|
|
29
|
-
DEPENDENCIES
|
|
30
|
-
config_files!
|
|
31
|
-
rake
|
|
32
|
-
|
|
33
|
-
BUNDLED WITH
|
|
34
|
-
1.16.1
|