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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2473ca28bed27ee404a8ad46a73e4752f848f29
4
- data.tar.gz: 647e15073ba118cd82ebae0d21a4d7fb056600f8
3
+ metadata.gz: 92cc1431a2d3381ea1a5942316f4c0884a84249c
4
+ data.tar.gz: 810157f1beaf693630d191774bc3536cb0ee0828
5
5
  SHA512:
6
- metadata.gz: ce6cde76b1d9ccb25bbd83d08d28ff8be128555cde22c1cb64a36d5f296d3dd9b6196ea0fd359f7f6ca94b11ddde46728291752c6a733123677dae128fdd694e
7
- data.tar.gz: 88052cdd548064d68e4cc6a384214dc1712b8661ae509782b2f38b9cbda61b37753938db50b055022629d77821a0669f5e39759138409da61c544fb365be22b2
6
+ metadata.gz: e5be1e7f785e4a9925d6990c4509af7e932f2cbfe82a48574a20466eb81e40a3ebdb760b21774fa4208b0ea1758f6dde4d27e3fb8df76f349e7b84bb5208ccbd
7
+ data.tar.gz: c6d8effb1c4764cc3587c691ab5610acb35e1eaf758c76c69ec09905105f77a796ebbaa6a72b42332524645bdee6fbfeee3dd2dc1ac3f944aa8f00df36f2ab11
@@ -47,7 +47,7 @@ class JsonPath
47
47
  elsif t == 'false'
48
48
  false
49
49
  else
50
- operator.strip == '=~' ? t.to_regexp : t.delete("'").strip
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(/.*/)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class JsonPath
4
- VERSION = '0.9.4'.freeze
4
+ VERSION = '0.9.5'.freeze
5
5
  end
@@ -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
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-08-27 00:00:00.000000000 Z
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.13
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/