json 2.11.3-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: d4a089ae6adc030804bc9bc47c15fa8e622908a236f203b7d4db8800a16d72ee
4
- data.tar.gz: 3caa4d4a9c2ad0607200fada5e40b36426ca20850e8bd928d8e9f12a3bbf2064
3
+ metadata.gz: f4f59a45374afe4344b47aaae6a8181d9e6862aeef25d3690dc53e30b7da8a2f
4
+ data.tar.gz: b2e71b39dc952b7aabc327f8e67b0866774427e0f56864422cc06031e402b4b8
5
5
  SHA512:
6
- metadata.gz: d5cc7fb516e9fb35b3b001893da1f820c8513e7612c942b30abc54746426b6f1d1bf81f826c17387e090a57c6b280384203202b66ddbc1be28e89e7f50b2ebbd
7
- data.tar.gz: 9b57eefdb2b944a4bc02b17d5ccc01fe01e454dca7be8f771aa40e3c767403dd354604ba170f9aafc56c9cd278b885ac9b8044f0346394749e86391adcebd640
6
+ metadata.gz: 6af239193009801095bac3d94d4d40e67c323150cca4707a296016721c9b48a12c8d179b248c1c258fcee3ff1f72be864a31362ec01561323f86b8da59b99945
7
+ data.tar.gz: 2625623e4a8d949302feef7d756280ec995c0409aef34413eca706bcf63b43d9dc98bf4498b8adca4807378a6c22ab51c763c35a25f291e2115d6970690138ba
data/CHANGES.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changes
2
2
 
3
+ ### Unreleased
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
+
10
+ ### 2025-05-12 (2.12.0)
11
+
12
+ * Improve floating point generation to not use scientific notation as much.
13
+ * Include line and column in parser errors. Both in the message and as exception attributes.
14
+ * Handle non-string hash keys with broken `to_s` implementations.
15
+ * `JSON.generate` now uses SSE2 (x86) or NEON (arm64) instructions when available to escape strings.
16
+
3
17
  ### 2025-04-25 (2.11.3)
4
18
 
5
19
  * Fix a regression in `JSON.pretty_generate` that could cause indentation to be off once some `#to_json` has been called.
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
@@ -230,7 +230,9 @@ module JSON
230
230
  class JSONError < StandardError; end
231
231
 
232
232
  # This exception is raised if a parser error occurs.
233
- class ParserError < JSONError; end
233
+ class ParserError < JSONError
234
+ attr_reader :line, :column
235
+ end
234
236
 
235
237
  # This exception is raised if the nesting of parsed data structures is too
236
238
  # deep.
@@ -488,7 +490,7 @@ module JSON
488
490
  # }
489
491
  #
490
492
  def pretty_generate(obj, opts = nil)
491
- return state.generate(obj) if State === opts
493
+ return opts.generate(obj) if State === opts
492
494
 
493
495
  options = PRETTY_GENERATE_OPTIONS
494
496
 
@@ -1070,7 +1072,7 @@ module ::Kernel
1070
1072
  end
1071
1073
 
1072
1074
  objs.each do |obj|
1073
- puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
1075
+ puts JSON.generate(obj, :allow_nan => true, :max_nesting => false)
1074
1076
  end
1075
1077
  nil
1076
1078
  end
@@ -1085,7 +1087,7 @@ module ::Kernel
1085
1087
  end
1086
1088
 
1087
1089
  objs.each do |obj|
1088
- puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
1090
+ puts JSON.pretty_generate(obj, :allow_nan => true, :max_nesting => false)
1089
1091
  end
1090
1092
  nil
1091
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.11.3'
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.11.3
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-04-25 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