json 2.11.0 → 2.11.1
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 +6 -0
- data/lib/json/common.rb +44 -0
- data/lib/json/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeae3369690d7e0350db826e6971ad2dec6c26d8cae85f48fa65eb951bbb07f2
|
4
|
+
data.tar.gz: e7656787a08dc35ebbf8cfc74293474845f66ddf78d97f9714a0621187c666a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91c481b04c5c1468e38cd5c58d8272375b4bb5963407979763ba56d1c252364a30823a2fef4dbfd41ba63e0c41403fd78fa1754d3daac068a548d5fc496fb410
|
7
|
+
data.tar.gz: 5f5ed1d4d106f85bc5dee473cd7017e237a3d53b53e85c0e436421cf138caff3280b4b20597317ebb163c33447eec5f0d37adaaf0f1666a1e86f3180924bcf06
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
### 2025-04-24 (2.11.1)
|
4
|
+
|
5
|
+
* Add back `JSON.restore`, `JSON.unparse`, `JSON.fast_unparse` and `JSON.pretty_unparse`.
|
6
|
+
These were deprecated 16 years ago, but never emited warnings, only undocumented, so are
|
7
|
+
still used by a few gems.
|
8
|
+
|
3
9
|
### 2025-04-24 (2.11.0)
|
4
10
|
|
5
11
|
* Optimize Integer generation to be ~1.8x faster.
|
data/lib/json/common.rb
CHANGED
@@ -919,6 +919,50 @@ module JSON
|
|
919
919
|
end
|
920
920
|
end
|
921
921
|
|
922
|
+
# :stopdoc:
|
923
|
+
# All these were meant to be deprecated circa 2009, but were just set as undocumented
|
924
|
+
# so usage still exist in the wild.
|
925
|
+
def unparse(...)
|
926
|
+
if RUBY_VERSION >= "3.0"
|
927
|
+
warn "JSON.unparse is deprecated and will be removed in json 3.0.0, just use JSON.generate", uplevel: 1, category: :deprecated
|
928
|
+
else
|
929
|
+
warn "JSON.unparse is deprecated and will be removed in json 3.0.0, just use JSON.generate", uplevel: 1
|
930
|
+
end
|
931
|
+
generate(...)
|
932
|
+
end
|
933
|
+
module_function :unparse
|
934
|
+
|
935
|
+
def fast_unparse(...)
|
936
|
+
if RUBY_VERSION >= "3.0"
|
937
|
+
warn "JSON.fast_unparse is deprecated and will be removed in json 3.0.0, just use JSON.generate", uplevel: 1, category: :deprecated
|
938
|
+
else
|
939
|
+
warn "JSON.fast_unparse is deprecated and will be removed in json 3.0.0, just use JSON.generate", uplevel: 1
|
940
|
+
end
|
941
|
+
generate(...)
|
942
|
+
end
|
943
|
+
module_function :fast_unparse
|
944
|
+
|
945
|
+
def pretty_unparse(...)
|
946
|
+
if RUBY_VERSION >= "3.0"
|
947
|
+
warn "JSON.pretty_unparse is deprecated and will be removed in json 3.0.0, just use JSON.pretty_generate", uplevel: 1, category: :deprecated
|
948
|
+
else
|
949
|
+
warn "JSON.pretty_unparse is deprecated and will be removed in json 3.0.0, just use JSON.pretty_generate", uplevel: 1
|
950
|
+
end
|
951
|
+
pretty_generate(...)
|
952
|
+
end
|
953
|
+
module_function :fast_unparse
|
954
|
+
|
955
|
+
def restore(...)
|
956
|
+
if RUBY_VERSION >= "3.0"
|
957
|
+
warn "JSON.restore is deprecated and will be removed in json 3.0.0, just use JSON.load", uplevel: 1, category: :deprecated
|
958
|
+
else
|
959
|
+
warn "JSON.restore is deprecated and will be removed in json 3.0.0, just use JSON.load", uplevel: 1
|
960
|
+
end
|
961
|
+
load(...)
|
962
|
+
end
|
963
|
+
module_function :restore
|
964
|
+
# :startdoc:
|
965
|
+
|
922
966
|
# JSON::Coder holds a parser and generator configuration.
|
923
967
|
#
|
924
968
|
# module MyApp
|
data/lib/json/version.rb
CHANGED