dot_hash 0.5.6 → 0.5.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6470ab371c8535a3339aaed17e5bac24ddba862b
|
|
4
|
+
data.tar.gz: e9f5dcb591ceef47f6cbbbb9b20ef03e74eec2d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7bbae3c691aa833263069eba3384c5bca5291dbecb9759a05dab2251bc6647c56b6c3b4cc435ce6b621475087bfbd8e94623216bdb0611d5550b1c8adc42886f
|
|
7
|
+
data.tar.gz: 18c7a8704cb1dde10320464d70acec2c7eba1095d18c51e9acddb8a05dd37c1e06ae517539699dce370a114fdf8c4c38a5224462c14b2d53541a496e80643c1c
|
data/lib/dot_hash.rb
CHANGED
data/lib/dot_hash/settings.rb
CHANGED
data/lib/dot_hash/version.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
require_relative "../test_helper"
|
|
2
2
|
|
|
3
3
|
module DotHash
|
|
4
|
-
describe
|
|
4
|
+
describe Loader do
|
|
5
5
|
|
|
6
6
|
describe "#load" do
|
|
7
7
|
it "merges the given hashes" do
|
|
8
|
-
loader =
|
|
8
|
+
loader = Loader.new(
|
|
9
9
|
{a: 1, b: {c: 2}},
|
|
10
10
|
{b: {x: {z: 10}}}
|
|
11
11
|
)
|
|
@@ -13,7 +13,7 @@ module DotHash
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it "loads from a file" do
|
|
16
|
-
loader =
|
|
16
|
+
loader = Loader.new fixtures_path("configs1.yaml")
|
|
17
17
|
|
|
18
18
|
loader.load.must_equal({
|
|
19
19
|
"default" => {"attr" => {"speed"=>10, "power"=>11}},
|
|
@@ -22,7 +22,7 @@ module DotHash
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "loads from two files" do
|
|
25
|
-
loader =
|
|
25
|
+
loader = Loader.new(
|
|
26
26
|
fixtures_path("configs1.yaml"),
|
|
27
27
|
fixtures_path("configs2.yaml")
|
|
28
28
|
)
|
|
@@ -34,13 +34,13 @@ module DotHash
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
it "does not load files without the yaml extension" do
|
|
37
|
-
loader =
|
|
37
|
+
loader = Loader.new fixtures_path("config.yaml.example")
|
|
38
38
|
|
|
39
39
|
loader.load.must_equal({})
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
it "loads from a directory" do
|
|
43
|
-
loader =
|
|
43
|
+
loader = Loader.new fixtures_path
|
|
44
44
|
|
|
45
45
|
loader.load.must_equal({
|
|
46
46
|
"default"=>{"attr"=>{"speed"=>10, "power"=>11}},
|
|
@@ -50,7 +50,7 @@ module DotHash
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
it "loads ERB files" do
|
|
53
|
-
loader =
|
|
53
|
+
loader = Loader.new fixtures_path("configs3.yaml.erb")
|
|
54
54
|
|
|
55
55
|
loader.load.must_equal({
|
|
56
56
|
"hero"=>{"name"=>"Eden", "power"=>100, "location"=>TESTS_PATH}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dot_hash
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marcelo Eden
|
|
@@ -39,14 +39,14 @@ files:
|
|
|
39
39
|
- Rakefile
|
|
40
40
|
- dot_hash.gemspec
|
|
41
41
|
- lib/dot_hash.rb
|
|
42
|
-
- lib/dot_hash/hash_loader.rb
|
|
43
42
|
- lib/dot_hash/hash_to_properties.rb
|
|
43
|
+
- lib/dot_hash/loader.rb
|
|
44
44
|
- lib/dot_hash/properties.rb
|
|
45
45
|
- lib/dot_hash/settings.rb
|
|
46
46
|
- lib/dot_hash/version.rb
|
|
47
47
|
- test/dot_hash/custom_settings_test.rb
|
|
48
|
-
- test/dot_hash/hash_loader_test.rb
|
|
49
48
|
- test/dot_hash/hash_to_properties_test.rb
|
|
49
|
+
- test/dot_hash/loader_test.rb
|
|
50
50
|
- test/dot_hash/properties_test.rb
|
|
51
51
|
- test/dot_hash/settings_test.rb
|
|
52
52
|
- test/fixtures/config.yaml.example
|
|
@@ -79,8 +79,8 @@ specification_version: 4
|
|
|
79
79
|
summary: Converts hash.to_properties so you can access values using properties.some_key
|
|
80
80
|
test_files:
|
|
81
81
|
- test/dot_hash/custom_settings_test.rb
|
|
82
|
-
- test/dot_hash/hash_loader_test.rb
|
|
83
82
|
- test/dot_hash/hash_to_properties_test.rb
|
|
83
|
+
- test/dot_hash/loader_test.rb
|
|
84
84
|
- test/dot_hash/properties_test.rb
|
|
85
85
|
- test/dot_hash/settings_test.rb
|
|
86
86
|
- test/fixtures/config.yaml.example
|