File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 8
8
* Deprecate ` JSON.load_default_options ` .
9
9
* Deprecate ` JSON.unsafe_load_default_options ` .
10
10
* Deprecate ` JSON.dump_default_options ` .
11
+ * Deprecate ` Kernel#j `
12
+ * Deprecate ` Kernel#jj `
11
13
* Remove outdated ` JSON.iconv ` .
12
14
* Remove ` Class#json_creatable? ` monkey patch.
13
15
* Remove deprecated ` JSON.restore ` method.
Original file line number Diff line number Diff line change @@ -1005,6 +1005,12 @@ module ::Kernel
1005
1005
# Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
1006
1006
# one line.
1007
1007
def j ( *objs )
1008
+ if RUBY_VERSION >= "3.0"
1009
+ warn "Kernel#j is deprecated and will be removed in json 3.0.0" , uplevel : 1 , category : :deprecated
1010
+ else
1011
+ warn "Kernel#j is deprecated and will be removed in json 3.0.0" , uplevel : 1
1012
+ end
1013
+
1008
1014
objs . each do |obj |
1009
1015
puts JSON ::generate ( obj , :allow_nan => true , :max_nesting => false )
1010
1016
end
@@ -1014,6 +1020,12 @@ def j(*objs)
1014
1020
# Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
1015
1021
# indentation and over many lines.
1016
1022
def jj ( *objs )
1023
+ if RUBY_VERSION >= "3.0"
1024
+ warn "Kernel#jj is deprecated and will be removed in json 3.0.0" , uplevel : 1 , category : :deprecated
1025
+ else
1026
+ warn "Kernel#jj is deprecated and will be removed in json 3.0.0" , uplevel : 1
1027
+ end
1028
+
1017
1029
objs . each do |obj |
1018
1030
puts JSON ::pretty_generate ( obj , :allow_nan => true , :max_nesting => false )
1019
1031
end
You can’t perform that action at this time.
0 commit comments