json 2.11.1 → 2.11.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 +5 -0
- data/lib/json/common.rb +18 -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: 747a457b1988cb2f8b166b6e0c228a3dca50b90a120a9128f815c4c18fb9f450
|
4
|
+
data.tar.gz: cc3c446db01177c9f7fbc6409d19e69bebce3845c77a7e8a3542c783a728d8b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea235083ce6d28a891ca4b583a7cb36641e736bc776a7039ff59c919e21e5d3eae4b2baf254dc190de003cccc62a1e7a03ada668c97f3226c154d1e76a35b307
|
7
|
+
data.tar.gz: 4818eaff0e54ef1402253bdca221c1262257314131733ac678338c8d8c8d447052dcf11205e309573b32ea9354717d3c485011739c8a7ab4c12af3391d7e2500
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
### 2025-04-24 (2.11.2)
|
4
|
+
|
5
|
+
* Add back `JSON::PRETTY_STATE_PROTOTYPE`. This constant was private API but is used by popular gems like `multi_json`.
|
6
|
+
It now emits a deprecation warning.
|
7
|
+
|
3
8
|
### 2025-04-24 (2.11.1)
|
4
9
|
|
5
10
|
* Add back `JSON.restore`, `JSON.unparse`, `JSON.fast_unparse` and `JSON.pretty_unparse`.
|
data/lib/json/common.rb
CHANGED
@@ -961,6 +961,24 @@ module JSON
|
|
961
961
|
load(...)
|
962
962
|
end
|
963
963
|
module_function :restore
|
964
|
+
|
965
|
+
class << self
|
966
|
+
private
|
967
|
+
|
968
|
+
def const_missing(const_name)
|
969
|
+
case const_name
|
970
|
+
when :PRETTY_STATE_PROTOTYPE
|
971
|
+
if RUBY_VERSION >= "3.0"
|
972
|
+
warn "JSON::PRETTY_STATE_PROTOTYPE is deprecated and will be removed in json 3.0.0, just use JSON.pretty_generate", uplevel: 1, category: :deprecated
|
973
|
+
else
|
974
|
+
warn "JSON::PRETTY_STATE_PROTOTYPE is deprecated and will be removed in json 3.0.0, just use JSON.pretty_generate", uplevel: 1
|
975
|
+
end
|
976
|
+
state.new(PRETTY_GENERATE_OPTIONS)
|
977
|
+
else
|
978
|
+
super
|
979
|
+
end
|
980
|
+
end
|
981
|
+
end
|
964
982
|
# :startdoc:
|
965
983
|
|
966
984
|
# JSON::Coder holds a parser and generator configuration.
|
data/lib/json/version.rb
CHANGED