jmespath 1.6.0 → 1.6.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
  SHA256:
3
- metadata.gz: '09a128a1330ef64e0a59ae48084fa404aa705184bdf2cf2a74d477dda596aa25'
4
- data.tar.gz: 50ecb149f81b2a468a24de16ce5b91b0ec5300e1d1b3a16022138b0fb4a50374
3
+ metadata.gz: e9276a9f614d19179d10e5e166950070fdbce091b7154ea2c15e700ca155ab4e
4
+ data.tar.gz: e3a122d91c10056382b50876583f550be0bf07a015c68ffaaff8cb2c3e4fcacf
5
5
  SHA512:
6
- metadata.gz: a66052e2a8b1cb4d9bbbb5b8e7e40b5f6cf8df91cf260e27d7ed4d32e129003c4a20bd92cd39afa168d4959400b450bb36876f6e23c4b0a440cb8e8a99d9e0d6
7
- data.tar.gz: 25fc0eec3d98c4722e1792771cab62b59b5ebe1e740c6556e5d76ad23d6f248b636816eaa2c3613e523b15e5cd95917e8dad1627dfcb3abd61c4e25b716b068e
6
+ metadata.gz: 46128b4ab5e58de1f2cdcb80a2b2e8e69690cce7455da154da4b4c18406e80a83de24c07339eca4cddef142afea29b74f131b48fe7292ce36131b8e2cd1cb80c
7
+ data.tar.gz: 0f44933d7fc3736bf71273736089b7c6787ce4127f96742b263822a7eb7123e9326f7a9512b408d9128bdd0fb6dcf8839ddceaf773c75f031c1c65436929ee42
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.0
1
+ 1.6.1
@@ -298,12 +298,12 @@ module JMESPath
298
298
  # Certain versions of Ruby and of the pure_json gem not support loading
299
299
  # scalar JSON values, such a numbers, booleans, strings, etc. These
300
300
  # simple values must be first wrapped inside a JSON object before calling
301
- # `JSON.load`.
301
+ # `JSON.parse`.
302
302
  #
303
303
  # # works in most JSON versions, raises in some versions
304
- # JSON.load("true")
305
- # JSON.load("123")
306
- # JSON.load("\"abc\"")
304
+ # JSON.parse("true")
305
+ # JSON.parse("123")
306
+ # JSON.parse("\"abc\"")
307
307
  #
308
308
  # This is an known issue for:
309
309
  #
@@ -317,12 +317,12 @@ module JMESPath
317
317
  # causes issues in environments that cannot compile the gem. We previously
318
318
  # had a direct dependency on `json_pure`, but this broke with the v2 update.
319
319
  #
320
- # This method allows us to detect how the `JSON.load` behaves so we know
320
+ # This method allows us to detect how the `JSON.parse` behaves so we know
321
321
  # if we have to wrap scalar JSON values to parse them or not.
322
322
  # @api private
323
323
  def self.requires_wrapping?
324
324
  begin
325
- JSON.load('false')
325
+ JSON.parse('false')
326
326
  rescue JSON::ParserError
327
327
  true
328
328
  end
@@ -332,12 +332,12 @@ module JMESPath
332
332
  def parse_json(token, quoted = false)
333
333
  begin
334
334
  if quoted
335
- token.value = JSON.load("{\"value\":#{token.value}}")['value']
335
+ token.value = JSON.parse("{\"value\":#{token.value}}")['value']
336
336
  else
337
337
  begin
338
- token.value = JSON.load("{\"value\":#{token.value}}")['value']
338
+ token.value = JSON.parse("{\"value\":#{token.value}}")['value']
339
339
  rescue
340
- token.value = JSON.load(sprintf('{"value":"%s"}', token.value.lstrip))['value']
340
+ token.value = JSON.parse(sprintf('{"value":"%s"}', token.value.lstrip))['value']
341
341
  end
342
342
  end
343
343
  rescue JSON::ParserError
@@ -349,9 +349,9 @@ module JMESPath
349
349
  def parse_json(token, quoted = false)
350
350
  begin
351
351
  if quoted
352
- token.value = JSON.load(token.value)
352
+ token.value = JSON.parse(token.value)
353
353
  else
354
- token.value = JSON.load(token.value) rescue JSON.load(sprintf('"%s"', token.value.lstrip))
354
+ token.value = JSON.parse(token.value) rescue JSON.parse(sprintf('"%s"', token.value.lstrip))
355
355
  end
356
356
  rescue JSON::ParserError
357
357
  token.type = T_UNKNOWN
data/lib/jmespath.rb CHANGED
@@ -26,7 +26,7 @@ module JMESPath
26
26
  data = case data
27
27
  when Hash, Struct then data # check for most common case first
28
28
  when Pathname then load_json(data)
29
- when IO, StringIO then JSON.load(data.read)
29
+ when IO, StringIO then JSON.parse(data.read)
30
30
  else data
31
31
  end
32
32
  Runtime.new(runtime_options).search(expression, data)
@@ -34,7 +34,7 @@ module JMESPath
34
34
 
35
35
  # @api private
36
36
  def load_json(path)
37
- JSON.load(File.open(path, 'r', encoding: 'UTF-8') { |f| f.read })
37
+ JSON.parse(File.open(path, 'r', encoding: 'UTF-8') { |f| f.read })
38
38
  end
39
39
 
40
40
  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.6.0
4
+ version: 1.6.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: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Implements JMESPath for Ruby
14
14
  email: trevorrowe@gmail.com