smarter_json 0.9.2 → 1.0.0
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/.gitignore +2 -0
- data/CHANGELOG.md +89 -55
- data/README.md +216 -73
- data/docs/_introduction.md +6 -12
- data/docs/basic_read_api.md +29 -19
- data/docs/basic_write_api.md +3 -3
- data/docs/examples.md +32 -23
- data/docs/options.md +20 -19
- data/ext/smarter_json/smarter_json.c +246 -92
- data/ext/smarter_json/vendor/LICENSE-fast_float-MIT +27 -0
- data/ext/smarter_json/vendor/eisel_lemire.h +117 -0
- data/ext/smarter_json/vendor/eisel_lemire.md +29 -0
- data/ext/smarter_json/vendor/eisel_lemire_powers.h +663 -0
- data/lib/smarter_json/backports.rb +28 -0
- data/lib/smarter_json/generator.rb +100 -65
- data/lib/smarter_json/options.rb +65 -0
- data/lib/smarter_json/parser.rb +441 -141
- data/lib/smarter_json/version.rb +1 -1
- data/lib/smarter_json.rb +3 -1
- metadata +21 -11
- data/ext/smarter_json/vendor/ryu.h +0 -819
- data/ext/smarter_json/vendor/ryu.md +0 -22
data/lib/smarter_json/version.rb
CHANGED
data/lib/smarter_json.rb
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "bigdecimal" # for
|
|
3
|
+
require "bigdecimal" # for decimal_precision: :auto / :bigdecimal (Oj-compatible)
|
|
4
4
|
|
|
5
|
+
require_relative "smarter_json/backports" # Enumerable#filter_map backport for Ruby < 2.7 (no-op on 2.7+)
|
|
5
6
|
require_relative "smarter_json/version"
|
|
6
7
|
require_relative "smarter_json/errors" # base Error + subclasses — must load before parser/generator
|
|
7
8
|
require_relative "smarter_json/warning" # SmarterJSON::Warning value object (the warnings: option)
|
|
9
|
+
require_relative "smarter_json/options" # central DEFAULT_OPTIONS + validation — must load before parser
|
|
8
10
|
require_relative "smarter_json/parser"
|
|
9
11
|
require_relative "smarter_json/generator"
|
|
10
12
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smarter_json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tilo Sloboda
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-06-
|
|
10
|
+
date: 2026-06-09 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bigdecimal
|
|
@@ -23,10 +23,16 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0'
|
|
26
|
-
description: '
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
description: 'A lenient, fast JSON processor for Ruby. It extracts strict JSON, NDJSON,
|
|
27
|
+
JSON5, HJSON-style config, and the messy JSON-ish input humans and LLMs actually
|
|
28
|
+
write — comments, trailing commas, single / unquoted / smart quotes, Python and
|
|
29
|
+
JS keywords, a UTF-8 BOM, and more all parse to the same Ruby objects, with no modes
|
|
30
|
+
or flags to set. Where a traditional parser stops at the first deviation and throws
|
|
31
|
+
away the whole document, SmarterJSON keeps going — it optimizes for getting your
|
|
32
|
+
data out, not for policing the JSON spec. It reads multi-document NDJSON / JSONL
|
|
33
|
+
in one call (and streams it with a block), and in benchmarks its C extension matches
|
|
34
|
+
or beats Oj on nearly every file. SmarterJSON is opinionated: we want your JSON
|
|
35
|
+
processing to be successful.
|
|
30
36
|
|
|
31
37
|
'
|
|
32
38
|
email:
|
|
@@ -49,11 +55,15 @@ files:
|
|
|
49
55
|
- ext/smarter_json/extconf.rb
|
|
50
56
|
- ext/smarter_json/smarter_json.c
|
|
51
57
|
- ext/smarter_json/smarter_json.h
|
|
52
|
-
- ext/smarter_json/vendor/
|
|
53
|
-
- ext/smarter_json/vendor/
|
|
58
|
+
- ext/smarter_json/vendor/LICENSE-fast_float-MIT
|
|
59
|
+
- ext/smarter_json/vendor/eisel_lemire.h
|
|
60
|
+
- ext/smarter_json/vendor/eisel_lemire.md
|
|
61
|
+
- ext/smarter_json/vendor/eisel_lemire_powers.h
|
|
54
62
|
- lib/smarter_json.rb
|
|
63
|
+
- lib/smarter_json/backports.rb
|
|
55
64
|
- lib/smarter_json/errors.rb
|
|
56
65
|
- lib/smarter_json/generator.rb
|
|
66
|
+
- lib/smarter_json/options.rb
|
|
57
67
|
- lib/smarter_json/parser.rb
|
|
58
68
|
- lib/smarter_json/version.rb
|
|
59
69
|
- lib/smarter_json/warning.rb
|
|
@@ -80,8 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
90
|
- !ruby/object:Gem::Version
|
|
81
91
|
version: '0'
|
|
82
92
|
requirements: []
|
|
83
|
-
rubygems_version:
|
|
93
|
+
rubygems_version: 3.6.9
|
|
84
94
|
specification_version: 4
|
|
85
|
-
summary:
|
|
86
|
-
|
|
95
|
+
summary: A lenient, fast JSON processor for Ruby — reads strict JSON, NDJSON, JSON5,
|
|
96
|
+
HJSON, and the messy JSON humans and LLMs actually write.
|
|
87
97
|
test_files: []
|