xkeys 2.0.1 → 2.1.0
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.
- data/HISTORY.txt +4 -0
- data/lib/xkeys.rb +5 -2
- data/xkeys.gemspec +2 -2
- metadata +3 -3
data/HISTORY.txt
CHANGED
data/lib/xkeys.rb
CHANGED
@@ -27,7 +27,10 @@
|
|
27
27
|
# #fetch to be supported (see the Array or Hash class documentation).
|
28
28
|
# They must also implement #push if you want to use push mode (index ":[]").
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# As of version 2.1.0, #[] is used if #fetch is not supported. Missing-key
|
31
|
+
# detection (still) depends on KeyError or IndexError being raised.
|
32
|
+
#
|
33
|
+
# Version 2.1.0 2014-05-06
|
31
34
|
#
|
32
35
|
# @author Brian Katzung <briank@kappacs.com>, Kappa Computer Solutions, LLC
|
33
36
|
# @copyright 2013-2014 Brian Katzung and Kappa Computer Solutions, LLC
|
@@ -64,7 +67,7 @@ module XKeys::Get
|
|
64
67
|
end
|
65
68
|
|
66
69
|
args[0..last].inject(self) do |node, key|
|
67
|
-
begin node.fetch key
|
70
|
+
begin node.respond_to?(:fetch) ? node.fetch(key) : node[key]
|
68
71
|
rescue KeyError, IndexError
|
69
72
|
if options[:raise] && options[:raise] != true
|
70
73
|
raise *options[:raise]
|
data/xkeys.gemspec
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 2
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 2.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brian Katzung
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2014-
|
17
|
+
date: 2014-05-06 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|