json 2.12.0-java → 2.12.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 710fe2ed511aaeda412a41f8c24c62bd4a7295b4bceec674877ceda8da011e2a
4
- data.tar.gz: 07ed3030d8a68f7f7bb1860dc23a85ed15dc28f25ebd4b2cae7b374d72728696
3
+ metadata.gz: f4f59a45374afe4344b47aaae6a8181d9e6862aeef25d3690dc53e30b7da8a2f
4
+ data.tar.gz: b2e71b39dc952b7aabc327f8e67b0866774427e0f56864422cc06031e402b4b8
5
5
  SHA512:
6
- metadata.gz: 467cc0c119d803fbca47c96ca773431c02e32abc891f098e3f548c0857429a608721702257d8c4e0398976c312448ae42f4e9f2060893b9cefe7bdd8edd456eb
7
- data.tar.gz: 1565f080c1cd5602f31923b7fd7d421fb804dcb4a078933f46b3c7f7471cffb1220360506d644ba042b5394a06f541cee0ca67e193ef061dbb9e2af9373ff6ff
6
+ metadata.gz: 6af239193009801095bac3d94d4d40e67c323150cca4707a296016721c9b48a12c8d179b248c1c258fcee3ff1f72be864a31362ec01561323f86b8da59b99945
7
+ data.tar.gz: 2625623e4a8d949302feef7d756280ec995c0409aef34413eca706bcf63b43d9dc98bf4498b8adca4807378a6c22ab51c763c35a25f291e2115d6970690138ba
data/CHANGES.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ### 2025-05-23 (2.12.1)
6
+
7
+ * Fix a potential crash in large negative floating point number generation.
8
+ * Fix for JSON.pretty_generate to use passed state object's generate instead of state class as the required parameters aren't available.
9
+
5
10
  ### 2025-05-12 (2.12.0)
6
11
 
7
12
  * Improve floating point generation to not use scientific notation as much.
data/README.md CHANGED
@@ -233,6 +233,19 @@ the `pp` library's `pp` methods.
233
233
 
234
234
  ## Development
235
235
 
236
+ ### Prerequisites
237
+
238
+ 1. Clone the repository
239
+ 2. Install dependencies with `bundle install`
240
+
241
+ ### Testing
242
+
243
+ The full test suite can be run with:
244
+
245
+ ```bash
246
+ bundle exec rake test
247
+ ```
248
+
236
249
  ### Release
237
250
 
238
251
  Update the `lib/json/version.rb` file.
data/lib/json/common.rb CHANGED
@@ -172,7 +172,7 @@ module JSON
172
172
  end
173
173
  end
174
174
  self.state = generator::State
175
- const_set :State, self.state
175
+ const_set :State, state
176
176
  ensure
177
177
  $VERBOSE = old
178
178
  end
@@ -490,7 +490,7 @@ module JSON
490
490
  # }
491
491
  #
492
492
  def pretty_generate(obj, opts = nil)
493
- return state.generate(obj) if State === opts
493
+ return opts.generate(obj) if State === opts
494
494
 
495
495
  options = PRETTY_GENERATE_OPTIONS
496
496
 
@@ -1072,7 +1072,7 @@ module ::Kernel
1072
1072
  end
1073
1073
 
1074
1074
  objs.each do |obj|
1075
- puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
1075
+ puts JSON.generate(obj, :allow_nan => true, :max_nesting => false)
1076
1076
  end
1077
1077
  nil
1078
1078
  end
@@ -1087,7 +1087,7 @@ module ::Kernel
1087
1087
  end
1088
1088
 
1089
1089
  objs.each do |obj|
1090
- puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
1090
+ puts JSON.pretty_generate(obj, :allow_nan => true, :max_nesting => false)
1091
1091
  end
1092
1092
  nil
1093
1093
  end
Binary file
Binary file
data/lib/json/ext.rb CHANGED
@@ -34,12 +34,12 @@ module JSON
34
34
 
35
35
  if RUBY_ENGINE == 'truffleruby'
36
36
  require 'json/truffle_ruby/generator'
37
- JSON.generator = ::JSON::TruffleRuby::Generator
37
+ JSON.generator = JSON::TruffleRuby::Generator
38
38
  else
39
39
  require 'json/ext/generator'
40
40
  JSON.generator = Generator
41
41
  end
42
42
  end
43
43
 
44
- JSON_LOADED = true unless defined?(::JSON::JSON_LOADED)
44
+ JSON_LOADED = true unless defined?(JSON::JSON_LOADED)
45
45
  end
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.12.0'
4
+ VERSION = '2.12.1'
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.12.0
4
+ version: 2.12.1
5
5
  platform: java
6
6
  authors:
7
7
  - Daniel Luz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-12 00:00:00.000000000 Z
11
+ date: 2025-05-23 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