jsonpath 0.9.4 → 0.9.5
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 +4 -4
- data/lib/jsonpath/parser.rb +1 -1
- data/lib/jsonpath/version.rb +1 -1
- data/test/test_jsonpath.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92cc1431a2d3381ea1a5942316f4c0884a84249c
|
4
|
+
data.tar.gz: 810157f1beaf693630d191774bc3536cb0ee0828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5be1e7f785e4a9925d6990c4509af7e932f2cbfe82a48574a20466eb81e40a3ebdb760b21774fa4208b0ea1758f6dde4d27e3fb8df76f349e7b84bb5208ccbd
|
7
|
+
data.tar.gz: c6d8effb1c4764cc3587c691ab5610acb35e1eaf758c76c69ec09905105f77a796ebbaa6a72b42332524645bdee6fbfeee3dd2dc1ac3f944aa8f00df36f2ab11
|
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.
|
50
|
+
operator.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
@@ -591,6 +591,18 @@ class TestJsonpath < MiniTest::Unit::TestCase
|
|
591
591
|
assert_equal 'C09C5GYHF', JsonPath.on(json, "$..channels[?(@.is_archived == 'false')].id")[0]
|
592
592
|
end
|
593
593
|
|
594
|
+
def test_quote
|
595
|
+
json = {
|
596
|
+
channels: [
|
597
|
+
{
|
598
|
+
name: "King's Speech",
|
599
|
+
}
|
600
|
+
]
|
601
|
+
}.to_json
|
602
|
+
|
603
|
+
assert_equal [{"name" => "King\'s Speech"}], JsonPath.on(json, "$..channels[?(@.name == 'King\'s Speech')]")
|
604
|
+
end
|
605
|
+
|
594
606
|
def test_changed
|
595
607
|
json =
|
596
608
|
{
|
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.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: 2018-
|
12
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project: jsonpath
|
162
|
-
rubygems_version: 2.6
|
162
|
+
rubygems_version: 2.4.6
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Ruby implementation of http://goessner.net/articles/JsonPath/
|