jsonpath 0.8.2 → 0.8.3

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
- SHA256:
3
- metadata.gz: 250b6d90a78bf853330c06f41cacee3207c39e1cb5a13a0ea747f6511660fefb
4
- data.tar.gz: 22a728dbfe6c1ca44884db61e4e2dc2e89c355b7fa4c308fb0bcfc9a2bb3e815
2
+ SHA1:
3
+ metadata.gz: 1dcbbacec3f46ae20e35ed77388c04a88ad1ef71
4
+ data.tar.gz: 57aa1fec4c9556b8553521050c36bf8b18da6426
5
5
  SHA512:
6
- metadata.gz: 44abf571b8d09b3dd4c5ec51a801ca064cfc08569a4121d58d456bd8403c3396b33f8f369992b258016374c8d823825f1619430c7434ebba2eec1bc19dd10b8c
7
- data.tar.gz: 11ec6a115406f90775f3eb73b959befc1249e47d998b6679f5fcca671b04a694872282aa6ac6b79faad8d6fd1767c84b65abea536e0773518d76329ebb866ceb
6
+ metadata.gz: 17d51a6fefe97232268f2fd393de4a2df23bd777a80207fbab5a5acce2259348e0683500b9e38c911f60fcf9dc55200c943c388a5c61044fc15e0c337838851d
7
+ data.tar.gz: 62a738bdde2652f8c8936c11fe1ed300f87bd6d9b758b3d79f190370bd04cb91c7336a8e9bc8e2268a258782f6e12badfe1a5647fd98eed00f4fa30cd807136a
@@ -53,6 +53,7 @@ class JsonPath
53
53
 
54
54
  # @TODO: Remove this once JsonPath no longer supports ruby versions below 2.3
55
55
  def dig(keys, hash)
56
+ return hash unless hash.is_a? Hash
56
57
  return nil unless hash.key?(keys.first)
57
58
  return hash.fetch(keys.first) if keys.size == 1
58
59
  prev = keys.shift
@@ -1,3 +1,3 @@
1
1
  class JsonPath
2
- VERSION = '0.8.2'.freeze
2
+ VERSION = '0.8.3'.freeze
3
3
  end
@@ -255,10 +255,9 @@ class TestJsonpath < MiniTest::Unit::TestCase
255
255
  JsonPath.new("$.store._links").on(@object)
256
256
  end
257
257
 
258
- # def test_filter_support_include
259
- # #assert_equal true, JsonPath.new("$.store.book[(@.tags == 'asdf3')]").on(@object)
260
- # assert_equal true, JsonPath.new("$.store.book..tags[?(@ == 'asdf')]").on(@object)
261
- # end
258
+ def test_dig_return_string
259
+ assert_equal ['asdf'], JsonPath.new("$.store.book..tags[?(@ == 'asdf')]").on(@object)
260
+ end
262
261
 
263
262
  def example_object
264
263
  { 'store' => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonpath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Hull
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-26 00:00:00.000000000 Z
12
+ date: 2017-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project: jsonpath
146
- rubygems_version: 2.6.10
146
+ rubygems_version: 2.5.1
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Ruby implementation of http://goessner.net/articles/JsonPath/