jsonpath 1.0.4 → 1.0.5

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: 3d49972014868528c0c690ecec0ec7d6e06056f14a803637d494c87ee3100de0
4
- data.tar.gz: fbbb8f93028b2aac45f6727aba4e874c51db91bb599bc568ec62c94180595a91
3
+ metadata.gz: 2eda27c92a0608bfe616796cdfdfd8020db7e91f1246533d04e8d141fd2df17c
4
+ data.tar.gz: 12bb579fd9915045afeffc02f6ef9c911b5dcf97597c20c8f7c2990bcacc58df
5
5
  SHA512:
6
- metadata.gz: 60c7d6e4075b9ece68f6325d2b836f228b780304ac0ddafbfe2154668f07c10d4faee371135b9b9c55f7548a89a7f755d6536b4305e47f486112549c9b2711b1
7
- data.tar.gz: cf72f327c8a3d12bb4780cf052846e9183218148dcf5e57fcddaeb0c1b86218f9a082d4b3cb7f7e38e390956176da71a954e855ae33436f9ce396a1eb73fd2f7
6
+ metadata.gz: b7ad942b6146950aed615c56d3944f7888cded5dba6eeb76048db8489e56d19e978c380f43befa4a4914437e1880d4fddc3b0df8b447cea1c5dc60a32548b217
7
+ data.tar.gz: 1d79042eefed77ca6956f6a75a148a695a9851afe6f72d99a490802a6aaaaf5abc84653fdc5aa296a31bf6151ac1965c2f6d85c55efd4915d3ced951eba11a40
@@ -64,7 +64,7 @@ class JsonPath
64
64
  if node.is_a?(Hash)
65
65
  node[k] ||= nil if @options[:default_path_leaf_to_null]
66
66
  each(node, k, pos + 1, &blk) if node.key?(k)
67
- elsif node.respond_to?(k.to_s)
67
+ elsif node.respond_to?(k.to_s) && !Object.respond_to?(k.to_s)
68
68
  each(node, k, pos + 1, &blk)
69
69
  end
70
70
  when '?'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class JsonPath
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
5
5
  end
@@ -909,6 +909,19 @@ class TestJsonpath < MiniTest::Unit::TestCase
909
909
  assert_equal [{ 'cate gory' => 'reference', 'author' => 'Nigel Rees' }], JsonPath.on(json, "$.store.book[?(@['price'] == 8.95)]( cate gory, author )")
910
910
  end
911
911
 
912
+ def test_object_method_send
913
+ j = {height: 5, hash: "some_hash"}.to_json
914
+ hs = JsonPath.new "$..send"
915
+ assert_equal([], hs.on(j))
916
+ hs = JsonPath.new "$..hash"
917
+ assert_equal(["some_hash"], hs.on(j))
918
+ hs = JsonPath.new "$..send"
919
+ assert_equal([], hs.on(j))
920
+ j = {height: 5, send: "should_still_work"}.to_json
921
+ hs = JsonPath.new "$..send"
922
+ assert_equal(['should_still_work'], hs.on(j))
923
+ end
924
+
912
925
  def example_object
913
926
  { 'store' => {
914
927
  'book' => [
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: 1.0.4
4
+ version: 1.0.5
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: 2019-06-03 00:00:00.000000000 Z
12
+ date: 2019-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -158,8 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubyforge_project: jsonpath
162
- rubygems_version: 2.7.3
161
+ rubygems_version: 3.0.6
163
162
  signing_key:
164
163
  specification_version: 4
165
164
  summary: Ruby implementation of http://goessner.net/articles/JsonPath/