rbs 3.9.5 → 3.10.0.pre.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/.clang-format +74 -0
- data/.clangd +2 -0
- data/.github/workflows/c-check.yml +54 -0
- data/.github/workflows/comments.yml +3 -3
- data/.github/workflows/ruby.yml +34 -19
- data/.github/workflows/typecheck.yml +1 -1
- data/.github/workflows/windows.yml +1 -1
- data/.gitignore +4 -0
- data/README.md +38 -1
- data/Rakefile +152 -23
- data/config.yml +190 -62
- data/core/array.rbs +44 -43
- data/core/dir.rbs +2 -2
- data/core/encoding.rbs +3 -2
- data/core/enumerable.rbs +89 -2
- data/core/errno.rbs +8 -0
- data/core/errors.rbs +28 -1
- data/core/exception.rbs +2 -2
- data/core/fiber.rbs +3 -3
- data/core/file.rbs +26 -11
- data/core/float.rbs +1 -1
- data/core/gc.rbs +422 -281
- data/core/hash.rbs +1024 -727
- data/core/io/wait.rbs +11 -33
- data/core/io.rbs +6 -4
- data/core/kernel.rbs +49 -43
- data/core/marshal.rbs +1 -1
- data/core/match_data.rbs +1 -1
- data/core/math.rbs +42 -3
- data/core/method.rbs +14 -6
- data/core/module.rbs +71 -11
- data/core/nil_class.rbs +3 -3
- data/core/numeric.rbs +8 -8
- data/core/object.rbs +3 -3
- data/core/object_space.rbs +13 -0
- data/{stdlib/pathname/0 → core}/pathname.rbs +253 -352
- data/core/proc.rbs +15 -8
- data/core/process.rbs +2 -2
- data/core/ractor.rbs +278 -437
- data/core/range.rbs +6 -7
- data/core/rbs/unnamed/argf.rbs +1 -1
- data/core/rbs/unnamed/env_class.rbs +1 -1
- data/core/rbs/unnamed/random.rbs +4 -2
- data/core/regexp.rbs +22 -17
- data/core/ruby_vm.rbs +6 -4
- data/core/rubygems/errors.rbs +3 -70
- data/core/rubygems/rubygems.rbs +11 -79
- data/core/set.rbs +439 -332
- data/core/string.rbs +2897 -1117
- data/core/struct.rbs +1 -1
- data/core/symbol.rbs +4 -4
- data/core/thread.rbs +83 -20
- data/core/time.rbs +35 -9
- data/core/unbound_method.rbs +14 -6
- data/docs/aliases.md +79 -0
- data/docs/collection.md +2 -2
- data/docs/gem.md +0 -1
- data/docs/sigs.md +3 -3
- data/ext/rbs_extension/ast_translation.c +1016 -0
- data/ext/rbs_extension/ast_translation.h +37 -0
- data/ext/rbs_extension/class_constants.c +157 -0
- data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +7 -1
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +25 -1
- data/ext/rbs_extension/legacy_location.c +317 -0
- data/ext/rbs_extension/legacy_location.h +45 -0
- data/ext/rbs_extension/main.c +365 -14
- data/ext/rbs_extension/rbs_extension.h +6 -21
- data/ext/rbs_extension/rbs_string_bridging.c +9 -0
- data/ext/rbs_extension/rbs_string_bridging.h +24 -0
- data/include/rbs/ast.h +687 -0
- data/include/rbs/defines.h +86 -0
- data/include/rbs/lexer.h +199 -0
- data/include/rbs/location.h +59 -0
- data/include/rbs/parser.h +135 -0
- data/include/rbs/string.h +49 -0
- data/include/rbs/util/rbs_allocator.h +59 -0
- data/include/rbs/util/rbs_assert.h +20 -0
- data/include/rbs/util/rbs_buffer.h +83 -0
- data/include/rbs/util/rbs_constant_pool.h +6 -67
- data/include/rbs/util/rbs_encoding.h +282 -0
- data/include/rbs/util/rbs_unescape.h +23 -0
- data/include/rbs.h +1 -2
- data/lib/rbs/annotate/formatter.rb +3 -13
- data/lib/rbs/annotate/rdoc_annotator.rb +3 -1
- data/lib/rbs/annotate/rdoc_source.rb +1 -1
- data/lib/rbs/cli/validate.rb +2 -2
- data/lib/rbs/cli.rb +1 -1
- data/lib/rbs/collection/config/lockfile_generator.rb +1 -0
- data/lib/rbs/definition_builder/ancestor_builder.rb +5 -5
- data/lib/rbs/environment.rb +64 -59
- data/lib/rbs/environment_loader.rb +1 -1
- data/lib/rbs/errors.rb +1 -1
- data/lib/rbs/parser_aux.rb +5 -0
- data/lib/rbs/resolver/constant_resolver.rb +2 -2
- data/lib/rbs/resolver/type_name_resolver.rb +124 -38
- data/lib/rbs/test/type_check.rb +13 -0
- data/lib/rbs/types.rb +3 -1
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +1 -1
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +3 -3
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +1 -1
- data/sig/environment.rbs +57 -6
- data/sig/manifest.yaml +0 -1
- data/sig/parser.rbs +20 -0
- data/sig/resolver/type_name_resolver.rbs +38 -7
- data/sig/types.rbs +4 -1
- data/src/ast.c +1256 -0
- data/src/lexer.c +2956 -0
- data/src/lexer.re +147 -0
- data/src/lexstate.c +205 -0
- data/src/location.c +71 -0
- data/src/parser.c +3495 -0
- data/src/string.c +90 -0
- data/src/util/rbs_allocator.c +152 -0
- data/src/util/rbs_assert.c +21 -0
- data/src/util/rbs_buffer.c +54 -0
- data/src/util/rbs_constant_pool.c +16 -86
- data/src/util/rbs_encoding.c +21308 -0
- data/src/util/rbs_unescape.c +131 -0
- data/stdlib/cgi/0/core.rbs +2 -396
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/cgi-escape/0/escape.rbs +153 -0
- data/stdlib/coverage/0/coverage.rbs +3 -1
- data/stdlib/delegate/0/delegator.rbs +10 -7
- data/stdlib/erb/0/erb.rbs +737 -347
- data/stdlib/fileutils/0/fileutils.rbs +18 -13
- data/stdlib/forwardable/0/forwardable.rbs +3 -0
- data/stdlib/json/0/json.rbs +67 -48
- data/stdlib/net-http/0/net-http.rbs +3 -0
- data/stdlib/objspace/0/objspace.rbs +8 -3
- data/stdlib/open-uri/0/open-uri.rbs +40 -0
- data/stdlib/openssl/0/openssl.rbs +182 -149
- data/stdlib/optparse/0/optparse.rbs +3 -3
- data/stdlib/rdoc/0/code_object.rbs +2 -2
- data/stdlib/rdoc/0/comment.rbs +2 -0
- data/stdlib/rdoc/0/options.rbs +76 -0
- data/stdlib/rdoc/0/rdoc.rbs +7 -5
- data/stdlib/rdoc/0/store.rbs +1 -1
- data/stdlib/resolv/0/resolv.rbs +25 -68
- data/stdlib/ripper/0/ripper.rbs +5 -2
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/socket/0/socket.rbs +13 -1
- data/stdlib/socket/0/tcp_socket.rbs +10 -2
- data/stdlib/stringio/0/stringio.rbs +412 -80
- data/stdlib/strscan/0/string_scanner.rbs +31 -31
- data/stdlib/tempfile/0/tempfile.rbs +1 -1
- data/stdlib/tsort/0/cyclic.rbs +3 -0
- data/stdlib/uri/0/common.rbs +11 -2
- data/stdlib/uri/0/file.rbs +1 -1
- data/stdlib/uri/0/generic.rbs +16 -15
- data/stdlib/uri/0/rfc2396_parser.rbs +6 -7
- data/stdlib/zlib/0/zstream.rbs +1 -0
- metadata +41 -18
- data/ext/rbs_extension/lexer.c +0 -2728
- data/ext/rbs_extension/lexer.h +0 -179
- data/ext/rbs_extension/lexer.re +0 -147
- data/ext/rbs_extension/lexstate.c +0 -175
- data/ext/rbs_extension/location.c +0 -325
- data/ext/rbs_extension/location.h +0 -85
- data/ext/rbs_extension/parser.c +0 -2982
- data/ext/rbs_extension/parser.h +0 -18
- data/ext/rbs_extension/parserstate.c +0 -411
- data/ext/rbs_extension/parserstate.h +0 -163
- data/ext/rbs_extension/unescape.c +0 -32
- data/include/rbs/ruby_objs.h +0 -72
- data/src/constants.c +0 -153
- data/src/ruby_objs.c +0 -799
|
@@ -522,11 +522,13 @@ module FileUtils
|
|
|
522
522
|
# symbolic links; other file types (FIFO streams, device files, etc.) are not
|
|
523
523
|
# supported.
|
|
524
524
|
#
|
|
525
|
-
#
|
|
525
|
+
# Optional arguments:
|
|
526
526
|
#
|
|
527
|
-
# * `dereference_root
|
|
528
|
-
#
|
|
529
|
-
# * `
|
|
527
|
+
# * `dereference_root` - if `src` is a symbolic link, follows the link
|
|
528
|
+
# (`false` by default).
|
|
529
|
+
# * `preserve` - preserves file times (`false` by default).
|
|
530
|
+
# * `remove_destination` - removes `dest` before copying files (`false` by
|
|
531
|
+
# default).
|
|
530
532
|
#
|
|
531
533
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
|
532
534
|
#
|
|
@@ -547,12 +549,13 @@ module FileUtils
|
|
|
547
549
|
# FileUtils.copy_file('src0.txt', 'dest0.txt')
|
|
548
550
|
# File.file?('dest0.txt') # => true
|
|
549
551
|
#
|
|
550
|
-
#
|
|
552
|
+
# Optional arguments:
|
|
551
553
|
#
|
|
552
|
-
# * `dereference
|
|
553
|
-
#
|
|
554
|
-
# * `preserve
|
|
555
|
-
# * `remove_destination
|
|
554
|
+
# * `dereference` - if `src` is a symbolic link, follows the link (`true` by
|
|
555
|
+
# default).
|
|
556
|
+
# * `preserve` - preserves file times (`false` by default).
|
|
557
|
+
# * `remove_destination` - removes `dest` before copying files (`false` by
|
|
558
|
+
# default).
|
|
556
559
|
#
|
|
557
560
|
# Related: [methods for copying](rdoc-ref:FileUtils@Copying).
|
|
558
561
|
#
|
|
@@ -963,13 +966,15 @@ module FileUtils
|
|
|
963
966
|
# File.file?('dest1/dir1/t2.txt') # => true
|
|
964
967
|
# File.file?('dest1/dir1/t3.txt') # => true
|
|
965
968
|
#
|
|
966
|
-
#
|
|
969
|
+
# Optional arguments:
|
|
967
970
|
#
|
|
968
|
-
# * `dereference_root
|
|
969
|
-
#
|
|
971
|
+
# * `dereference_root` - dereferences `src` if it is a symbolic link (`false`
|
|
972
|
+
# by default).
|
|
973
|
+
# * `remove_destination` - removes `dest` before creating links (`false` by
|
|
974
|
+
# default).
|
|
970
975
|
#
|
|
971
976
|
# Raises an exception if `dest` is the path to an existing file or directory and
|
|
972
|
-
#
|
|
977
|
+
# optional argument `remove_destination` is not given.
|
|
973
978
|
#
|
|
974
979
|
# Related: FileUtils.ln (has different options).
|
|
975
980
|
#
|
data/stdlib/json/0/json.rbs
CHANGED
|
@@ -14,9 +14,6 @@ end
|
|
|
14
14
|
class JSON::GeneratorError < JSON::JSONError
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
class JSON::UnparserError < JSON::GeneratorError
|
|
18
|
-
end
|
|
19
|
-
|
|
20
17
|
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
|
|
21
18
|
# This exception is raised if a parser error occurs.
|
|
22
19
|
#
|
|
@@ -202,6 +199,24 @@ end
|
|
|
202
199
|
#
|
|
203
200
|
# ---
|
|
204
201
|
#
|
|
202
|
+
# Option `allow_duplicate_key` specifies whether duplicate keys in objects
|
|
203
|
+
# should be ignored or cause an error to be raised:
|
|
204
|
+
#
|
|
205
|
+
# When not specified:
|
|
206
|
+
# # The last value is used and a deprecation warning emitted.
|
|
207
|
+
# JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
|
|
208
|
+
# # warning: detected duplicate keys in JSON object.
|
|
209
|
+
# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
|
|
210
|
+
#
|
|
211
|
+
# When set to ``true``
|
|
212
|
+
# # The last value is used.
|
|
213
|
+
# JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
|
|
214
|
+
#
|
|
215
|
+
# When set to ``false``, the future default:
|
|
216
|
+
# JSON.parse('{"a": 1, "a":2}') => duplicate key at line 1 column 1 (JSON::ParserError)
|
|
217
|
+
#
|
|
218
|
+
# ---
|
|
219
|
+
#
|
|
205
220
|
# Option `allow_nan` (boolean) specifies whether to allow NaN, Infinity, and
|
|
206
221
|
# MinusInfinity in `source`; defaults to `false`.
|
|
207
222
|
#
|
|
@@ -218,8 +233,22 @@ end
|
|
|
218
233
|
# ruby = JSON.parse(source, {allow_nan: true})
|
|
219
234
|
# ruby # => [NaN, Infinity, -Infinity]
|
|
220
235
|
#
|
|
236
|
+
# ---
|
|
237
|
+
#
|
|
238
|
+
# Option `allow_trailing_comma` (boolean) specifies whether to allow trailing
|
|
239
|
+
# commas in objects and arrays; defaults to `false`.
|
|
240
|
+
#
|
|
241
|
+
# With the default, `false`:
|
|
242
|
+
# JSON.parse('[1,]') # unexpected character: ']' at line 1 column 4 (JSON::ParserError)
|
|
243
|
+
#
|
|
244
|
+
# When enabled:
|
|
245
|
+
# JSON.parse('[1,]', allow_trailing_comma: true) # => [1]
|
|
246
|
+
#
|
|
221
247
|
# ###### Output Options
|
|
222
248
|
#
|
|
249
|
+
# Option `freeze` (boolean) specifies whether the returned objects will be
|
|
250
|
+
# frozen; defaults to `false`.
|
|
251
|
+
#
|
|
223
252
|
# Option `symbolize_names` (boolean) specifies whether returned Hash keys should
|
|
224
253
|
# be Symbols; defaults to `false` (use Strings).
|
|
225
254
|
#
|
|
@@ -348,6 +377,25 @@ end
|
|
|
348
377
|
#
|
|
349
378
|
# ---
|
|
350
379
|
#
|
|
380
|
+
# Option `allow_duplicate_key` (boolean) specifies whether hashes with duplicate
|
|
381
|
+
# keys should be allowed or produce an error. defaults to emit a deprecation
|
|
382
|
+
# warning.
|
|
383
|
+
#
|
|
384
|
+
# With the default, (not set):
|
|
385
|
+
# Warning[:deprecated] = true
|
|
386
|
+
# JSON.generate({ foo: 1, "foo" => 2 })
|
|
387
|
+
# # warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}.
|
|
388
|
+
# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
|
|
389
|
+
# # => '{"foo":1,"foo":2}'
|
|
390
|
+
#
|
|
391
|
+
# With `false`
|
|
392
|
+
# JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false)
|
|
393
|
+
# # detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError)
|
|
394
|
+
#
|
|
395
|
+
# In version 3.0, `false` will become the default.
|
|
396
|
+
#
|
|
397
|
+
# ---
|
|
398
|
+
#
|
|
351
399
|
# Option `max_nesting` (Integer) specifies the maximum nesting depth in `obj`;
|
|
352
400
|
# defaults to `100`.
|
|
353
401
|
#
|
|
@@ -423,6 +471,9 @@ end
|
|
|
423
471
|
#
|
|
424
472
|
# ## JSON Additions
|
|
425
473
|
#
|
|
474
|
+
# Note that JSON Additions must only be used with trusted data, and is
|
|
475
|
+
# deprecated.
|
|
476
|
+
#
|
|
426
477
|
# When you "round trip" a non-String object from Ruby to JSON and back, you have
|
|
427
478
|
# a new String, instead of the object you began with:
|
|
428
479
|
# ruby0 = Range.new(0, 2)
|
|
@@ -711,8 +762,6 @@ module JSON
|
|
|
711
762
|
#
|
|
712
763
|
def self.create_id=: (_ToS create_id) -> _ToS
|
|
713
764
|
|
|
714
|
-
def self.deep_const_get: (interned path) -> untyped
|
|
715
|
-
|
|
716
765
|
# <!--
|
|
717
766
|
# rdoc-file=ext/json/lib/json/common.rb
|
|
718
767
|
# - JSON.dump(obj, io = nil, limit = nil)
|
|
@@ -754,6 +803,7 @@ module JSON
|
|
|
754
803
|
# opts = JSON.dump_default_options
|
|
755
804
|
# opts # => {:max_nesting=>false, :allow_nan=>true}
|
|
756
805
|
#
|
|
806
|
+
%a{deprecated}
|
|
757
807
|
def self.dump_default_options: () -> options
|
|
758
808
|
|
|
759
809
|
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
|
|
@@ -761,6 +811,7 @@ module JSON
|
|
|
761
811
|
# opts = JSON.dump_default_options
|
|
762
812
|
# opts # => {:max_nesting=>false, :allow_nan=>true}
|
|
763
813
|
#
|
|
814
|
+
%a{deprecated}
|
|
764
815
|
def self.dump_default_options=: (options) -> options
|
|
765
816
|
|
|
766
817
|
# <!--
|
|
@@ -778,19 +829,16 @@ module JSON
|
|
|
778
829
|
# # Raises SystemStackError (stack level too deep):
|
|
779
830
|
# JSON.fast_generate(a)
|
|
780
831
|
#
|
|
832
|
+
%a{deprecated}
|
|
781
833
|
def self?.fast_generate: (_ToJson obj, ?options opts) -> String
|
|
782
834
|
|
|
783
|
-
alias self.fast_unparse self.fast_generate
|
|
784
|
-
|
|
785
|
-
alias fast_unparse fast_generate
|
|
786
|
-
|
|
787
835
|
# <!--
|
|
788
836
|
# rdoc-file=ext/json/lib/json/common.rb
|
|
789
837
|
# - JSON.generate(obj, opts = nil) -> new_string
|
|
790
838
|
# -->
|
|
791
839
|
# Returns a String containing the generated JSON data.
|
|
792
840
|
#
|
|
793
|
-
# See also JSON.
|
|
841
|
+
# See also JSON.pretty_generate.
|
|
794
842
|
#
|
|
795
843
|
# Argument `obj` is the Ruby object to be converted to JSON.
|
|
796
844
|
#
|
|
@@ -830,14 +878,6 @@ module JSON
|
|
|
830
878
|
|
|
831
879
|
def self.generator=: (generator generator) -> void
|
|
832
880
|
|
|
833
|
-
# <!--
|
|
834
|
-
# rdoc-file=ext/json/lib/json/common.rb
|
|
835
|
-
# - iconv(to, from, string)
|
|
836
|
-
# -->
|
|
837
|
-
# Encodes string using String.encode.
|
|
838
|
-
#
|
|
839
|
-
def self.iconv: (encoding to, encoding from, String string) -> String
|
|
840
|
-
|
|
841
881
|
# <!--
|
|
842
882
|
# rdoc-file=ext/json/lib/json/common.rb
|
|
843
883
|
# - JSON.load(source, proc = nil, options = {}) -> object
|
|
@@ -952,6 +992,7 @@ module JSON
|
|
|
952
992
|
# when Array
|
|
953
993
|
# obj.map! {|v| deserialize_obj v }
|
|
954
994
|
# end
|
|
995
|
+
# obj
|
|
955
996
|
# })
|
|
956
997
|
# pp ruby
|
|
957
998
|
#
|
|
@@ -974,7 +1015,8 @@ module JSON
|
|
|
974
1015
|
# #<Admin:0x00000000064c41f8
|
|
975
1016
|
# @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
|
|
976
1017
|
#
|
|
977
|
-
def self?.load: (string | _ReadableIO | _Read source, ?
|
|
1018
|
+
def self?.load: (string | _ReadableIO | _Read source, ?options options) -> untyped
|
|
1019
|
+
| [T] (string | _ReadableIO | _Read source, ^(?) -> T, ?options options) -> T
|
|
978
1020
|
|
|
979
1021
|
# <!--
|
|
980
1022
|
# rdoc-file=ext/json/lib/json/common.rb
|
|
@@ -1003,6 +1045,7 @@ module JSON
|
|
|
1003
1045
|
# opts = JSON.load_default_options
|
|
1004
1046
|
# opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
|
|
1005
1047
|
#
|
|
1048
|
+
%a{deprecated}
|
|
1006
1049
|
def self.load_default_options: () -> options
|
|
1007
1050
|
|
|
1008
1051
|
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
|
|
@@ -1010,6 +1053,7 @@ module JSON
|
|
|
1010
1053
|
# opts = JSON.load_default_options
|
|
1011
1054
|
# opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
|
|
1012
1055
|
#
|
|
1056
|
+
%a{deprecated}
|
|
1013
1057
|
def self.load_default_options=: (options) -> options
|
|
1014
1058
|
|
|
1015
1059
|
# <!--
|
|
@@ -1120,29 +1164,6 @@ module JSON
|
|
|
1120
1164
|
#
|
|
1121
1165
|
def self?.pretty_generate: (_ToJson obj, ?options opts) -> untyped
|
|
1122
1166
|
|
|
1123
|
-
alias self.pretty_unparse self.pretty_generate
|
|
1124
|
-
|
|
1125
|
-
alias pretty_unparse pretty_generate
|
|
1126
|
-
|
|
1127
|
-
# Recursively calls passed *Proc* if the parsed data structure is an *Array* or
|
|
1128
|
-
# *Hash*
|
|
1129
|
-
#
|
|
1130
|
-
def self?.recurse_proc: (untyped result) { (*untyped) -> void } -> void
|
|
1131
|
-
|
|
1132
|
-
# <!--
|
|
1133
|
-
# rdoc-file=ext/json/lib/json/common.rb
|
|
1134
|
-
# - restore(source, proc = nil, options = nil)
|
|
1135
|
-
# -->
|
|
1136
|
-
#
|
|
1137
|
-
alias self.restore self.load
|
|
1138
|
-
|
|
1139
|
-
# <!--
|
|
1140
|
-
# rdoc-file=ext/json/lib/json/common.rb
|
|
1141
|
-
# - restore(source, proc = nil, options = nil)
|
|
1142
|
-
# -->
|
|
1143
|
-
#
|
|
1144
|
-
alias restore load
|
|
1145
|
-
|
|
1146
1167
|
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
|
|
1147
1168
|
# Sets or Returns the JSON generator state class that is used by JSON.
|
|
1148
1169
|
#
|
|
@@ -1152,10 +1173,6 @@ module JSON
|
|
|
1152
1173
|
# Sets or Returns the JSON generator state class that is used by JSON.
|
|
1153
1174
|
#
|
|
1154
1175
|
def self.state=: (state) -> state
|
|
1155
|
-
|
|
1156
|
-
alias self.unparse self.generate
|
|
1157
|
-
|
|
1158
|
-
alias unparse generate
|
|
1159
1176
|
end
|
|
1160
1177
|
|
|
1161
1178
|
JSON::FAST_STATE_PROTOTYPE: JSON::state
|
|
@@ -1193,6 +1210,7 @@ module Kernel
|
|
|
1193
1210
|
# Outputs *objs* to STDOUT as JSON strings in the shortest form, that is in one
|
|
1194
1211
|
# line.
|
|
1195
1212
|
#
|
|
1213
|
+
%a{deprecated}
|
|
1196
1214
|
def j: (*_ToJson) -> nil
|
|
1197
1215
|
|
|
1198
1216
|
# <!--
|
|
@@ -1202,11 +1220,12 @@ module Kernel
|
|
|
1202
1220
|
# Outputs *objs* to STDOUT as JSON strings in a pretty format, with indentation
|
|
1203
1221
|
# and over many lines.
|
|
1204
1222
|
#
|
|
1223
|
+
%a{deprecated}
|
|
1205
1224
|
def jj: (*_ToJson) -> nil
|
|
1206
1225
|
|
|
1207
1226
|
# <!--
|
|
1208
1227
|
# rdoc-file=ext/json/lib/json/common.rb
|
|
1209
|
-
# - JSON(object,
|
|
1228
|
+
# - JSON(object, opts = nil)
|
|
1210
1229
|
# -->
|
|
1211
1230
|
# If *object* is string-like, parse the string and return the parsed result as a
|
|
1212
1231
|
# Ruby data structure. Otherwise, generate a JSON text from the Ruby data
|
|
@@ -1854,7 +1873,7 @@ class Symbol
|
|
|
1854
1873
|
|
|
1855
1874
|
# <!--
|
|
1856
1875
|
# rdoc-file=ext/json/lib/json/add/symbol.rb
|
|
1857
|
-
# - to_json(*a)
|
|
1876
|
+
# - to_json(state = nil, *a)
|
|
1858
1877
|
# -->
|
|
1859
1878
|
# Returns a JSON string representing `self`:
|
|
1860
1879
|
#
|
|
@@ -332,9 +332,11 @@ module ObjectSpace
|
|
|
332
332
|
# information as only a **HINT**. Especially, the size of `T_DATA` may not be
|
|
333
333
|
# correct.
|
|
334
334
|
#
|
|
335
|
-
# This method is only expected to work with
|
|
335
|
+
# This method is only expected to work with CRuby.
|
|
336
336
|
#
|
|
337
|
-
# From Ruby
|
|
337
|
+
# From Ruby 3.2 with Variable Width Allocation, it returns the actual slot size
|
|
338
|
+
# used plus any additional memory allocated outside the slot (such as external
|
|
339
|
+
# strings, arrays, or hash tables).
|
|
338
340
|
#
|
|
339
341
|
def self?.memsize_of: (untyped) -> Integer
|
|
340
342
|
|
|
@@ -461,8 +463,11 @@ module ObjectSpace
|
|
|
461
463
|
|
|
462
464
|
# <!--
|
|
463
465
|
# rdoc-file=ext/objspace/object_tracing.c
|
|
464
|
-
# - trace_object_allocations_debug_start
|
|
466
|
+
# - trace_object_allocations_debug_start
|
|
465
467
|
# -->
|
|
468
|
+
# Starts tracing object allocations for GC debugging. If you encounter the BUG
|
|
469
|
+
# "... is T_NONE" (and so on) on your application, please try this method at the
|
|
470
|
+
# beginning of your app.
|
|
466
471
|
#
|
|
467
472
|
def self?.trace_object_allocations_debug_start: () -> void
|
|
468
473
|
|
|
@@ -83,6 +83,46 @@ end
|
|
|
83
83
|
# : Tanaka Akira <akr@m17n.org>
|
|
84
84
|
#
|
|
85
85
|
module OpenURI
|
|
86
|
+
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
87
|
+
# Raised on HTTP session failure
|
|
88
|
+
#
|
|
89
|
+
class HTTPError < StandardError
|
|
90
|
+
# <!--
|
|
91
|
+
# rdoc-file=lib/open-uri.rb
|
|
92
|
+
# - new(message, io)
|
|
93
|
+
# -->
|
|
94
|
+
#
|
|
95
|
+
def initialize: (String message, (StringIO & OpenURI::Meta) io) -> void
|
|
96
|
+
|
|
97
|
+
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
98
|
+
# StringIO having the received data
|
|
99
|
+
#
|
|
100
|
+
attr_reader io: StringIO & OpenURI::Meta
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
104
|
+
# Raised on redirection, only occurs when `redirect` option for HTTP is `false`.
|
|
105
|
+
#
|
|
106
|
+
class HTTPRedirect < HTTPError
|
|
107
|
+
# <!--
|
|
108
|
+
# rdoc-file=lib/open-uri.rb
|
|
109
|
+
# - new(message, io, uri)
|
|
110
|
+
# -->
|
|
111
|
+
#
|
|
112
|
+
def initialize: (String message, (StringIO & OpenURI::Meta) io, URI uri) -> void
|
|
113
|
+
|
|
114
|
+
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
115
|
+
# URI to redirect
|
|
116
|
+
#
|
|
117
|
+
attr_reader uri: URI
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
121
|
+
# Raised on too many redirection,
|
|
122
|
+
#
|
|
123
|
+
class TooManyRedirects < HTTPError
|
|
124
|
+
end
|
|
125
|
+
|
|
86
126
|
# <!-- rdoc-file=lib/open-uri.rb -->
|
|
87
127
|
# Mixin for holding meta-information.
|
|
88
128
|
#
|