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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62d952100ee8c4be7d81a400178f58455618e239253b9cc1b40ab5667c95ab6b
4
- data.tar.gz: 8c761dc94c958fd3be1b50b6536576cf4b9a808979c9bf01c877b1e23221bab3
3
+ metadata.gz: ee519ff161881da7c9d53d57fe1e762a9e89df557e5f5bb4d3df58e5de1731dd
4
+ data.tar.gz: 84b2e06bf6c70acfed4f466a72da5222b9fba028cf551fa7d82a3bbce90351a0
5
5
  SHA512:
6
- metadata.gz: 92e7da5bd0166fadaabb78713728975147dde76c81237e2d2e0b56ecd0a3c05744beacce87dad796b17b57ec55ccd83e1d53e1a4179a10e612e7917736301ce7
7
- data.tar.gz: 740929794520b7085bc6b57bc75e559e165e4fc1ea1235db1da0743275bad34e336952a9d776bee7df7679bf4f3c39c517e175a070a395f53bea9ea9f4b90ac7
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
@@ -30,9 +30,9 @@ module KeyTree
30
30
  end
31
31
 
32
32
  def fetch(key)
33
- return tree_with_key(key).fetch(key) unless block_given?
33
+ return tree_with_key(key)[key] unless block_given?
34
34
 
35
- values = trees_with_key(key).map { |tree| tree.fetch(key) }
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
@@ -23,7 +23,6 @@ module KeyTree
23
23
  end
24
24
 
25
25
  def fetch(key_or_path, *args, &missing_key)
26
- missing_key ||= default_proc
27
26
  super(Path[key_or_path], *args, &missing_key)
28
27
  end
29
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: key_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calle Englund