jsonpath 0.9.8 → 0.9.9
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 +5 -5
- data/.travis.yml +3 -0
- data/lib/jsonpath/parser.rb +1 -1
- data/lib/jsonpath/version.rb +1 -1
- data/test/test_jsonpath.rb +5 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '090827e0ad9fbdb81bf8a03fbd783b3ec6791fe75f272f34a867d4230941acbc'
|
4
|
+
data.tar.gz: 1590a5a7c869b86f6c8f9cd2f6fc356fffb7d1456012adbdcd1c39a2cad08ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e38791ff5794763c762360b7721944f283c32f317e10e046171c6a57b40afb62b0f9cc5db924f52a95b2135b248a8e055a7da08341b95641dc38fec3e8b26f
|
7
|
+
data.tar.gz: 52e95058cf0373fc98c3773585542960bd3a1cac2f13e3b038820cc6c91311f165441a2aa80644c20ad60be1c9c04cb17b5dfd79c8307e7a70627969aabe7c90
|
data/.travis.yml
CHANGED
data/lib/jsonpath/parser.rb
CHANGED
@@ -47,7 +47,7 @@ class JsonPath
|
|
47
47
|
elsif t == 'false'
|
48
48
|
false
|
49
49
|
else
|
50
|
-
operator.strip == '=~' ? t.to_regexp : t.gsub(%r{^'|'$}, '').strip
|
50
|
+
operator.to_s.strip == '=~' ? t.to_regexp : t.gsub(%r{^'|'$}, '').strip
|
51
51
|
end
|
52
52
|
elsif t = scanner.scan(/\/\w+\//)
|
53
53
|
elsif t = scanner.scan(/.*/)
|
data/lib/jsonpath/version.rb
CHANGED
data/test/test_jsonpath.rb
CHANGED
@@ -84,6 +84,11 @@ class TestJsonpath < MiniTest::Unit::TestCase
|
|
84
84
|
assert_equal [@object['store']['book'][1]], JsonPath.new("$..book[?(@['price'] < 23 && @['price'] > 9)]").on(@object)
|
85
85
|
end
|
86
86
|
|
87
|
+
def test_nested_grouping
|
88
|
+
path = "$..book[?((@['price'] == 19 && @['author'] == 'Herman Melville') || @['price'] == 23)]"
|
89
|
+
assert_equal [@object['store']['book'][3]], JsonPath.new(path).on(@object)
|
90
|
+
end
|
91
|
+
|
87
92
|
def test_eval_with_floating_point_and_and
|
88
93
|
assert_equal [@object['store']['book'][1]], JsonPath.new("$..book[?(@['price'] < 23.0 && @['price'] > 9.0)]").on(@object)
|
89
94
|
end
|
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.9.
|
4
|
+
version: 0.9.9
|
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:
|
12
|
+
date: 2019-01-07 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
|
-
|
162
|
-
rubygems_version: 2.6.13
|
161
|
+
rubygems_version: 3.0.2
|
163
162
|
signing_key:
|
164
163
|
specification_version: 4
|
165
164
|
summary: Ruby implementation of http://goessner.net/articles/JsonPath/
|