jmespath 1.3.0 → 1.3.1

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: 9294e09435c687e359584f73e0ee3426c12996f2
4
- data.tar.gz: c7baca0f257df2ba6fbf0b4fe08f3bc653836e26
3
+ metadata.gz: da04f3f7da9e5cac47a01704bbbea262f42e573a
4
+ data.tar.gz: 81a60303e553bd70b307fdc87b652f8b2f9bc3ab
5
5
  SHA512:
6
- metadata.gz: d4a4eb1b6d4caea187a719a21ba0a2377ae4ad60e48553d51a41df20be244a3c526418b5bc533158cd86ecafa82bacce2cf69ce1015b3e015b63e5dfa0190b84
7
- data.tar.gz: aa4c37e16951b1463821cfbda071b5362fb9abd0241a9eacdfa6d9dc511d1e07d687a9ae040f29f752ddff61cd33cf4b4567fe59ef29df89a0f158b82dcc93c6
6
+ metadata.gz: 74bb5e454b3918e2df4f8007be7e2c2433d85b386f9a31a1476570e3f52b58840162dd4c4b33c52743315f640fbc9caf32985036193dd3127f0b9146e6bb616b
7
+ data.tar.gz: 8d0c2d681686cae78b443480c6dbe12905d28289b4e032f5e572cc1a2c0b55c4d4abc2bb07da7466a8a737fe7300defc805c1298820e59c8aca19464de011b1d
@@ -295,7 +295,40 @@ module JMESPath
295
295
  Token.new(type, buffer.join, position)
296
296
  end
297
297
 
298
- if RUBY_VERSION.match(Regexp.escape('1.9.3'))
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
@@ -1,3 +1,3 @@
1
1
  module JMESPath
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
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.0
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-07 00:00:00.000000000 Z
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