rbs 4.0.0.dev.5 → 4.0.1.dev.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 +1 -0
- data/.github/workflows/c-check.yml +8 -4
- data/.github/workflows/comments.yml +3 -1
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +10 -0
- data/.github/workflows/rust.yml +95 -0
- data/CHANGELOG.md +323 -0
- data/Rakefile +12 -29
- data/Steepfile +1 -0
- data/config.yml +393 -37
- data/core/array.rbs +218 -188
- data/core/basic_object.rbs +9 -8
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +45 -31
- data/core/complex.rbs +52 -40
- data/core/dir.rbs +57 -45
- data/core/encoding.rbs +5 -5
- data/core/enumerable.rbs +96 -91
- data/core/enumerator.rbs +4 -3
- data/core/errno.rbs +3 -2
- data/core/errors.rbs +31 -29
- data/core/exception.rbs +12 -12
- data/core/fiber.rbs +36 -36
- data/core/file.rbs +186 -113
- data/core/file_test.rbs +2 -2
- data/core/float.rbs +41 -32
- data/core/gc.rbs +78 -70
- data/core/hash.rbs +70 -60
- data/core/integer.rbs +32 -28
- data/core/io/buffer.rbs +36 -36
- data/core/io/wait.rbs +7 -7
- data/core/io.rbs +120 -135
- data/core/kernel.rbs +189 -139
- data/core/marshal.rbs +3 -3
- data/core/match_data.rbs +14 -12
- data/core/math.rbs +69 -67
- data/core/method.rbs +6 -6
- data/core/module.rbs +146 -85
- data/core/nil_class.rbs +4 -3
- data/core/numeric.rbs +35 -32
- data/core/object.rbs +6 -8
- data/core/object_space.rbs +11 -10
- data/core/pathname.rbs +131 -81
- data/core/proc.rbs +65 -33
- data/core/process.rbs +219 -201
- data/core/ractor.rbs +15 -11
- data/core/random.rbs +4 -3
- data/core/range.rbs +52 -47
- data/core/rational.rbs +5 -5
- data/core/rbs/unnamed/argf.rbs +58 -51
- data/core/rbs/unnamed/env_class.rbs +18 -13
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +7 -5
- data/core/regexp.rbs +236 -197
- data/core/ruby.rbs +1 -1
- data/core/ruby_vm.rbs +32 -30
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +1 -1
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +5 -3
- data/core/set.rbs +17 -16
- data/core/signal.rbs +2 -2
- data/core/string.rbs +311 -292
- data/core/struct.rbs +26 -25
- data/core/symbol.rbs +25 -24
- data/core/thread.rbs +40 -34
- data/core/time.rbs +47 -42
- data/core/trace_point.rbs +34 -31
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +10 -10
- data/core/warning.rbs +7 -7
- data/docs/collection.md +1 -1
- data/docs/config.md +171 -0
- data/docs/inline.md +110 -4
- data/docs/syntax.md +13 -12
- data/ext/rbs_extension/ast_translation.c +489 -135
- data/ext/rbs_extension/class_constants.c +8 -0
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/legacy_location.c +28 -51
- data/ext/rbs_extension/legacy_location.h +37 -0
- data/ext/rbs_extension/main.c +12 -20
- data/include/rbs/ast.h +423 -195
- data/include/rbs/lexer.h +2 -2
- data/include/rbs/location.h +25 -44
- data/include/rbs/parser.h +2 -2
- data/include/rbs/util/rbs_constant_pool.h +0 -3
- data/include/rbs.h +8 -0
- data/lib/rbs/ast/ruby/annotations.rb +157 -4
- data/lib/rbs/ast/ruby/members.rb +374 -22
- data/lib/rbs/cli/validate.rb +5 -60
- data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
- data/lib/rbs/definition_builder.rb +60 -27
- data/lib/rbs/errors.rb +0 -11
- data/lib/rbs/inline_parser.rb +1 -1
- data/lib/rbs/parser_aux.rb +20 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +1 -26
- data/lib/rbs/prototype/rbi.rb +1 -20
- data/lib/rbs/test/type_check.rb +3 -0
- data/lib/rbs/types.rb +62 -52
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +0 -1
- data/rbs.gemspec +1 -1
- 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/sig/ast/ruby/annotations.rbs +191 -4
- data/sig/ast/ruby/members.rbs +21 -1
- data/sig/cli/validate.rbs +1 -6
- data/sig/definition_builder.rbs +2 -0
- data/sig/errors.rbs +0 -8
- data/sig/method_types.rbs +1 -1
- data/sig/parser.rbs +17 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/types.rbs +10 -11
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +339 -161
- data/src/lexstate.c +1 -1
- data/src/location.c +7 -47
- data/src/parser.c +674 -480
- data/src/util/rbs_constant_pool.c +0 -4
- data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
- data/stdlib/cgi-escape/0/escape.rbs +4 -4
- data/stdlib/coverage/0/coverage.rbs +4 -3
- data/stdlib/date/0/date.rbs +33 -28
- data/stdlib/date/0/date_time.rbs +24 -23
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/erb/0/erb.rbs +64 -53
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +138 -125
- data/stdlib/forwardable/0/forwardable.rbs +10 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +135 -108
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +159 -134
- data/stdlib/objspace/0/objspace.rbs +8 -7
- data/stdlib/open-uri/0/open-uri.rbs +8 -8
- data/stdlib/open3/0/open3.rbs +36 -35
- data/stdlib/openssl/0/openssl.rbs +144 -129
- data/stdlib/optparse/0/optparse.rbs +18 -14
- data/stdlib/pathname/0/pathname.rbs +2 -2
- 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 +61 -8
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
- data/stdlib/ripper/0/ripper.rbs +20 -17
- data/stdlib/securerandom/0/securerandom.rbs +1 -1
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- data/stdlib/socket/0/addrinfo.rbs +7 -7
- data/stdlib/socket/0/basic_socket.rbs +3 -3
- data/stdlib/socket/0/ip_socket.rbs +10 -8
- data/stdlib/socket/0/socket.rbs +10 -9
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +1 -1
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +55 -54
- data/stdlib/strscan/0/string_scanner.rbs +46 -44
- data/stdlib/tempfile/0/tempfile.rbs +24 -20
- data/stdlib/time/0/time.rbs +7 -5
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +26 -18
- data/stdlib/uri/0/file.rbs +2 -2
- data/stdlib/uri/0/generic.rbs +2 -2
- 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 +6 -5
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +4 -4
- 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
- metadata +23 -5
- data/.github/workflows/valgrind.yml +0 -42
data/core/ruby.rbs
CHANGED
data/core/ruby_vm.rbs
CHANGED
|
@@ -41,8 +41,8 @@ RubyVM::OPTS: Array[String]
|
|
|
41
41
|
# you want to learn how YARV works, but it also lets you control various
|
|
42
42
|
# settings for the Ruby iseq compiler.
|
|
43
43
|
#
|
|
44
|
-
# You can find the source for the VM instructions in
|
|
45
|
-
# source.
|
|
44
|
+
# You can find the source for the VM instructions in <code>insns.def</code> in
|
|
45
|
+
# the Ruby source.
|
|
46
46
|
#
|
|
47
47
|
# The instruction sequence results will almost certainly change as Ruby changes,
|
|
48
48
|
# so example output in this documentation may be different from what you see.
|
|
@@ -183,8 +183,8 @@ class RubyVM::InstructionSequence < Object
|
|
|
183
183
|
# -->
|
|
184
184
|
# Returns the label of this instruction sequence.
|
|
185
185
|
#
|
|
186
|
-
#
|
|
187
|
-
# string.
|
|
186
|
+
# <code><main></code> if it's at the top level, <code><compiled></code> if it
|
|
187
|
+
# was evaluated from a string.
|
|
188
188
|
#
|
|
189
189
|
# For example, using irb:
|
|
190
190
|
#
|
|
@@ -212,7 +212,7 @@ class RubyVM::InstructionSequence < Object
|
|
|
212
212
|
# -->
|
|
213
213
|
# Returns the path of this instruction sequence.
|
|
214
214
|
#
|
|
215
|
-
#
|
|
215
|
+
# <code><compiled></code> if the iseq was evaluated from a string.
|
|
216
216
|
#
|
|
217
217
|
# For example, using irb:
|
|
218
218
|
#
|
|
@@ -254,8 +254,8 @@ class RubyVM::InstructionSequence < Object
|
|
|
254
254
|
# the following data:
|
|
255
255
|
#
|
|
256
256
|
# magic
|
|
257
|
-
# : A string identifying the data format.
|
|
258
|
-
#
|
|
257
|
+
# : A string identifying the data format. <strong>Always
|
|
258
|
+
# <code>YARVInstructionSequence/SimpleDataFormat</code>.</strong>
|
|
259
259
|
#
|
|
260
260
|
#
|
|
261
261
|
# major_version
|
|
@@ -273,14 +273,14 @@ class RubyVM::InstructionSequence < Object
|
|
|
273
273
|
# misc
|
|
274
274
|
# : A hash containing:
|
|
275
275
|
#
|
|
276
|
-
#
|
|
276
|
+
# <code>:arg_size</code>
|
|
277
277
|
# : the total number of arguments taken by the method or the block (0 if
|
|
278
278
|
# *iseq* doesn't represent a method or block)
|
|
279
279
|
#
|
|
280
|
-
#
|
|
280
|
+
# <code>:local_size</code>
|
|
281
281
|
# : the number of local variables + 1
|
|
282
282
|
#
|
|
283
|
-
#
|
|
283
|
+
# <code>:stack_max</code>
|
|
284
284
|
# : used in calculating the stack depth at which a SystemStackError is
|
|
285
285
|
# thrown.
|
|
286
286
|
#
|
|
@@ -290,15 +290,15 @@ class RubyVM::InstructionSequence < Object
|
|
|
290
290
|
# : The name of the context (block, method, class, module, etc.) that this
|
|
291
291
|
# instruction sequence belongs to.
|
|
292
292
|
#
|
|
293
|
-
#
|
|
294
|
-
# string.
|
|
293
|
+
# <code><main></code> if it's at the top level, <code><compiled></code> if
|
|
294
|
+
# it was evaluated from a string.
|
|
295
295
|
#
|
|
296
296
|
#
|
|
297
297
|
# #path
|
|
298
298
|
# : The relative path to the Ruby file where the instruction sequence was
|
|
299
299
|
# loaded from.
|
|
300
300
|
#
|
|
301
|
-
#
|
|
301
|
+
# <code><compiled></code> if the iseq was evaluated from a string.
|
|
302
302
|
#
|
|
303
303
|
#
|
|
304
304
|
# #absolute_path
|
|
@@ -316,8 +316,9 @@ class RubyVM::InstructionSequence < Object
|
|
|
316
316
|
# type
|
|
317
317
|
# : The type of the instruction sequence.
|
|
318
318
|
#
|
|
319
|
-
# Valid values are
|
|
320
|
-
#
|
|
319
|
+
# Valid values are <code>:top</code>, <code>:method</code>,
|
|
320
|
+
# <code>:block</code>, <code>:class</code>, <code>:rescue</code>,
|
|
321
|
+
# <code>:ensure</code>, <code>:eval</code>, <code>:main</code>, and `plain`.
|
|
321
322
|
#
|
|
322
323
|
#
|
|
323
324
|
# locals
|
|
@@ -328,7 +329,7 @@ class RubyVM::InstructionSequence < Object
|
|
|
328
329
|
# params
|
|
329
330
|
# : An Hash object containing parameter information.
|
|
330
331
|
#
|
|
331
|
-
# More info about these values can be found in
|
|
332
|
+
# More info about these values can be found in <code>vm_core.h</code>.
|
|
332
333
|
#
|
|
333
334
|
#
|
|
334
335
|
# catch_table
|
|
@@ -400,15 +401,16 @@ module RubyVM::AbstractSyntaxTree
|
|
|
400
401
|
# RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
|
|
401
402
|
# # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>
|
|
402
403
|
#
|
|
403
|
-
# If
|
|
404
|
-
# is associated with nodes and is available via Node#script_lines.
|
|
404
|
+
# If <code>keep_script_lines: true</code> option is provided, the text of the
|
|
405
|
+
# parsed source is associated with nodes and is available via Node#script_lines.
|
|
405
406
|
#
|
|
406
|
-
# If
|
|
407
|
+
# If <code>keep_tokens: true</code> option is provided, Node#tokens are
|
|
408
|
+
# populated.
|
|
407
409
|
#
|
|
408
410
|
# SyntaxError is raised if the given *string* is invalid syntax. To overwrite
|
|
409
|
-
# this behavior,
|
|
410
|
-
# parser will produce a tree where expressions with syntax errors
|
|
411
|
-
# represented by Node with
|
|
411
|
+
# this behavior, <code>error_tolerant: true</code> can be provided. In this
|
|
412
|
+
# case, the parser will produce a tree where expressions with syntax errors
|
|
413
|
+
# would be represented by Node with <code>type=:ERROR</code>.
|
|
412
414
|
#
|
|
413
415
|
# root = RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2")
|
|
414
416
|
# # <internal:ast>:33:in `parse': syntax error, unexpected ';', expecting ')' (SyntaxError)
|
|
@@ -661,7 +663,7 @@ module RubyVM::YJIT
|
|
|
661
663
|
# -->
|
|
662
664
|
# Marshal dumps exit locations to the given filename.
|
|
663
665
|
# Usage:
|
|
664
|
-
# If
|
|
666
|
+
# If <code>--yjit-exit-locations</code> is passed, a file named
|
|
665
667
|
# "yjit_exit_locations.dump" will automatically be generated.
|
|
666
668
|
# If you want to collect traces manually, call `dump_exit_locations`
|
|
667
669
|
# directly.
|
|
@@ -693,11 +695,11 @@ module RubyVM::YJIT
|
|
|
693
695
|
# * `stats`:
|
|
694
696
|
# * `false`: Don't enable stats.
|
|
695
697
|
# * `true`: Enable stats. Print stats at exit.
|
|
696
|
-
# *
|
|
698
|
+
# * <code>:quiet</code>: Enable stats. Do not print stats at exit.
|
|
697
699
|
# * `log`:
|
|
698
700
|
# * `false`: Don't enable the log.
|
|
699
701
|
# * `true`: Enable the log. Print log at exit.
|
|
700
|
-
# *
|
|
702
|
+
# * <code>:quiet</code>: Enable the log. Do not print log at exit.
|
|
701
703
|
#
|
|
702
704
|
def self.enable: (?stats: false | true | :quiet) -> void
|
|
703
705
|
|
|
@@ -729,7 +731,7 @@ module RubyVM::YJIT
|
|
|
729
731
|
# rdoc-file=yjit.rb
|
|
730
732
|
# - reset_stats!()
|
|
731
733
|
# -->
|
|
732
|
-
# Discard statistics collected for
|
|
734
|
+
# Discard statistics collected for <code>--yjit-stats</code>.
|
|
733
735
|
#
|
|
734
736
|
def self.reset_stats!: () -> void
|
|
735
737
|
|
|
@@ -737,8 +739,8 @@ module RubyVM::YJIT
|
|
|
737
739
|
# rdoc-file=yjit.rb
|
|
738
740
|
# - runtime_stats(key = nil)
|
|
739
741
|
# -->
|
|
740
|
-
# Return a hash for statistics generated for the
|
|
741
|
-
# option.
|
|
742
|
+
# Return a hash for statistics generated for the <code>--yjit-stats</code>
|
|
743
|
+
# command line option.
|
|
742
744
|
# Return `nil` when option is not passed or unavailable.
|
|
743
745
|
# If a symbol argument is provided, return only the value for the named stat.
|
|
744
746
|
# If any other type is provided, raises TypeError.
|
|
@@ -749,7 +751,7 @@ module RubyVM::YJIT
|
|
|
749
751
|
# rdoc-file=yjit.rb
|
|
750
752
|
# - stats_enabled?()
|
|
751
753
|
# -->
|
|
752
|
-
# Check if
|
|
754
|
+
# Check if <code>--yjit-stats</code> is used.
|
|
753
755
|
#
|
|
754
756
|
def self.stats_enabled?: () -> bool
|
|
755
757
|
|
|
@@ -758,7 +760,7 @@ module RubyVM::YJIT
|
|
|
758
760
|
# - stats_string()
|
|
759
761
|
# -->
|
|
760
762
|
# Format and print out counters as a String. This returns a non-empty
|
|
761
|
-
# content only when
|
|
763
|
+
# content only when <code>--yjit-stats</code> is enabled.
|
|
762
764
|
#
|
|
763
765
|
def self.stats_string: () -> String
|
|
764
766
|
end
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
# install: --no-rdoc --no-ri
|
|
11
11
|
# update: --no-rdoc --no-ri
|
|
12
12
|
#
|
|
13
|
-
# You can use
|
|
13
|
+
# You can use <code>gem:</code> to set default arguments for all commands.
|
|
14
14
|
#
|
|
15
15
|
# RubyGems options use symbol keys. Valid options are:
|
|
16
16
|
#
|
|
17
|
-
#
|
|
17
|
+
# <code>:backtrace</code>
|
|
18
18
|
# : See #backtrace
|
|
19
19
|
#
|
|
20
|
-
#
|
|
20
|
+
# <code>:sources</code>
|
|
21
21
|
# : Sets Gem::sources
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# <code>:verbose</code>
|
|
24
24
|
# : See #verbose
|
|
25
25
|
#
|
|
26
|
-
#
|
|
26
|
+
# <code>:concurrent_downloads</code>
|
|
27
27
|
# : See #concurrent_downloads
|
|
28
28
|
#
|
|
29
29
|
#
|
data/core/rubygems/errors.rbs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# For user documentation, see:
|
|
6
6
|
#
|
|
7
|
-
# * `gem help` and
|
|
7
|
+
# * `gem help` and <code>gem help [command]</code>
|
|
8
8
|
# * [RubyGems User Guide](https://guides.rubygems.org/)
|
|
9
9
|
# * [Frequently Asked Questions](https://guides.rubygems.org/faqs)
|
|
10
10
|
#
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
module Gem
|
|
3
3
|
# <!-- rdoc-file=lib/rubygems/requirement.rb -->
|
|
4
4
|
# A Requirement is a set of one or more version restrictions. It supports a few
|
|
5
|
-
# (
|
|
5
|
+
# (<code>=, !=, >, <, >=, <=, ~></code>) different restriction operators.
|
|
6
6
|
#
|
|
7
7
|
# See Gem::Version for a description on how versions and requirements work
|
|
8
8
|
# together in RubyGems.
|
|
@@ -60,11 +60,11 @@ module Gem
|
|
|
60
60
|
# rdoc-file=lib/rubygems/requirement.rb
|
|
61
61
|
# - parse(obj)
|
|
62
62
|
# -->
|
|
63
|
-
# Parse `obj`, returning an
|
|
64
|
-
# Gem::Version.
|
|
63
|
+
# Parse `obj`, returning an <code>[op, version]</code> pair. `obj` can be a
|
|
64
|
+
# String or a Gem::Version.
|
|
65
65
|
#
|
|
66
66
|
# If `obj` is a String, it can be either a full requirement specification, like
|
|
67
|
-
#
|
|
67
|
+
# <code>">= 1.2"</code>, or a simple version number, like <code>"1.2"</code>.
|
|
68
68
|
#
|
|
69
69
|
# parse("> 1.0") # => [">", Gem::Version.new("1.0")]
|
|
70
70
|
# parse("1.0") # => ["=", Gem::Version.new("1.0")]
|
|
@@ -78,7 +78,7 @@ module Gem
|
|
|
78
78
|
# -->
|
|
79
79
|
# Constructs a requirement from `requirements`. Requirements can be Strings,
|
|
80
80
|
# Gem::Versions, or Arrays of those. `nil` and duplicate requirements are
|
|
81
|
-
# ignored. An empty set of `requirements` is the same as
|
|
81
|
+
# ignored. An empty set of `requirements` is the same as <code>">= 0"</code>.
|
|
82
82
|
#
|
|
83
83
|
def initialize: (*String | Gem::Version requirements) -> void
|
|
84
84
|
|
data/core/rubygems/rubygems.rbs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# For user documentation, see:
|
|
6
6
|
#
|
|
7
|
-
# * `gem help` and
|
|
7
|
+
# * `gem help` and <code>gem help [command]</code>
|
|
8
8
|
# * [RubyGems User Guide](https://guides.rubygems.org/)
|
|
9
9
|
# * [Frequently Asked Questions](https://guides.rubygems.org/faqs)
|
|
10
10
|
#
|
|
@@ -152,7 +152,8 @@ module Gem
|
|
|
152
152
|
# - activated_gem_paths()
|
|
153
153
|
# -->
|
|
154
154
|
# The number of paths in the +$LOAD_PATH+ from activated gems. Used to
|
|
155
|
-
# prioritize
|
|
155
|
+
# prioritize <code>-I</code> and <code>ENV['RUBYLIB']</code> entries during
|
|
156
|
+
# `require`.
|
|
156
157
|
#
|
|
157
158
|
def self.activated_gem_paths: () -> Integer
|
|
158
159
|
|
|
@@ -499,7 +500,8 @@ module Gem
|
|
|
499
500
|
# rdoc-file=lib/rubygems.rb
|
|
500
501
|
# - host()
|
|
501
502
|
# -->
|
|
502
|
-
# Get the default RubyGems API host. This is normally
|
|
503
|
+
# Get the default RubyGems API host. This is normally
|
|
504
|
+
# <code>https://rubygems.org</code>.
|
|
503
505
|
#
|
|
504
506
|
def self.host: () -> String
|
|
505
507
|
|
data/core/set.rbs
CHANGED
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
#
|
|
23
23
|
# ## Comparison
|
|
24
24
|
#
|
|
25
|
-
# The comparison operators
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
25
|
+
# The comparison operators <code><</code>, <code>></code>, <code><=</code>, and
|
|
26
|
+
# <code>>=</code> are implemented as shorthand for the
|
|
27
|
+
# {proper_,}{subset?,superset?} methods. The <code><=></code> operator reflects
|
|
28
|
+
# this order, or returns `nil` for sets that both have distinct elements
|
|
29
|
+
# (<code>{x, y}</code> vs. <code>{x, z}</code> for example).
|
|
29
30
|
#
|
|
30
31
|
# ## Example
|
|
31
32
|
#
|
|
@@ -48,9 +49,9 @@
|
|
|
48
49
|
# core methods were adjusted.
|
|
49
50
|
#
|
|
50
51
|
# To keep backward compatibility, when a class is inherited from Set, additional
|
|
51
|
-
# module
|
|
52
|
-
# behavior, as well as internal method names, closer to what it
|
|
53
|
-
# 4.0.
|
|
52
|
+
# module <code>Set::SubclassCompatible</code> is included, which makes the
|
|
53
|
+
# inherited class behavior, as well as internal method names, closer to what it
|
|
54
|
+
# was before Ruby 4.0.
|
|
54
55
|
#
|
|
55
56
|
# It can be easily seen, for example, in the #inspect method behavior:
|
|
56
57
|
#
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
# # prints "#<MySet: {1, 2, 3}>", like it was in Ruby 3.4
|
|
64
65
|
#
|
|
65
66
|
# For new code, if backward compatibility is not necessary, it is recommended to
|
|
66
|
-
# instead inherit from
|
|
67
|
+
# instead inherit from <code>Set::CoreSet</code>, which avoids including the
|
|
67
68
|
# "compatibility" layer:
|
|
68
69
|
#
|
|
69
70
|
# class MyCoreSet < Set::CoreSet
|
|
@@ -340,8 +341,8 @@ class Set[unchecked out A]
|
|
|
340
341
|
# Set[1, 2, 3].include? 2 #=> true
|
|
341
342
|
# Set[1, 2, 3].include? 4 #=> false
|
|
342
343
|
#
|
|
343
|
-
# Note that
|
|
344
|
-
# do other Enumerables.
|
|
344
|
+
# Note that <code>include?</code> and <code>member?</code> do not test member
|
|
345
|
+
# equality using <code>==</code> as do other Enumerables.
|
|
345
346
|
#
|
|
346
347
|
# This is aliased to #===, so it is usable in `case` expressions:
|
|
347
348
|
#
|
|
@@ -355,7 +356,7 @@ class Set[unchecked out A]
|
|
|
355
356
|
#
|
|
356
357
|
# See also Enumerable#include?
|
|
357
358
|
#
|
|
358
|
-
def include?: (
|
|
359
|
+
def include?: (Hash::_Key) -> bool
|
|
359
360
|
|
|
360
361
|
# <!-- rdoc-file=set.c -->
|
|
361
362
|
# Returns true if the set contains the given object:
|
|
@@ -363,8 +364,8 @@ class Set[unchecked out A]
|
|
|
363
364
|
# Set[1, 2, 3].include? 2 #=> true
|
|
364
365
|
# Set[1, 2, 3].include? 4 #=> false
|
|
365
366
|
#
|
|
366
|
-
# Note that
|
|
367
|
-
# do other Enumerables.
|
|
367
|
+
# Note that <code>include?</code> and <code>member?</code> do not test member
|
|
368
|
+
# equality using <code>==</code> as do other Enumerables.
|
|
368
369
|
#
|
|
369
370
|
# This is aliased to #===, so it is usable in `case` expressions:
|
|
370
371
|
#
|
|
@@ -385,8 +386,8 @@ class Set[unchecked out A]
|
|
|
385
386
|
# - set ^ enum -> new_set
|
|
386
387
|
# -->
|
|
387
388
|
# Returns a new set containing elements exclusive between the set and the given
|
|
388
|
-
# enumerable object.
|
|
389
|
-
# enum))
|
|
389
|
+
# enumerable object. <code>(set ^ enum)</code> is equivalent to <code>((set |
|
|
390
|
+
# enum) - (set & enum))</code>.
|
|
390
391
|
#
|
|
391
392
|
# Set[1, 2] ^ Set[2, 3] #=> Set[3, 1]
|
|
392
393
|
# Set[1, 'b', 'c'] ^ ['b', 'd'] #=> Set["d", 1, "c"]
|
|
@@ -500,7 +501,7 @@ class Set[unchecked out A]
|
|
|
500
501
|
# - disjoint?(set) -> true or false
|
|
501
502
|
# -->
|
|
502
503
|
# Returns true if the set and the given enumerable have no element in common.
|
|
503
|
-
# This method is the opposite of
|
|
504
|
+
# This method is the opposite of <code>intersect?</code>.
|
|
504
505
|
#
|
|
505
506
|
# Set[1, 2, 3].disjoint? Set[3, 4] #=> false
|
|
506
507
|
# Set[1, 2, 3].disjoint? Set[4, 5] #=> true
|
data/core/signal.rbs
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
# # ...
|
|
27
27
|
# Process.kill("TERM", pid)
|
|
28
28
|
#
|
|
29
|
-
#
|
|
29
|
+
# <em>produces:</em>
|
|
30
30
|
# Debug now: true
|
|
31
31
|
# Debug now: false
|
|
32
32
|
# Terminating...
|
|
@@ -57,7 +57,7 @@ module Signal
|
|
|
57
57
|
# Signal.trap("INT") { |signo| puts Signal.signame(signo) }
|
|
58
58
|
# Process.kill("INT", 0)
|
|
59
59
|
#
|
|
60
|
-
#
|
|
60
|
+
# <em>produces:</em>
|
|
61
61
|
#
|
|
62
62
|
# INT
|
|
63
63
|
#
|