rbs 3.9.5 → 4.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/.clang-format +74 -0
- data/.clangd +2 -0
- data/.github/dependabot.yml +14 -14
- data/.github/workflows/bundle-update.yml +60 -0
- data/.github/workflows/c-check.yml +58 -0
- data/.github/workflows/comments.yml +5 -3
- data/.github/workflows/dependabot.yml +2 -2
- data/.github/workflows/ruby.yml +40 -32
- data/.github/workflows/rust.yml +95 -0
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/windows.yml +3 -3
- data/.gitignore +4 -0
- data/.rubocop.yml +2 -2
- data/.vscode/extensions.json +5 -0
- data/.vscode/settings.json +19 -0
- data/CHANGELOG.md +284 -0
- data/README.md +38 -1
- data/Rakefile +144 -29
- data/Steepfile +2 -0
- data/config.yml +634 -62
- data/core/array.rbs +307 -227
- data/core/basic_object.rbs +9 -8
- data/core/binding.rbs +0 -2
- data/core/builtin.rbs +2 -2
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +55 -34
- data/core/complex.rbs +104 -78
- data/core/dir.rbs +61 -49
- data/core/encoding.rbs +12 -15
- data/core/enumerable.rbs +188 -87
- data/core/enumerator/arithmetic_sequence.rbs +70 -0
- data/core/enumerator.rbs +65 -2
- data/core/errno.rbs +11 -2
- data/core/errors.rbs +58 -29
- data/core/exception.rbs +13 -13
- data/core/fiber.rbs +74 -54
- data/core/file.rbs +280 -177
- data/core/file_test.rbs +3 -3
- data/core/float.rbs +257 -92
- data/core/gc.rbs +425 -281
- data/core/hash.rbs +1045 -739
- data/core/integer.rbs +135 -137
- data/core/io/buffer.rbs +53 -42
- data/core/io/wait.rbs +13 -35
- data/core/io.rbs +196 -148
- data/core/kernel.rbs +216 -155
- data/core/marshal.rbs +4 -4
- data/core/match_data.rbs +15 -13
- data/core/math.rbs +107 -66
- data/core/method.rbs +69 -33
- data/core/module.rbs +244 -106
- data/core/nil_class.rbs +7 -6
- data/core/numeric.rbs +74 -63
- data/core/object.rbs +9 -11
- data/core/object_space.rbs +30 -23
- data/core/pathname.rbs +1322 -0
- data/core/proc.rbs +95 -58
- data/core/process.rbs +222 -202
- data/core/ractor.rbs +371 -515
- data/core/random.rbs +21 -3
- data/core/range.rbs +159 -57
- data/core/rational.rbs +60 -89
- data/core/rbs/unnamed/argf.rbs +60 -53
- data/core/rbs/unnamed/env_class.rbs +19 -14
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +11 -118
- data/core/regexp.rbs +258 -214
- data/core/ruby.rbs +53 -0
- data/core/ruby_vm.rbs +38 -34
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +4 -71
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +16 -82
- data/core/rubygems/version.rbs +2 -3
- data/core/set.rbs +490 -360
- data/core/signal.rbs +26 -16
- data/core/string.rbs +3303 -1365
- data/core/struct.rbs +27 -26
- data/core/symbol.rbs +41 -34
- data/core/thread.rbs +135 -74
- data/core/time.rbs +81 -50
- data/core/trace_point.rbs +41 -35
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +24 -16
- data/core/warning.rbs +7 -7
- data/docs/aliases.md +79 -0
- data/docs/collection.md +3 -3
- data/docs/config.md +171 -0
- data/docs/encoding.md +56 -0
- data/docs/gem.md +0 -1
- data/docs/inline.md +576 -0
- data/docs/sigs.md +3 -3
- data/docs/syntax.md +46 -16
- data/docs/type_fingerprint.md +21 -0
- data/exe/rbs +1 -1
- data/ext/rbs_extension/ast_translation.c +1513 -0
- data/ext/rbs_extension/ast_translation.h +37 -0
- data/ext/rbs_extension/class_constants.c +185 -0
- data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +22 -1
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +25 -1
- data/ext/rbs_extension/legacy_location.c +294 -0
- data/ext/rbs_extension/legacy_location.h +82 -0
- data/ext/rbs_extension/main.c +468 -24
- 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 +1022 -0
- data/include/rbs/defines.h +86 -0
- data/include/rbs/lexer.h +206 -0
- data/include/rbs/location.h +40 -0
- data/include/rbs/parser.h +153 -0
- data/include/rbs/string.h +47 -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 -70
- data/include/rbs/util/rbs_encoding.h +282 -0
- data/include/rbs/util/rbs_unescape.h +24 -0
- data/include/rbs.h +9 -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/ast/annotation.rb +1 -1
- data/lib/rbs/ast/comment.rb +1 -1
- data/lib/rbs/ast/declarations.rb +10 -10
- data/lib/rbs/ast/members.rb +14 -14
- data/lib/rbs/ast/ruby/annotations.rb +409 -0
- data/lib/rbs/ast/ruby/comment_block.rb +245 -0
- data/lib/rbs/ast/ruby/declarations.rb +281 -0
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
- data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
- data/lib/rbs/ast/ruby/members.rb +723 -0
- data/lib/rbs/ast/type_param.rb +24 -4
- data/lib/rbs/buffer.rb +105 -20
- data/lib/rbs/cli/diff.rb +16 -15
- data/lib/rbs/cli/validate.rb +63 -126
- data/lib/rbs/cli.rb +56 -24
- data/lib/rbs/collection/config/lockfile_generator.rb +14 -2
- data/lib/rbs/collection/sources/git.rb +1 -0
- data/lib/rbs/collection.rb +0 -1
- data/lib/rbs/definition.rb +6 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +121 -65
- data/lib/rbs/definition_builder/method_builder.rb +65 -30
- data/lib/rbs/definition_builder.rb +177 -20
- data/lib/rbs/diff.rb +7 -1
- data/lib/rbs/environment/class_entry.rb +69 -0
- data/lib/rbs/environment/module_entry.rb +66 -0
- data/lib/rbs/environment.rb +402 -214
- data/lib/rbs/environment_loader.rb +2 -8
- data/lib/rbs/errors.rb +31 -21
- data/lib/rbs/inline_parser/comment_association.rb +117 -0
- data/lib/rbs/inline_parser.rb +542 -0
- data/lib/rbs/location_aux.rb +36 -4
- data/lib/rbs/locator.rb +5 -1
- data/lib/rbs/method_type.rb +5 -3
- data/lib/rbs/namespace.rb +0 -7
- data/lib/rbs/parser_aux.rb +35 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +3 -28
- data/lib/rbs/prototype/rbi.rb +3 -20
- data/lib/rbs/prototype/runtime.rb +10 -2
- data/lib/rbs/resolver/constant_resolver.rb +2 -2
- data/lib/rbs/resolver/type_name_resolver.rb +116 -38
- data/lib/rbs/source.rb +99 -0
- data/lib/rbs/subtractor.rb +7 -4
- data/lib/rbs/test/type_check.rb +19 -2
- data/lib/rbs/type_name.rb +1 -8
- data/lib/rbs/types.rb +91 -79
- data/lib/rbs/unit_test/convertibles.rb +1 -0
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/validator.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +13 -2
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +3 -3
- data/rbs.gemspec +4 -2
- data/rust/.gitignore +1 -0
- data/rust/Cargo.lock +378 -0
- data/rust/Cargo.toml +7 -0
- data/rust/ruby-rbs/Cargo.toml +22 -0
- data/rust/ruby-rbs/build.rs +764 -0
- data/rust/ruby-rbs/examples/locations.rs +60 -0
- data/rust/ruby-rbs/src/lib.rs +1 -0
- data/rust/ruby-rbs/src/node/mod.rs +742 -0
- data/rust/ruby-rbs/tests/sanity.rs +47 -0
- data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
- data/rust/ruby-rbs-sys/Cargo.toml +23 -0
- data/rust/ruby-rbs-sys/build.rs +204 -0
- data/rust/ruby-rbs-sys/src/lib.rs +50 -0
- data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
- data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
- data/rust/ruby-rbs-sys/wrapper.h +1 -0
- data/schema/typeParam.json +17 -1
- data/sig/ancestor_builder.rbs +1 -1
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +1 -1
- data/sig/ast/ruby/annotations.rbs +421 -0
- data/sig/ast/ruby/comment_block.rbs +127 -0
- data/sig/ast/ruby/declarations.rbs +158 -0
- data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
- data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
- data/sig/ast/ruby/members.rbs +178 -0
- data/sig/buffer.rbs +63 -5
- data/sig/cli/diff.rbs +5 -11
- data/sig/cli/validate.rbs +12 -8
- data/sig/cli.rbs +18 -18
- data/sig/definition.rbs +6 -0
- data/sig/definition_builder.rbs +3 -1
- data/sig/environment/class_entry.rbs +50 -0
- data/sig/environment/module_entry.rbs +50 -0
- data/sig/environment.rbs +94 -87
- data/sig/errors.rbs +26 -20
- data/sig/inline_parser/comment_association.rbs +71 -0
- data/sig/inline_parser.rbs +124 -0
- data/sig/location.rbs +32 -7
- data/sig/locator.rbs +0 -2
- data/sig/manifest.yaml +0 -1
- data/sig/method_builder.rbs +9 -4
- data/sig/namespace.rbs +0 -5
- data/sig/parser.rbs +67 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/resolver/type_name_resolver.rbs +35 -7
- data/sig/source.rbs +48 -0
- data/sig/type_param.rbs +13 -8
- data/sig/typename.rbs +0 -5
- data/sig/types.rbs +10 -8
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +1604 -0
- data/src/lexer.c +3194 -0
- data/src/lexer.re +154 -0
- data/src/lexstate.c +212 -0
- data/src/location.c +31 -0
- data/src/parser.c +4205 -0
- data/src/string.c +41 -0
- data/src/util/rbs_allocator.c +165 -0
- data/src/util/rbs_assert.c +19 -0
- data/src/util/rbs_buffer.c +54 -0
- data/src/util/rbs_constant_pool.c +18 -92
- data/src/util/rbs_encoding.c +21308 -0
- data/src/util/rbs_unescape.c +167 -0
- data/stdlib/bigdecimal/0/big_decimal.rbs +116 -98
- data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
- data/stdlib/cgi/0/core.rbs +9 -393
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/cgi-escape/0/escape.rbs +171 -0
- data/stdlib/coverage/0/coverage.rbs +7 -4
- data/stdlib/date/0/date.rbs +92 -79
- data/stdlib/date/0/date_time.rbs +25 -24
- data/stdlib/delegate/0/delegator.rbs +10 -7
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/digest/0/digest.rbs +110 -0
- data/stdlib/erb/0/erb.rbs +748 -347
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +158 -139
- data/stdlib/forwardable/0/forwardable.rbs +13 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +226 -179
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +162 -134
- data/stdlib/objspace/0/objspace.rbs +17 -34
- data/stdlib/open-uri/0/open-uri.rbs +48 -8
- data/stdlib/open3/0/open3.rbs +469 -10
- data/stdlib/openssl/0/openssl.rbs +475 -357
- data/stdlib/optparse/0/optparse.rbs +26 -17
- data/stdlib/pathname/0/pathname.rbs +11 -1381
- data/stdlib/pp/0/pp.rbs +9 -8
- data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
- data/stdlib/pstore/0/pstore.rbs +35 -30
- data/stdlib/psych/0/psych.rbs +65 -12
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
- data/stdlib/rdoc/0/code_object.rbs +4 -3
- data/stdlib/rdoc/0/comment.rbs +2 -0
- data/stdlib/rdoc/0/options.rbs +76 -0
- data/stdlib/rdoc/0/parser.rbs +1 -1
- data/stdlib/rdoc/0/rdoc.rbs +7 -5
- data/stdlib/rdoc/0/store.rbs +2 -2
- data/stdlib/resolv/0/resolv.rbs +25 -68
- data/stdlib/ripper/0/ripper.rbs +25 -19
- data/stdlib/securerandom/0/manifest.yaml +2 -0
- data/stdlib/securerandom/0/securerandom.rbs +7 -20
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/socket/0/addrinfo.rbs +9 -9
- data/stdlib/socket/0/basic_socket.rbs +3 -3
- data/stdlib/socket/0/ip_socket.rbs +10 -8
- data/stdlib/socket/0/socket.rbs +23 -10
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +11 -3
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +1177 -85
- data/stdlib/strscan/0/string_scanner.rbs +27 -25
- data/stdlib/tempfile/0/tempfile.rbs +25 -21
- data/stdlib/time/0/time.rbs +8 -6
- data/stdlib/timeout/0/timeout.rbs +63 -7
- data/stdlib/tsort/0/cyclic.rbs +3 -0
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +42 -20
- data/stdlib/uri/0/file.rbs +3 -3
- data/stdlib/uri/0/generic.rbs +26 -18
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/ldap.rbs +2 -2
- data/stdlib/uri/0/mailto.rbs +3 -3
- data/stdlib/uri/0/rfc2396_parser.rbs +12 -12
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +6 -6
- data/stdlib/zlib/0/gzip_writer.rbs +14 -12
- data/stdlib/zlib/0/inflate.rbs +1 -1
- data/stdlib/zlib/0/need_dict.rbs +1 -1
- data/stdlib/zlib/0/zstream.rbs +1 -0
- metadata +121 -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
data/stdlib/resolv/0/resolv.rbs
CHANGED
|
@@ -427,15 +427,9 @@ end
|
|
|
427
427
|
class Resolv::DNS::Config::OtherResolvError < Resolv::ResolvError
|
|
428
428
|
end
|
|
429
429
|
|
|
430
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
431
|
-
# Indicates that the DNS response was unable to be decoded.
|
|
432
|
-
#
|
|
433
430
|
class Resolv::DNS::DecodeError < StandardError
|
|
434
431
|
end
|
|
435
432
|
|
|
436
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
437
|
-
# Indicates that the DNS request was unable to be encoded.
|
|
438
|
-
#
|
|
439
433
|
class Resolv::DNS::EncodeError < StandardError
|
|
440
434
|
end
|
|
441
435
|
|
|
@@ -585,9 +579,6 @@ class Resolv::DNS::Message::MessageEncoder
|
|
|
585
579
|
def initialize: () -> untyped
|
|
586
580
|
end
|
|
587
581
|
|
|
588
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
589
|
-
# A representation of a DNS name.
|
|
590
|
-
#
|
|
591
582
|
class Resolv::DNS::Name
|
|
592
583
|
# <!--
|
|
593
584
|
# rdoc-file=lib/resolv.rb
|
|
@@ -677,9 +668,6 @@ Resolv::DNS::OpCode::Status: Integer
|
|
|
677
668
|
|
|
678
669
|
Resolv::DNS::OpCode::Update: Integer
|
|
679
670
|
|
|
680
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
681
|
-
# A DNS query abstract class.
|
|
682
|
-
#
|
|
683
671
|
class Resolv::DNS::Query
|
|
684
672
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
685
673
|
|
|
@@ -817,9 +805,6 @@ class Resolv::DNS::Requester::UnconnectedUDP::Sender < Resolv::DNS::Requester::S
|
|
|
817
805
|
def initialize: (Resolv::DNS::Message msg, String data, UDPSocket sock, String host, Integer port) -> untyped
|
|
818
806
|
end
|
|
819
807
|
|
|
820
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
821
|
-
# A DNS resource abstract class.
|
|
822
|
-
#
|
|
823
808
|
class Resolv::DNS::Resource < Resolv::DNS::Query
|
|
824
809
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
825
810
|
|
|
@@ -845,25 +830,16 @@ Resolv::DNS::Resource::ClassInsensitiveTypes: Array[singleton(Resolv::DNS::Resou
|
|
|
845
830
|
|
|
846
831
|
Resolv::DNS::Resource::ClassValue: Integer?
|
|
847
832
|
|
|
848
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
849
|
-
# A Query type requesting any RR.
|
|
850
|
-
#
|
|
851
833
|
class Resolv::DNS::Resource::ANY < Resolv::DNS::Query
|
|
852
834
|
end
|
|
853
835
|
|
|
854
836
|
Resolv::DNS::Resource::ANY::TypeValue: Integer
|
|
855
837
|
|
|
856
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
857
|
-
# The canonical name for an alias.
|
|
858
|
-
#
|
|
859
838
|
class Resolv::DNS::Resource::CNAME < Resolv::DNS::Resource::DomainName
|
|
860
839
|
end
|
|
861
840
|
|
|
862
841
|
Resolv::DNS::Resource::CNAME::TypeValue: Integer
|
|
863
842
|
|
|
864
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
865
|
-
# Domain Name resource abstract class.
|
|
866
|
-
#
|
|
867
843
|
class Resolv::DNS::Resource::DomainName < Resolv::DNS::Resource
|
|
868
844
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
869
845
|
|
|
@@ -885,9 +861,6 @@ class Resolv::DNS::Resource::DomainName < Resolv::DNS::Resource
|
|
|
885
861
|
def initialize: (String name) -> untyped
|
|
886
862
|
end
|
|
887
863
|
|
|
888
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
889
|
-
# A generic resource abstract class.
|
|
890
|
-
#
|
|
891
864
|
class Resolv::DNS::Resource::Generic < Resolv::DNS::Resource
|
|
892
865
|
def self.create: (Integer type_value, Integer class_value) -> Class
|
|
893
866
|
|
|
@@ -911,9 +884,6 @@ class Resolv::DNS::Resource::Generic < Resolv::DNS::Resource
|
|
|
911
884
|
def initialize: (String data) -> untyped
|
|
912
885
|
end
|
|
913
886
|
|
|
914
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
915
|
-
# Host Information resource.
|
|
916
|
-
#
|
|
917
887
|
class Resolv::DNS::Resource::HINFO < Resolv::DNS::Resource
|
|
918
888
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
919
889
|
|
|
@@ -942,17 +912,11 @@ end
|
|
|
942
912
|
|
|
943
913
|
Resolv::DNS::Resource::HINFO::TypeValue: Integer
|
|
944
914
|
|
|
945
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
946
|
-
# module IN contains ARPA Internet specific RRs.
|
|
947
|
-
#
|
|
948
915
|
module Resolv::DNS::Resource::IN
|
|
949
916
|
end
|
|
950
917
|
|
|
951
918
|
Resolv::DNS::Resource::IN::ClassValue: Integer
|
|
952
919
|
|
|
953
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
954
|
-
# IPv4 Address resource
|
|
955
|
-
#
|
|
956
920
|
class Resolv::DNS::Resource::IN::A < Resolv::DNS::Resource
|
|
957
921
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
958
922
|
|
|
@@ -978,9 +942,6 @@ Resolv::DNS::Resource::IN::A::ClassValue: Integer
|
|
|
978
942
|
|
|
979
943
|
Resolv::DNS::Resource::IN::A::TypeValue: Integer
|
|
980
944
|
|
|
981
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
982
|
-
# An IPv6 address record.
|
|
983
|
-
#
|
|
984
945
|
class Resolv::DNS::Resource::IN::AAAA < Resolv::DNS::Resource
|
|
985
946
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
986
947
|
|
|
@@ -1069,11 +1030,6 @@ Resolv::DNS::Resource::IN::SOA::ClassValue: Integer
|
|
|
1069
1030
|
|
|
1070
1031
|
Resolv::DNS::Resource::IN::SOA::TypeValue: Integer
|
|
1071
1032
|
|
|
1072
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1073
|
-
# SRV resource record defined in RFC 2782
|
|
1074
|
-
#
|
|
1075
|
-
# These records identify the hostname and port that a service is available at.
|
|
1076
|
-
#
|
|
1077
1033
|
class Resolv::DNS::Resource::IN::SRV < Resolv::DNS::Resource
|
|
1078
1034
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1079
1035
|
|
|
@@ -1141,9 +1097,6 @@ Resolv::DNS::Resource::IN::TXT::ClassValue: Integer
|
|
|
1141
1097
|
|
|
1142
1098
|
Resolv::DNS::Resource::IN::TXT::TypeValue: Integer
|
|
1143
1099
|
|
|
1144
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1145
|
-
# Well Known Service resource.
|
|
1146
|
-
#
|
|
1147
1100
|
class Resolv::DNS::Resource::IN::WKS < Resolv::DNS::Resource
|
|
1148
1101
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1149
1102
|
|
|
@@ -1182,9 +1135,6 @@ Resolv::DNS::Resource::IN::WKS::ClassValue: Integer
|
|
|
1182
1135
|
|
|
1183
1136
|
Resolv::DNS::Resource::IN::WKS::TypeValue: Integer
|
|
1184
1137
|
|
|
1185
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1186
|
-
# Location resource
|
|
1187
|
-
#
|
|
1188
1138
|
class Resolv::DNS::Resource::LOC < Resolv::DNS::Resource
|
|
1189
1139
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1190
1140
|
|
|
@@ -1243,9 +1193,6 @@ end
|
|
|
1243
1193
|
|
|
1244
1194
|
Resolv::DNS::Resource::LOC::TypeValue: Integer
|
|
1245
1195
|
|
|
1246
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1247
|
-
# Mailing list or mailbox information.
|
|
1248
|
-
#
|
|
1249
1196
|
class Resolv::DNS::Resource::MINFO < Resolv::DNS::Resource
|
|
1250
1197
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1251
1198
|
|
|
@@ -1273,9 +1220,6 @@ end
|
|
|
1273
1220
|
|
|
1274
1221
|
Resolv::DNS::Resource::MINFO::TypeValue: Integer
|
|
1275
1222
|
|
|
1276
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1277
|
-
# Mail Exchanger resource.
|
|
1278
|
-
#
|
|
1279
1223
|
class Resolv::DNS::Resource::MX < Resolv::DNS::Resource
|
|
1280
1224
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1281
1225
|
|
|
@@ -1304,25 +1248,16 @@ end
|
|
|
1304
1248
|
|
|
1305
1249
|
Resolv::DNS::Resource::MX::TypeValue: Integer
|
|
1306
1250
|
|
|
1307
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1308
|
-
# An authoritative name server.
|
|
1309
|
-
#
|
|
1310
1251
|
class Resolv::DNS::Resource::NS < Resolv::DNS::Resource::DomainName
|
|
1311
1252
|
end
|
|
1312
1253
|
|
|
1313
1254
|
Resolv::DNS::Resource::NS::TypeValue: Integer
|
|
1314
1255
|
|
|
1315
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1316
|
-
# A Pointer to another DNS name.
|
|
1317
|
-
#
|
|
1318
1256
|
class Resolv::DNS::Resource::PTR < Resolv::DNS::Resource::DomainName
|
|
1319
1257
|
end
|
|
1320
1258
|
|
|
1321
1259
|
Resolv::DNS::Resource::PTR::TypeValue: Integer
|
|
1322
1260
|
|
|
1323
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1324
|
-
# Start Of Authority resource.
|
|
1325
|
-
#
|
|
1326
1261
|
class Resolv::DNS::Resource::SOA < Resolv::DNS::Resource
|
|
1327
1262
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1328
1263
|
|
|
@@ -1380,9 +1315,6 @@ end
|
|
|
1380
1315
|
|
|
1381
1316
|
Resolv::DNS::Resource::SOA::TypeValue: Integer
|
|
1382
1317
|
|
|
1383
|
-
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1384
|
-
# Unstructured text resource.
|
|
1385
|
-
#
|
|
1386
1318
|
class Resolv::DNS::Resource::TXT < Resolv::DNS::Resource
|
|
1387
1319
|
def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
|
|
1388
1320
|
|
|
@@ -1478,6 +1410,9 @@ class Resolv::Hosts
|
|
|
1478
1410
|
def initialize: (?String filename) -> untyped
|
|
1479
1411
|
end
|
|
1480
1412
|
|
|
1413
|
+
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1414
|
+
# The default file name for host names
|
|
1415
|
+
#
|
|
1481
1416
|
Resolv::Hosts::DefaultFileName: String
|
|
1482
1417
|
|
|
1483
1418
|
# <!-- rdoc-file=lib/resolv.rb -->
|
|
@@ -1488,6 +1423,13 @@ class Resolv::IPv4
|
|
|
1488
1423
|
# rdoc-file=lib/resolv.rb
|
|
1489
1424
|
# - create(arg)
|
|
1490
1425
|
# -->
|
|
1426
|
+
# Creates a new IPv4 address from `arg` which may be:
|
|
1427
|
+
#
|
|
1428
|
+
# IPv4
|
|
1429
|
+
# : returns `arg`.
|
|
1430
|
+
#
|
|
1431
|
+
# String
|
|
1432
|
+
# : `arg` must match the IPv4::Regex constant
|
|
1491
1433
|
#
|
|
1492
1434
|
def self.create: (String | instance arg) -> instance
|
|
1493
1435
|
|
|
@@ -1519,6 +1461,9 @@ class Resolv::IPv4
|
|
|
1519
1461
|
def initialize: (String address) -> untyped
|
|
1520
1462
|
end
|
|
1521
1463
|
|
|
1464
|
+
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1465
|
+
# Regular expression IPv4 addresses must match.
|
|
1466
|
+
#
|
|
1522
1467
|
Resolv::IPv4::Regex: Regexp
|
|
1523
1468
|
|
|
1524
1469
|
# <!-- rdoc-file=lib/resolv.rb -->
|
|
@@ -1649,10 +1594,14 @@ class Resolv::LOC::Alt
|
|
|
1649
1594
|
# rdoc-file=lib/resolv.rb
|
|
1650
1595
|
# - new(altitude)
|
|
1651
1596
|
# -->
|
|
1597
|
+
# Internal use; use self.create.
|
|
1652
1598
|
#
|
|
1653
1599
|
def initialize: (Integer altitude) -> untyped
|
|
1654
1600
|
end
|
|
1655
1601
|
|
|
1602
|
+
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1603
|
+
# Regular expression LOC Alt must match.
|
|
1604
|
+
#
|
|
1656
1605
|
Resolv::LOC::Alt::Regex: Regexp
|
|
1657
1606
|
|
|
1658
1607
|
# <!-- rdoc-file=lib/resolv.rb -->
|
|
@@ -1701,10 +1650,14 @@ class Resolv::LOC::Coord
|
|
|
1701
1650
|
# rdoc-file=lib/resolv.rb
|
|
1702
1651
|
# - new(coordinates,orientation)
|
|
1703
1652
|
# -->
|
|
1653
|
+
# Internal use; use self.create.
|
|
1704
1654
|
#
|
|
1705
1655
|
def initialize: (String coordinates, orientation orientation) -> untyped
|
|
1706
1656
|
end
|
|
1707
1657
|
|
|
1658
|
+
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1659
|
+
# Regular expression LOC Coord must match.
|
|
1660
|
+
#
|
|
1708
1661
|
Resolv::LOC::Coord::Regex: Regexp
|
|
1709
1662
|
|
|
1710
1663
|
# <!-- rdoc-file=lib/resolv.rb -->
|
|
@@ -1746,10 +1699,14 @@ class Resolv::LOC::Size
|
|
|
1746
1699
|
# rdoc-file=lib/resolv.rb
|
|
1747
1700
|
# - new(scalar)
|
|
1748
1701
|
# -->
|
|
1702
|
+
# Internal use; use self.create.
|
|
1749
1703
|
#
|
|
1750
1704
|
def initialize: (String scalar) -> untyped
|
|
1751
1705
|
end
|
|
1752
1706
|
|
|
1707
|
+
# <!-- rdoc-file=lib/resolv.rb -->
|
|
1708
|
+
# Regular expression LOC size must match.
|
|
1709
|
+
#
|
|
1753
1710
|
Resolv::LOC::Size::Regex: Regexp
|
|
1754
1711
|
|
|
1755
1712
|
# <!-- rdoc-file=lib/resolv.rb -->
|
data/stdlib/ripper/0/ripper.rbs
CHANGED
|
@@ -31,23 +31,26 @@
|
|
|
31
31
|
# nil,
|
|
32
32
|
# nil]]]]
|
|
33
33
|
#
|
|
34
|
-
# You can see in the example above, the expression starts with
|
|
34
|
+
# You can see in the example above, the expression starts with
|
|
35
|
+
# <code>:program</code>.
|
|
35
36
|
#
|
|
36
|
-
# From here, a method definition at
|
|
37
|
-
#
|
|
38
|
-
# the method parameters under
|
|
37
|
+
# From here, a method definition at <code>:def</code>, followed by the method's
|
|
38
|
+
# identifier <code>:@ident</code>. After the method's identifier comes the
|
|
39
|
+
# parentheses <code>:paren</code> and the method parameters under
|
|
40
|
+
# <code>:params</code>.
|
|
39
41
|
#
|
|
40
|
-
# Next is the method body, starting at
|
|
41
|
-
# which contains the full definition of the method.
|
|
42
|
+
# Next is the method body, starting at <code>:bodystmt</code> (`stmt` meaning
|
|
43
|
+
# statement), which contains the full definition of the method.
|
|
42
44
|
#
|
|
43
45
|
# In our case, we're simply returning a String, so next we have the
|
|
44
|
-
#
|
|
46
|
+
# <code>:string_literal</code> expression.
|
|
45
47
|
#
|
|
46
|
-
# Within our
|
|
47
|
-
# literal part for
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
48
|
+
# Within our <code>:string_literal</code> you'll notice two
|
|
49
|
+
# <code>@tstring_content</code>, this is the literal part for <code>Hello,
|
|
50
|
+
# </code> and <code>!</code>. Between the two <code>@tstring_content</code>
|
|
51
|
+
# statements is a <code>:string_embexpr</code>, where *embexpr* is an embedded
|
|
52
|
+
# expression. Our expression consists of a local variable, or `var_ref`, with
|
|
53
|
+
# the identifier (<code>@ident</code>) of `world`.
|
|
51
54
|
#
|
|
52
55
|
# ## Resources
|
|
53
56
|
#
|
|
@@ -189,7 +192,7 @@ class Ripper
|
|
|
189
192
|
# - state()
|
|
190
193
|
# -->
|
|
191
194
|
# The scanner's state of the current token. This value is the bitwise OR of zero
|
|
192
|
-
# or more of the
|
|
195
|
+
# or more of the <code>Ripper::EXPR_*</code> constants.
|
|
193
196
|
#
|
|
194
197
|
def state: () -> Ripper::Lexer::State
|
|
195
198
|
|
|
@@ -247,8 +250,8 @@ class Ripper
|
|
|
247
250
|
# - to_a()
|
|
248
251
|
# -->
|
|
249
252
|
#
|
|
250
|
-
def to_a: () -> [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State, String ]
|
|
251
|
-
|
|
253
|
+
def to_a: () -> ( [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State, String ]
|
|
254
|
+
| [ [ Integer, Integer ], Symbol, String, Ripper::Lexer::State ] )
|
|
252
255
|
end
|
|
253
256
|
|
|
254
257
|
class State
|
|
@@ -911,6 +914,7 @@ class Ripper
|
|
|
911
914
|
|
|
912
915
|
class CompileError < Error
|
|
913
916
|
end
|
|
917
|
+
|
|
914
918
|
class Error < StandardError
|
|
915
919
|
end
|
|
916
920
|
|
|
@@ -927,6 +931,7 @@ class Ripper
|
|
|
927
931
|
|
|
928
932
|
def match: (?untyped n) -> untyped
|
|
929
933
|
end
|
|
934
|
+
|
|
930
935
|
class MatchError < Error
|
|
931
936
|
end
|
|
932
937
|
alias self.compile self.new
|
|
@@ -949,6 +954,7 @@ class Ripper
|
|
|
949
954
|
|
|
950
955
|
def map_tokens: (untyped tokens) -> untyped
|
|
951
956
|
end
|
|
957
|
+
|
|
952
958
|
interface _Gets
|
|
953
959
|
def gets: (?String sep, ?Integer limit) -> String?
|
|
954
960
|
end
|
|
@@ -969,10 +975,10 @@ class Ripper
|
|
|
969
975
|
# - lex(src, filename = '-', lineno = 1, **kw)
|
|
970
976
|
# -->
|
|
971
977
|
# Tokenizes the Ruby program and returns an array of an array, which is
|
|
972
|
-
# formatted like
|
|
973
|
-
# argument is mostly ignored. By default, this method does not handle
|
|
974
|
-
# errors in `src`, use the `raise_errors` keyword to raise a SyntaxError
|
|
975
|
-
# error in `src`.
|
|
978
|
+
# formatted like <code>[[lineno, column], type, token, state]</code>. The
|
|
979
|
+
# `filename` argument is mostly ignored. By default, this method does not handle
|
|
980
|
+
# syntax errors in `src`, use the `raise_errors` keyword to raise a SyntaxError
|
|
981
|
+
# for an error in `src`.
|
|
976
982
|
#
|
|
977
983
|
# require 'ripper'
|
|
978
984
|
# require 'pp'
|
|
@@ -29,34 +29,21 @@
|
|
|
29
29
|
# * uuid
|
|
30
30
|
#
|
|
31
31
|
# These methods are usable as class methods of SecureRandom such as
|
|
32
|
-
#
|
|
32
|
+
# <code>SecureRandom.hex</code>.
|
|
33
33
|
#
|
|
34
34
|
# If a secure random number generator is not available, `NotImplementedError` is
|
|
35
35
|
# raised.
|
|
36
36
|
#
|
|
37
37
|
module SecureRandom
|
|
38
|
-
extend Random::Formatter
|
|
39
|
-
|
|
40
38
|
# <!--
|
|
41
39
|
# rdoc-file=lib/securerandom.rb
|
|
42
|
-
# -
|
|
40
|
+
# - bytes(n)
|
|
43
41
|
# -->
|
|
44
|
-
#
|
|
45
|
-
# support Ruby 3.2
|
|
42
|
+
# Returns a random binary string containing `size` bytes.
|
|
46
43
|
#
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def self.
|
|
50
|
-
|
|
51
|
-
def self.hex: (?Integer?) -> String
|
|
52
|
-
|
|
53
|
-
def self.random_bytes: (?Integer?) -> String
|
|
54
|
-
|
|
55
|
-
def self.random_number: () -> Float
|
|
56
|
-
| (Integer) -> Integer
|
|
57
|
-
| (Numeric) -> Numeric
|
|
58
|
-
|
|
59
|
-
def self.urlsafe_base64: (?Integer?, ?bool?) -> String
|
|
44
|
+
# See Random.bytes
|
|
45
|
+
#
|
|
46
|
+
def self.bytes: (Integer) -> String
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
extend Random::Formatter
|
|
62
49
|
end
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# This module manipulates strings according to the word parsing rules of the
|
|
5
5
|
# UNIX Bourne shell.
|
|
6
6
|
#
|
|
7
|
-
# The
|
|
8
|
-
# modified to conform to [the Shell & Utilities volume of the IEEE Std
|
|
7
|
+
# The <code>shellwords()</code> function was originally a port of shellwords.pl,
|
|
8
|
+
# but modified to conform to [the Shell & Utilities volume of the IEEE Std
|
|
9
9
|
# 1003.1-2008, 2016
|
|
10
10
|
# Edition](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.ht
|
|
11
11
|
# ml)
|
|
@@ -61,8 +61,8 @@ class Addrinfo
|
|
|
61
61
|
# #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net)>,
|
|
62
62
|
# # #<Addrinfo: [2001:200:dff:fff1:216:3eff:feb1:44d7]:80 TCP (www.kame.net)>]
|
|
63
63
|
#
|
|
64
|
-
def self.getaddrinfo: (String nodename, ?String | Integer
|
|
65
|
-
| (String? nodename, ?String | Integer service, ?Symbol? family, ?Symbol | Integer protocol) -> Array[Addrinfo]
|
|
64
|
+
def self.getaddrinfo: (String nodename, ?(String | Integer)? service, ?(Symbol | Integer)? family, ?Symbol | Integer protocol) -> Array[Addrinfo]
|
|
65
|
+
| (String? nodename, ?(String | Integer) service, ?(Symbol | Integer)? family, ?Symbol | Integer protocol) -> Array[Addrinfo]
|
|
66
66
|
|
|
67
67
|
# <!--
|
|
68
68
|
# rdoc-file=ext/socket/raddrinfo.c
|
|
@@ -634,13 +634,13 @@ class Addrinfo
|
|
|
634
634
|
# sockaddr as generated by Socket.sockaddr_in or Socket.unpack_sockaddr_un.
|
|
635
635
|
#
|
|
636
636
|
# sockaddr examples:
|
|
637
|
-
# *
|
|
638
|
-
# *
|
|
639
|
-
# *
|
|
640
|
-
# *
|
|
641
|
-
# *
|
|
642
|
-
# *
|
|
643
|
-
# *
|
|
637
|
+
# * <code>["AF_INET", 46102, "localhost.localdomain", "127.0.0.1"]</code>
|
|
638
|
+
# * <code>["AF_INET6", 42304, "ip6-localhost", "::1"]</code>
|
|
639
|
+
# * <code>["AF_UNIX", "/tmp/sock"]</code>
|
|
640
|
+
# * <code>Socket.sockaddr_in("smtp", "2001:DB8::1")</code>
|
|
641
|
+
# * <code>Socket.sockaddr_in(80, "172.18.22.42")</code>
|
|
642
|
+
# * <code>Socket.sockaddr_in(80, "www.ruby-lang.org")</code>
|
|
643
|
+
# * <code>Socket.sockaddr_un("/tmp/sock")</code>
|
|
644
644
|
#
|
|
645
645
|
# In an AF_INET/AF_INET6 sockaddr array, the 4th element, numeric IP address, is
|
|
646
646
|
# used to construct socket address in the Addrinfo instance. If the 3rd element,
|
|
@@ -325,7 +325,7 @@ class BasicSocket < IO
|
|
|
325
325
|
#
|
|
326
326
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
327
327
|
# recv_nonblock should not raise an IO::WaitReadable exception, but return the
|
|
328
|
-
# symbol
|
|
328
|
+
# symbol <code>:wait_readable</code> instead.
|
|
329
329
|
#
|
|
330
330
|
# ### See
|
|
331
331
|
# * Socket#recvfrom
|
|
@@ -399,7 +399,7 @@ class BasicSocket < IO
|
|
|
399
399
|
#
|
|
400
400
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
401
401
|
# recvmsg_nonblock should not raise an IO::WaitReadable exception, but return
|
|
402
|
-
# the symbol
|
|
402
|
+
# the symbol <code>:wait_readable</code> instead.
|
|
403
403
|
#
|
|
404
404
|
def recvmsg_nonblock: (?Integer dlen, ?Integer flags, ?Integer clen, ?exception: boolish, ?scm_rights: boolish) -> ([ String, Addrinfo, Integer?, Array[Socket::AncillaryData] ] | :wait_readable)
|
|
405
405
|
|
|
@@ -487,7 +487,7 @@ class BasicSocket < IO
|
|
|
487
487
|
#
|
|
488
488
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
489
489
|
# sendmsg_nonblock should not raise an IO::WaitWritable exception, but return
|
|
490
|
-
# the symbol
|
|
490
|
+
# the symbol <code>:wait_writable</code> instead.
|
|
491
491
|
#
|
|
492
492
|
def sendmsg_nonblock: (String mesg, ?Integer flags, ?Addrinfo | String dest_sockaddr, *Socket::AncillaryData controls, ?exception: boolish) -> (Integer | :wait_writable)
|
|
493
493
|
|
|
@@ -22,10 +22,11 @@ class IPSocket < BasicSocket
|
|
|
22
22
|
# Returns the local address as an array which contains address_family, port,
|
|
23
23
|
# hostname and numeric_address.
|
|
24
24
|
#
|
|
25
|
-
# If `reverse_lookup` is `true` or
|
|
26
|
-
# numeric_address using reverse lookup. Or if it is `false`, or
|
|
27
|
-
# hostname is the same as numeric_address. Or if it is
|
|
28
|
-
# to
|
|
25
|
+
# If `reverse_lookup` is `true` or <code>:hostname</code>, hostname is obtained
|
|
26
|
+
# from numeric_address using reverse lookup. Or if it is `false`, or
|
|
27
|
+
# <code>:numeric</code>, hostname is the same as numeric_address. Or if it is
|
|
28
|
+
# `nil` or omitted, obeys to <code>ipsocket.do_not_reverse_lookup</code>. See
|
|
29
|
+
# <code>Socket.getaddrinfo</code> also.
|
|
29
30
|
#
|
|
30
31
|
# TCPSocket.open("www.ruby-lang.org", 80) {|sock|
|
|
31
32
|
# p sock.addr #=> ["AF_INET", 49429, "hal", "192.168.0.128"]
|
|
@@ -53,10 +54,11 @@ class IPSocket < BasicSocket
|
|
|
53
54
|
# hostname and numeric_address. It is defined for connection oriented socket
|
|
54
55
|
# such as TCPSocket.
|
|
55
56
|
#
|
|
56
|
-
# If `reverse_lookup` is `true` or
|
|
57
|
-
# numeric_address using reverse lookup. Or if it is `false`, or
|
|
58
|
-
# hostname is the same as numeric_address. Or if it is
|
|
59
|
-
# to
|
|
57
|
+
# If `reverse_lookup` is `true` or <code>:hostname</code>, hostname is obtained
|
|
58
|
+
# from numeric_address using reverse lookup. Or if it is `false`, or
|
|
59
|
+
# <code>:numeric</code>, hostname is the same as numeric_address. Or if it is
|
|
60
|
+
# `nil` or omitted, obeys to <code>ipsocket.do_not_reverse_lookup</code>. See
|
|
61
|
+
# <code>Socket.getaddrinfo</code> also.
|
|
60
62
|
#
|
|
61
63
|
# TCPSocket.open("www.ruby-lang.org", 80) {|sock|
|
|
62
64
|
# p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
|
data/stdlib/socket/0/socket.rbs
CHANGED
|
@@ -16,20 +16,21 @@
|
|
|
16
16
|
#
|
|
17
17
|
# Sockets have their own vocabulary:
|
|
18
18
|
#
|
|
19
|
-
#
|
|
19
|
+
# <strong>domain:</strong> The family of protocols:
|
|
20
20
|
# * Socket::PF_INET
|
|
21
21
|
# * Socket::PF_INET6
|
|
22
22
|
# * Socket::PF_UNIX
|
|
23
23
|
# * etc.
|
|
24
24
|
#
|
|
25
|
-
#
|
|
25
|
+
# <strong>type:</strong> The type of communications between the two endpoints,
|
|
26
|
+
# typically
|
|
26
27
|
# * Socket::SOCK_STREAM
|
|
27
28
|
# * Socket::SOCK_DGRAM.
|
|
28
29
|
#
|
|
29
|
-
#
|
|
30
|
-
# protocol.
|
|
30
|
+
# <strong>protocol:</strong> Typically *zero*. This may be used to identify a
|
|
31
|
+
# variant of a protocol.
|
|
31
32
|
#
|
|
32
|
-
#
|
|
33
|
+
# <strong>hostname:</strong> The identifier of a network interface:
|
|
33
34
|
# * a string (hostname, IPv4 or IPv6 address or `broadcast` which specifies a
|
|
34
35
|
# broadcast address)
|
|
35
36
|
# * a zero-length string which specifies INADDR_ANY
|
|
@@ -484,10 +485,17 @@ class Socket < BasicSocket
|
|
|
484
485
|
# The `connect_timeout` specifies the timeout in seconds from the start of
|
|
485
486
|
# the connection attempt to the last candidate.
|
|
486
487
|
# By default, all connection attempts continue until the timeout occurs.
|
|
487
|
-
# When
|
|
488
|
+
# When <code>fast_fallback:false</code> is explicitly specified,
|
|
488
489
|
# a timeout is set for each connection attempt and any connection attempt
|
|
489
490
|
# that exceeds its timeout will be canceled.
|
|
490
491
|
#
|
|
492
|
+
# :open_timeout
|
|
493
|
+
# : Specifies the timeout in seconds from the start of the method execution.
|
|
494
|
+
# If this timeout is reached while there are still addresses that have not
|
|
495
|
+
# yet been attempted for connection, no further attempts will be made.
|
|
496
|
+
# If this option is specified together with other timeout options, an
|
|
497
|
+
# `ArgumentError` will be raised.
|
|
498
|
+
#
|
|
491
499
|
# :fast_fallback
|
|
492
500
|
# : Enables the Happy Eyeballs Version 2 algorithm (enabled by default).
|
|
493
501
|
#
|
|
@@ -504,7 +512,9 @@ class Socket < BasicSocket
|
|
|
504
512
|
# }
|
|
505
513
|
#
|
|
506
514
|
def self.tcp: (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Time::_Timeout, ?connect_timeout: Time::_Timeout) -> instance
|
|
507
|
-
| (String host, Integer port, ?String local_host, ?Integer local_port, ?
|
|
515
|
+
| (String host, Integer port, ?String local_host, ?Integer local_port, ?open_timeout: Time::_Timeout) -> instance
|
|
516
|
+
| [T] (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Time::_Timeout, ?connect_timeout: Time::_Timeout) { (instance) -> T } -> T
|
|
517
|
+
| [T] (String host, Integer port, ?String local_host, ?Integer local_port, ?open_timeout: Time::_Timeout) { (instance) -> T } -> T
|
|
508
518
|
|
|
509
519
|
# <!--
|
|
510
520
|
# rdoc-file=ext/socket/lib/socket.rb
|
|
@@ -836,7 +846,7 @@ class Socket < BasicSocket
|
|
|
836
846
|
#
|
|
837
847
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
838
848
|
# accept_nonblock should not raise an IO::WaitReadable exception, but return the
|
|
839
|
-
# symbol
|
|
849
|
+
# symbol <code>:wait_readable</code> instead.
|
|
840
850
|
#
|
|
841
851
|
# ### See
|
|
842
852
|
# * Socket#accept
|
|
@@ -1090,7 +1100,7 @@ class Socket < BasicSocket
|
|
|
1090
1100
|
#
|
|
1091
1101
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
1092
1102
|
# connect_nonblock should not raise an IO::WaitWritable exception, but return
|
|
1093
|
-
# the symbol
|
|
1103
|
+
# the symbol <code>:wait_writable</code> instead.
|
|
1094
1104
|
#
|
|
1095
1105
|
# ### See
|
|
1096
1106
|
# * Socket#connect
|
|
@@ -1348,7 +1358,7 @@ class Socket < BasicSocket
|
|
|
1348
1358
|
#
|
|
1349
1359
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
1350
1360
|
# recvfrom_nonblock should not raise an IO::WaitReadable exception, but return
|
|
1351
|
-
# the symbol
|
|
1361
|
+
# the symbol <code>:wait_readable</code> instead.
|
|
1352
1362
|
#
|
|
1353
1363
|
# ### See
|
|
1354
1364
|
# * Socket#recvfrom
|
|
@@ -3769,6 +3779,9 @@ class Socket::Ifaddr
|
|
|
3769
3779
|
# -->
|
|
3770
3780
|
# Returns the flags of *ifaddr*.
|
|
3771
3781
|
#
|
|
3782
|
+
# The value is bitwise-or of Socket::IFF_* constants such as
|
|
3783
|
+
# Socket::IFF_LOOPBACK.
|
|
3784
|
+
#
|
|
3772
3785
|
def flags: () -> Integer
|
|
3773
3786
|
|
|
3774
3787
|
# <!--
|
|
@@ -72,7 +72,7 @@ class TCPServer < TCPSocket
|
|
|
72
72
|
#
|
|
73
73
|
# By specifying a keyword argument *exception* to `false`, you can indicate that
|
|
74
74
|
# accept_nonblock should not raise an IO::WaitReadable exception, but return the
|
|
75
|
-
# symbol
|
|
75
|
+
# symbol <code>:wait_readable</code> instead.
|
|
76
76
|
#
|
|
77
77
|
# ### See
|
|
78
78
|
# * TCPServer#accept
|
|
@@ -38,7 +38,7 @@ class TCPSocket < IPSocket
|
|
|
38
38
|
|
|
39
39
|
# <!--
|
|
40
40
|
# rdoc-file=ext/socket/tcpsocket.c
|
|
41
|
-
# - TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil, resolv_timeout: nil, connect_timeout: nil, fast_fallback: true)
|
|
41
|
+
# - TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil, resolv_timeout: nil, connect_timeout: nil, open_timeout: nil, fast_fallback: true)
|
|
42
42
|
# -->
|
|
43
43
|
# Opens a TCP connection to `remote_host` on `remote_port`. If `local_host` and
|
|
44
44
|
# `local_port` are specified, then those parameters are used on the local end to
|
|
@@ -68,12 +68,20 @@ class TCPSocket < IPSocket
|
|
|
68
68
|
# The `connect_timeout` specifies the timeout in seconds from the start of
|
|
69
69
|
# the connection attempt to the last candidate.
|
|
70
70
|
# By default, all connection attempts continue until the timeout occurs.
|
|
71
|
-
# When
|
|
71
|
+
# When <code>fast_fallback:false</code> is explicitly specified,
|
|
72
72
|
# a timeout is set for each connection attempt and any connection attempt
|
|
73
73
|
# that exceeds its timeout will be canceled.
|
|
74
74
|
#
|
|
75
|
+
# :open_timeout
|
|
76
|
+
# : Specifies the timeout in seconds from the start of the method execution.
|
|
77
|
+
# If this timeout is reached while there are still addresses that have not
|
|
78
|
+
# yet been attempted for connection, no further attempts will be made.
|
|
79
|
+
# If this option is specified together with other timeout options, an
|
|
80
|
+
# `ArgumentError` will be raised.
|
|
81
|
+
#
|
|
75
82
|
# :fast_fallback
|
|
76
83
|
# : Enables the Happy Eyeballs Version 2 algorithm (enabled by default).
|
|
77
84
|
#
|
|
78
|
-
def initialize: (String remote_host, Integer remote_port, ?String local_host, ?Integer local_port) ->
|
|
85
|
+
def initialize: (String remote_host, Integer remote_port, ?String local_host, ?Integer local_port, ?fast_fallback: boolish, ?resolv_timeout: Integer, ?connect_timeout: Integer) -> void
|
|
86
|
+
| (String remote_host, Integer remote_port, ?String local_host, ?Integer local_port, ?fast_fallback: boolish, ?open_timeout: Integer) -> void
|
|
79
87
|
end
|