key_tree 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RELEASE_NOTES.md +11 -0
- data/lib/key_tree/forest.rb +2 -2
- data/lib/key_tree/tree.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee519ff161881da7c9d53d57fe1e762a9e89df557e5f5bb4d3df58e5de1731dd
|
4
|
+
data.tar.gz: 84b2e06bf6c70acfed4f466a72da5222b9fba028cf551fa7d82a3bbce90351a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d644e3a3d63f34f6edbc0fbc17a2c8f26499d2fe508e186274698b2ff733100f97e5efe62ce2bb4e7c1b35f07282fe5994447e1f7171c57f0cd8408798bbbf8
|
7
|
+
data.tar.gz: 6dd6f1e13e04bd7a8cbe8cce7d9b36a9ff76ac05c3ffc3fffa5bd12a38fc620f115ff94c37e913b6683aa2980d3c4ddd871b16cebfa622d71a3413fa6a2adf1d
|
data/RELEASE_NOTES.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
+
## v0.5.2 – 2018-05-19
|
4
|
+
|
5
|
+
### Bug fixes
|
6
|
+
|
7
|
+
#### Conform to Hash#fetch API
|
8
|
+
`Tree#fetch` confused its block argument with `#default_proc`, but they
|
9
|
+
have different arguments, so that didn't work out well.
|
10
|
+
|
11
|
+
* 0bd0a6e8 Use proper method to retreive values from trees
|
12
|
+
* 14128a6a Conform to Hash#fetch API
|
13
|
+
|
3
14
|
## v0.5.1 – 2018-05-19
|
4
15
|
|
5
16
|
### New methods
|
data/lib/key_tree/forest.rb
CHANGED
@@ -30,9 +30,9 @@ module KeyTree
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def fetch(key)
|
33
|
-
return tree_with_key(key)
|
33
|
+
return tree_with_key(key)[key] unless block_given?
|
34
34
|
|
35
|
-
values = trees_with_key(key).map { |tree| tree
|
35
|
+
values = trees_with_key(key).map { |tree| tree[key] }
|
36
36
|
values.reverse.reduce { |left, right| yield(key, left, right) }
|
37
37
|
end
|
38
38
|
|
data/lib/key_tree/tree.rb
CHANGED