json 2.11.3 → 2.12.2
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 +18 -0
- data/README.md +13 -0
- data/ext/json/ext/fbuffer/fbuffer.h +38 -4
- data/ext/json/ext/generator/extconf.rb +30 -0
- data/ext/json/ext/generator/generator.c +359 -12
- data/ext/json/ext/generator/simd.h +112 -0
- data/ext/json/ext/parser/parser.c +151 -100
- data/ext/json/ext/vendor/fpconv.c +10 -10
- data/lib/json/common.rb +7 -5
- data/lib/json/ext.rb +2 -2
- data/lib/json/version.rb +1 -1
- metadata +3 -2
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.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,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-23 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: This is a JSON implementation as a Ruby extension in C.
|
13
13
|
email: flori@ping.de
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- ext/json/ext/fbuffer/fbuffer.h
|
27
27
|
- ext/json/ext/generator/extconf.rb
|
28
28
|
- ext/json/ext/generator/generator.c
|
29
|
+
- ext/json/ext/generator/simd.h
|
29
30
|
- ext/json/ext/parser/extconf.rb
|
30
31
|
- ext/json/ext/parser/parser.c
|
31
32
|
- ext/json/ext/vendor/fpconv.c
|