json 2.7.4-java → 2.7.5-java

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: f61f1f7cf84e855d4f7a7b56d7a1ec807bf1f6f0ba418984b94191bbd15a8db1
4
- data.tar.gz: b81dba38d7eb8dc893cb8107dcc42e829b9b21d0595bdd660f3203db607522cd
3
+ metadata.gz: 1d3fdaebab78d84d87a9879ef6ec0a84d4b7aee6ee05c89e38901af049c889c4
4
+ data.tar.gz: 104fe018bcff2685bd814e3c2b4c950ea3754c6c0de6bccb51619856f715a030
5
5
  SHA512:
6
- metadata.gz: 97ef406dd7d1506134ee9d87d7eec34cbf5377d2485ffb975d3262731bb65ea3370098cd395df07bd1ce96a0adad7b79f312666142f9216b5c31899df640768c
7
- data.tar.gz: aa59a3978e28cda2f8a62b7b51dc3a8dbb39b4dc68a32789f457824e3fb749326635536ff2dcb30b8a70b6591d08bfb041d2ca4e93446e3e4e77a2a441ee0783
6
+ metadata.gz: 58818379e7b2d8e01d18ce12ffbb2c4c90a4c50e6e0128b1470e4dfb01247b210d2e4ca141dbcdbbc2209253229648bed23cab5b86db902ff6a1c00544ba6982
7
+ data.tar.gz: 82d6865515b4c730a12961884d59feaed0d322da9a41e611f4efbcf053d1bb6d7bc35a5184d1c731bb470d960c982f798aaf7c7bef64de882c29c6f9e6cc867b
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
 
@@ -46,15 +46,15 @@ module JSON
46
46
  opts.each do |key, value|
47
47
  case key
48
48
  when :indent
49
- self.indent = value
49
+ self.indent = value || ''
50
50
  when :space
51
- self.space = value
51
+ self.space = value || ''
52
52
  when :space_before
53
- self.space_before = value
53
+ self.space_before = value || ''
54
54
  when :array_nl
55
- self.array_nl = value
55
+ self.array_nl = value || ''
56
56
  when :object_nl
57
- self.object_nl = value
57
+ self.object_nl = value || ''
58
58
  when :max_nesting
59
59
  self.max_nesting = value || 0
60
60
  when :depth
@@ -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
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.4
4
+ version: 2.7.5
5
5
  platform: java
6
6
  authors:
7
7
  - Daniel Luz
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: A JSON implementation as a JRuby extension.
14
14
  email: dev+ruby@mernen.com