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 +4 -4
- data/CHANGES.md +14 -0
- data/README.md +13 -0
- data/lib/json/common.rb +7 -5
- data/lib/json/ext/generator.jar +0 -0
- data/lib/json/ext/parser.jar +0 -0
- data/lib/json/ext.rb +2 -2
- data/lib/json/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4f59a45374afe4344b47aaae6a8181d9e6862aeef25d3690dc53e30b7da8a2f
|
4
|
+
data.tar.gz: b2e71b39dc952b7aabc327f8e67b0866774427e0f56864422cc06031e402b4b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
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
|
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
|
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
|
1090
|
+
puts JSON.pretty_generate(obj, :allow_nan => true, :max_nesting => false)
|
1089
1091
|
end
|
1090
1092
|
nil
|
1091
1093
|
end
|
data/lib/json/ext/generator.jar
CHANGED
Binary file
|
data/lib/json/ext/parser.jar
CHANGED
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 =
|
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?(
|
44
|
+
JSON_LOADED = true unless defined?(JSON::JSON_LOADED)
|
45
45
|
end
|
data/lib/json/version.rb
CHANGED
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.
|
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-
|
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
|