json_pure 2.7.4 → 2.7.5

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: '088e992126b90dfedd6384a72ef625d2ba88fc512d53c456d6dace2e47113f74'
4
- data.tar.gz: 56f1c68c346faea122ebfd5883ee23231d773a395ffa12a73992fe7e848ae4f6
3
+ metadata.gz: 859e40f5bfa7da73a90576204b5c49d6f42b9f2ca903239ecea54ec7a781fdc4
4
+ data.tar.gz: e38d6c5db98da6416dbb75746621aa7b7d3bd7e8f8c62042eef6e15e9ecf5f65
5
5
  SHA512:
6
- metadata.gz: 0fd7d0ff4b86c5be76e3556b5568ec03eb4dd33f07349945b13ed91fd46766c24cb0251d9abc821519ae2a5e99659e90ce67cda3749564a09a53779acd2478c1
7
- data.tar.gz: 814eb2de2b847e014cac1115b8c41c40267d13f377afedcaa28443aa08c3dbf3f8b965167e53c360d8061743fb6a95999a3f8b2aea87b5b0d041055c8e23bc99
6
+ metadata.gz: 3569ecd696382dbf173955fcfa9f49f3452a2d8b45bf29dcad6cd22ee0ac67bc8a6359ca548ae5367ca93cd02af4515b7e35ac213b5989658ad3133815fbece3
7
+ data.tar.gz: 6a23ba9fba6317c04f58c0d03a81b9d85aa8c2f5f8ec585cdfe9b6e97dc5f7994cfb3ef52749b4575857057f1cf803fb29936571f0d20f7b99e17828fa7d954b
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes
2
2
 
3
+ ### 2024-10-25 (2.7.5)
4
+
5
+ * Fix a memory leak when `#to_json` methods raise an exception.
6
+ * Gracefully handle formatting configs being set to `nil` instead of `""`.
7
+ * Workaround another issue caused by conflicting versions of both `json_pure` and `json` being loaded.
8
+
3
9
  ### 2024-10-25 (2.7.4)
4
10
 
5
11
  * Workaround a bug in 3.4.8 and older https://github.com/rubygems/rubygems/pull/6490.
data/lib/json/common.rb CHANGED
@@ -219,7 +219,12 @@ module JSON
219
219
  if opts.nil?
220
220
  Parser.new(source).parse
221
221
  else
222
- Parser.new(source, opts).parse
222
+ # NB: The ** shouldn't be required, but we have to deal with
223
+ # different versions of the `json` and `json_pure` gems being
224
+ # loaded concurrently.
225
+ # Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs.
226
+ # Ref: https://github.com/ruby/json/issues/650
227
+ Parser.new(source, **opts).parse
223
228
  end
224
229
  end
225
230
 
@@ -239,13 +239,13 @@ module JSON
239
239
  end
240
240
 
241
241
  # NOTE: If adding new instance variables here, check whether #generate should check them for #generate_json
242
- @indent = opts[:indent] if opts.key?(:indent)
243
- @space = opts[:space] if opts.key?(:space)
244
- @space_before = opts[:space_before] if opts.key?(:space_before)
245
- @object_nl = opts[:object_nl] if opts.key?(:object_nl)
246
- @array_nl = opts[:array_nl] if opts.key?(:array_nl)
247
- @allow_nan = !!opts[:allow_nan] if opts.key?(:allow_nan)
248
- @ascii_only = opts[:ascii_only] if opts.key?(:ascii_only)
242
+ @indent = opts[:indent] || '' if opts.key?(:indent)
243
+ @space = opts[:space] || '' if opts.key?(:space)
244
+ @space_before = opts[:space_before] || '' if opts.key?(:space_before)
245
+ @object_nl = opts[:object_nl] || '' if opts.key?(:object_nl)
246
+ @array_nl = opts[:array_nl] || '' if opts.key?(:array_nl)
247
+ @allow_nan = !!opts[:allow_nan] if opts.key?(:allow_nan)
248
+ @ascii_only = opts[:ascii_only] if opts.key?(:ascii_only)
249
249
  @depth = opts[:depth] || 0
250
250
  @buffer_initial_length ||= opts[:buffer_initial_length]
251
251
 
data/lib/json/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSON
4
- VERSION = '2.7.4'
4
+ VERSION = '2.7.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_pure
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.4
4
+ version: 2.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-25 00:00:00.000000000 Z
11
+ date: 2024-10-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a JSON implementation in pure Ruby.
14
14
  email: flori@ping.de