jmespath 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jmespath might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/jmespath/lexer.rb +34 -1
- data/lib/jmespath/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da04f3f7da9e5cac47a01704bbbea262f42e573a
|
4
|
+
data.tar.gz: 81a60303e553bd70b307fdc87b652f8b2f9bc3ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74bb5e454b3918e2df4f8007be7e2c2433d85b386f9a31a1476570e3f52b58840162dd4c4b33c52743315f640fbc9caf32985036193dd3127f0b9146e6bb616b
|
7
|
+
data.tar.gz: 8d0c2d681686cae78b443480c6dbe12905d28289b4e032f5e572cc1a2c0b55c4d4abc2bb07da7466a8a737fe7300defc805c1298820e59c8aca19464de011b1d
|
data/lib/jmespath/lexer.rb
CHANGED
@@ -295,7 +295,40 @@ module JMESPath
|
|
295
295
|
Token.new(type, buffer.join, position)
|
296
296
|
end
|
297
297
|
|
298
|
-
|
298
|
+
# Certain versions of Ruby and of the pure_json gem not support loading
|
299
|
+
# scalar JSON values, such a numbers, booleans, strings, etc. These
|
300
|
+
# simple values must be first wrapped inside a JSON object before calling
|
301
|
+
# `JSON.load`.
|
302
|
+
#
|
303
|
+
# # works in most JSON versions, raises in some versions
|
304
|
+
# JSON.load("true")
|
305
|
+
# JSON.load("123")
|
306
|
+
# JSON.load("\"abc\"")
|
307
|
+
#
|
308
|
+
# This is an known issue for:
|
309
|
+
#
|
310
|
+
# * Ruby 1.9.3 bundled v1.5.5 of json; Ruby 1.9.3 defaults to bundled
|
311
|
+
# version despite newer versions being available.
|
312
|
+
#
|
313
|
+
# * json_pure v2.0.0+
|
314
|
+
#
|
315
|
+
# It is not possible to change the version of JSON loaded in the
|
316
|
+
# user's application. Adding an explicit dependency on json gem
|
317
|
+
# causes issues in environments that cannot compile the gem. We previously
|
318
|
+
# had a direct dependency on `json_pure`, but this broke with the v2 update.
|
319
|
+
#
|
320
|
+
# This method allows us to detect how the `JSON.load` behaves so we know
|
321
|
+
# if we have to wrap scalar JSON values to parse them or not.
|
322
|
+
# @api private
|
323
|
+
def self.requires_wrapping?
|
324
|
+
begin
|
325
|
+
JSON.load('false')
|
326
|
+
rescue JSON::ParserError
|
327
|
+
true
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
if requires_wrapping?
|
299
332
|
def parse_json(token, quoted = false)
|
300
333
|
begin
|
301
334
|
if quoted
|
data/lib/jmespath/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jmespath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trevor Rowe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Implements JMESPath for Ruby
|
14
14
|
email: trevorrowe@gmail.com
|