jsonpath 0.8.6 → 0.8.7

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
  SHA1:
3
- metadata.gz: dbcb83c2762c708aa6f7ed1bff44def4ef4a6b46
4
- data.tar.gz: ec7e54dd7bde48f57797666fa764d41573a8b6b5
3
+ metadata.gz: c4dc5e8947c2c9855c34c7d0f25fb750393002f9
4
+ data.tar.gz: 5ee652f3eed9380f357d19a0ff53dfa2dd9d64e2
5
5
  SHA512:
6
- metadata.gz: 7a83ff1f0c946ae83ee34a1c9852cc6c05651b70c06c211ae34285a82615ddab21195a62db8a30d747b3ac61b0624f7817556a557d39f39865871e3e69da0308
7
- data.tar.gz: 60e9ffe8463f7a14ed64f741643b9f60444e6c88a8056862f5beb2a7d65539a063a3f8af2724782d74ce99f3b195f64bafaad91f78536b572470eeb02e776f8b
6
+ metadata.gz: 3a462c34b402670a1b627c5de62147ad08e33db5a014cd37dfa53bb6c6a89ce3cc63e272e8c993a5b28ccae29a1069aa27636127bc594e4e0414d6da22c4e0f5
7
+ data.tar.gz: 50ac0441287012f54454e843eab9881f24eeec91d8e7b6b7796f5155dc7b520bd64d8df0e468d52130ad3c68f8d8e560b04e494cd835c8c2a86e689e0ea2523a
@@ -46,6 +46,7 @@ class JsonPath
46
46
  return false unless el
47
47
  return true if operator.nil? && el
48
48
 
49
+ el = Float(el) rescue el
49
50
  operand = Float(operand) rescue operand
50
51
  el.send(operator.strip, operand)
51
52
  end
@@ -1,3 +1,3 @@
1
1
  class JsonPath
2
- VERSION = '0.8.6'.freeze
2
+ VERSION = '0.8.7'.freeze
3
3
  end
@@ -285,6 +285,16 @@ class TestJsonpath < MiniTest::Unit::TestCase
285
285
  assert_equal [{"type"=>0.00001}], JsonPath.new("$.data[?(@.type == 0.00001)]").on(data)
286
286
  end
287
287
 
288
+ def test_digits_only_string
289
+ data = {
290
+ 'foo' => {
291
+ 'type' => 'users',
292
+ 'id' => '123'
293
+ }
294
+ }
295
+ assert_equal([{"type"=>"users", "id"=>"123"}], JsonPath.new("$.foo[?(@.id == '123')]").on(data))
296
+ end
297
+
288
298
  def example_object
289
299
  { 'store' => {
290
300
  '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: 0.8.6
4
+ version: 0.8.7
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-08-04 00:00:00.000000000 Z
12
+ date: 2017-08-11 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.4.8
146
+ rubygems_version: 2.6.12
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Ruby implementation of http://goessner.net/articles/JsonPath/