rbs 3.8.0.pre.1 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +1 -1
- data/CHANGELOG.md +16 -0
- data/core/array.rbs +64 -62
- data/core/complex.rbs +1 -1
- data/core/encoding.rbs +0 -26
- data/core/errors.rbs +4 -0
- data/core/exception.rbs +2 -2
- data/core/file.rbs +1 -8
- data/core/gc.rbs +20 -2
- data/core/hash.rbs +2 -2
- data/core/io.rbs +2 -2
- data/core/kernel.rbs +2 -2
- data/core/nil_class.rbs +3 -0
- data/core/numeric.rbs +1 -1
- data/core/proc.rbs +80 -10
- data/core/ractor.rbs +17 -0
- data/core/regexp.rbs +2 -2
- data/core/ruby_vm.rbs +1 -1
- data/core/rubygems/errors.rbs +3 -1
- data/core/rubygems/rubygems.rbs +3 -1
- data/core/string.rbs +132 -130
- data/core/time.rbs +4 -0
- data/core/trace_point.rbs +108 -113
- data/ext/rbs_extension/parser.c +1 -1
- data/lib/rbs/types.rb +2 -1
- data/lib/rbs/version.rb +1 -1
- data/stdlib/date/0/date.rbs +23 -23
- data/stdlib/net-http/0/net-http.rbs +20 -29
- data/stdlib/rdoc/0/rdoc.rbs +12 -6
- data/stdlib/resolv/0/resolv.rbs +5 -1
- data/stdlib/securerandom/0/securerandom.rbs +7 -0
- data/stdlib/socket/0/socket.rbs +9 -28
- data/stdlib/socket/0/tcp_socket.rbs +8 -30
- data/stdlib/tmpdir/0/tmpdir.rbs +2 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b91cbfc2b983ede8389074430b54b2db70d1afee9c54c92cf8bc875568b7cf8
|
4
|
+
data.tar.gz: b0306b614ba8d61f78c78e91340615ee5a5b196d562eaac580c5f2fe66a29927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e9e035fccfc91fcdf4f37812e56c52d8dd9c4fd19211ad8c3ae1e9ddeda0c4deb3178b5b45e27863e93ebe415605bc83fd6d74ff2e13fc1ff266c82ab74059
|
7
|
+
data.tar.gz: 6e65f935e8e51b9542cfd8b2aab6a367949be17742764dbe0a65532e3a87f9fc1f1ce829eb67783bc7f7c711f8039b59a3e66ef24aeecb698def729908f96139
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 3.8.0 (2024-12-24)
|
4
|
+
|
5
|
+
### Signature updates
|
6
|
+
|
7
|
+
* `Dir.mktmpdir` ([#2158](https://github.com/ruby/rbs/pull/2158))
|
8
|
+
* `File.join` ([#2158](https://github.com/ruby/rbs/pull/2158))
|
9
|
+
* `IO#each_line` ([#2151](https://github.com/ruby/rbs/pull/2151))
|
10
|
+
* `Kernel#readlines` ([#2151](https://github.com/ruby/rbs/pull/2151))
|
11
|
+
* `Ractor.store_if_absent` ([#2198](https://github.com/ruby/rbs/pull/2198))
|
12
|
+
* Update docs as of 2024-12-24, 16:13 JST ([#2193](https://github.com/ruby/rbs/pull/2193))
|
13
|
+
|
14
|
+
### Library changes
|
15
|
+
|
16
|
+
* Adjust capacity of location children ([#2197](https://github.com/ruby/rbs/pull/2197))
|
17
|
+
* Should validate self-type on Proc ([#2192](https://github.com/ruby/rbs/pull/2192))
|
18
|
+
|
3
19
|
## 3.8.0.pre.1 (2024-12-19)
|
4
20
|
|
5
21
|
### Signature updates
|
data/core/array.rbs
CHANGED
@@ -70,18 +70,20 @@
|
|
70
70
|
#
|
71
71
|
# You can create an Array object explicitly with:
|
72
72
|
#
|
73
|
-
# * An [array literal](rdoc-ref:literals.rdoc@Array+Literals):
|
73
|
+
# * An [array literal](rdoc-ref:syntax/literals.rdoc@Array+Literals):
|
74
74
|
#
|
75
75
|
# [1, 'one', :one, [2, 'two', :two]]
|
76
76
|
#
|
77
|
-
# * A [%w or %W
|
78
|
-
# Literal](rdoc-ref:literals.rdoc@25w+and+-25W-3A+String-Array+
|
77
|
+
# * A [%w or %W string-array
|
78
|
+
# Literal](rdoc-ref:syntax/literals.rdoc@25w+and+-25W-3A+String-Array+Litera
|
79
|
+
# ls):
|
79
80
|
#
|
80
81
|
# %w[foo bar baz] # => ["foo", "bar", "baz"]
|
81
82
|
# %w[1 % *] # => ["1", "%", "*"]
|
82
83
|
#
|
83
|
-
# * A [%i
|
84
|
-
# Literal](rdoc-ref:literals.rdoc@25i+and+-25I-3A+Symbol-Array+
|
84
|
+
# * A [%i or %I symbol-array
|
85
|
+
# Literal](rdoc-ref:syntax/literals.rdoc@25i+and+-25I-3A+Symbol-Array+Litera
|
86
|
+
# ls):
|
85
87
|
#
|
86
88
|
# %i[foo bar baz] # => [:foo, :bar, :baz]
|
87
89
|
# %i[1 % *] # => [:"1", :%, :*]
|
@@ -677,7 +679,7 @@ class Array[unchecked out Elem] < Object
|
|
677
679
|
# When string argument `string_separator` is given, equivalent to
|
678
680
|
# `self.join(string_separator)`:
|
679
681
|
#
|
680
|
-
# [0, [0, 1], {foo: 0}] * ', ' # => "0, 0, 1, {:
|
682
|
+
# [0, [0, 1], {foo: 0}] * ', ' # => "0, 0, 1, {foo: 0}"
|
681
683
|
#
|
682
684
|
def *: (string str) -> ::String
|
683
685
|
| (int int) -> ::Array[Elem]
|
@@ -1293,13 +1295,13 @@ class Array[unchecked out Elem] < Object
|
|
1293
1295
|
|
1294
1296
|
# <!--
|
1295
1297
|
# rdoc-file=array.c
|
1296
|
-
# - combination(
|
1297
|
-
# - combination(
|
1298
|
+
# - combination(count) {|element| ... } -> self
|
1299
|
+
# - combination(count) -> new_enumerator
|
1298
1300
|
# -->
|
1299
1301
|
# When a block and a positive [integer-convertible
|
1300
1302
|
# object](rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects)
|
1301
|
-
# argument `
|
1302
|
-
#
|
1303
|
+
# argument `count` (`0 < count <= self.size`) are given, calls the block with
|
1304
|
+
# each combination of `self` of size `count`; returns `self`:
|
1303
1305
|
#
|
1304
1306
|
# a = %w[a b c] # => ["a", "b", "c"]
|
1305
1307
|
# a.combination(2) {|combination| p combination } # => ["a", "b", "c"]
|
@@ -1312,7 +1314,7 @@ class Array[unchecked out Elem] < Object
|
|
1312
1314
|
#
|
1313
1315
|
# The order of the yielded combinations is not guaranteed.
|
1314
1316
|
#
|
1315
|
-
# When `
|
1317
|
+
# When `count` is zero, calls the block once with a new empty array:
|
1316
1318
|
#
|
1317
1319
|
# a.combination(0) {|combination| p combination }
|
1318
1320
|
# [].combination(0) {|combination| p combination }
|
@@ -1322,8 +1324,8 @@ class Array[unchecked out Elem] < Object
|
|
1322
1324
|
# []
|
1323
1325
|
# []
|
1324
1326
|
#
|
1325
|
-
# When `
|
1326
|
-
# not call the block:
|
1327
|
+
# When `count` is negative or larger than `self.size` and `self` is non-empty,
|
1328
|
+
# does not call the block:
|
1327
1329
|
#
|
1328
1330
|
# a.combination(-1) {|combination| fail 'Cannot happen' } # => ["a", "b", "c"]
|
1329
1331
|
# a.combination(4) {|combination| fail 'Cannot happen' } # => ["a", "b", "c"]
|
@@ -1583,10 +1585,10 @@ class Array[unchecked out Elem] < Object
|
|
1583
1585
|
|
1584
1586
|
# <!--
|
1585
1587
|
# rdoc-file=array.c
|
1586
|
-
# - drop(
|
1588
|
+
# - drop(count) -> new_array
|
1587
1589
|
# -->
|
1588
|
-
# Returns a new array containing all but the first `
|
1589
|
-
# `
|
1590
|
+
# Returns a new array containing all but the first `count` element of `self`,
|
1591
|
+
# where `count` is a non-negative integer; does not modify `self`.
|
1590
1592
|
#
|
1591
1593
|
# Examples:
|
1592
1594
|
#
|
@@ -1766,34 +1768,34 @@ class Array[unchecked out Elem] < Object
|
|
1766
1768
|
# <!--
|
1767
1769
|
# rdoc-file=array.rb
|
1768
1770
|
# - fetch_values(*indexes) -> new_array
|
1769
|
-
# - fetch_values(*indexes) {|index| ... } -> new_array
|
1771
|
+
# - fetch_values(*indexes) { |index| ... } -> new_array
|
1770
1772
|
# -->
|
1771
1773
|
# With no block given, returns a new array containing the elements of `self` at
|
1772
|
-
# the offsets
|
1774
|
+
# the offsets specified by `indexes`. Each of the `indexes` must be an
|
1773
1775
|
# [integer-convertible
|
1774
1776
|
# object](rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects):
|
1775
1777
|
#
|
1776
1778
|
# a = [:foo, :bar, :baz]
|
1777
|
-
# a.fetch_values(
|
1778
|
-
# a.fetch_values(
|
1779
|
+
# a.fetch_values(2, 0) # => [:baz, :foo]
|
1780
|
+
# a.fetch_values(2.1, 0) # => [:baz, :foo]
|
1779
1781
|
# a.fetch_values # => []
|
1780
1782
|
#
|
1781
1783
|
# For a negative index, counts backwards from the end of the array:
|
1782
1784
|
#
|
1783
|
-
# a.fetch_values(
|
1785
|
+
# a.fetch_values(-2, -1) # [:bar, :baz]
|
1784
1786
|
#
|
1785
1787
|
# When no block is given, raises an exception if any index is out of range.
|
1786
1788
|
#
|
1787
1789
|
# With a block given, for each index:
|
1788
1790
|
#
|
1789
|
-
# * If the index
|
1790
|
-
# * Otherwise calls
|
1791
|
+
# * If the index is in range, uses an element of `self` (as above).
|
1792
|
+
# * Otherwise, calls the block with the index and uses the block's return
|
1791
1793
|
# value.
|
1792
1794
|
#
|
1793
1795
|
# Example:
|
1794
1796
|
#
|
1795
1797
|
# a = [:foo, :bar, :baz]
|
1796
|
-
# a.fetch_values(1, 0, 42, 777) {|index| index.to_s}
|
1798
|
+
# a.fetch_values(1, 0, 42, 777) { |index| index.to_s }
|
1797
1799
|
# # => [:bar, :foo, "42", "777"]
|
1798
1800
|
#
|
1799
1801
|
# Related: see [Methods for Fetching](rdoc-ref:Array@Methods+for+Fetching).
|
@@ -2070,7 +2072,7 @@ class Array[unchecked out Elem] < Object
|
|
2070
2072
|
#
|
2071
2073
|
# [].first # => nil
|
2072
2074
|
#
|
2073
|
-
# With non-negative integer argument `count` given, returns the first `count`
|
2075
|
+
# With a non-negative integer argument `count` given, returns the first `count`
|
2074
2076
|
# elements (as available) in a new array:
|
2075
2077
|
#
|
2076
2078
|
# a.first(0) # => []
|
@@ -2348,7 +2350,7 @@ class Array[unchecked out Elem] < Object
|
|
2348
2350
|
# <!--
|
2349
2351
|
# rdoc-file=array.rb
|
2350
2352
|
# - last -> last_object or nil
|
2351
|
-
# - last(
|
2353
|
+
# - last(count) -> new_array
|
2352
2354
|
# -->
|
2353
2355
|
# Returns elements from `self`, or `nil`; `self` is not modified.
|
2354
2356
|
#
|
@@ -2359,8 +2361,8 @@ class Array[unchecked out Elem] < Object
|
|
2359
2361
|
# a # => [:foo, "bar", 2]
|
2360
2362
|
# [].last # => nil
|
2361
2363
|
#
|
2362
|
-
# With non-negative integer argument `
|
2363
|
-
# containing the trailing `
|
2364
|
+
# With non-negative integer argument `count` given, returns a new array
|
2365
|
+
# containing the trailing `count` elements of `self`, as available:
|
2364
2366
|
#
|
2365
2367
|
# a = [:foo, 'bar', 2]
|
2366
2368
|
# a.last(2) # => ["bar", 2]
|
@@ -2419,9 +2421,9 @@ class Array[unchecked out Elem] < Object
|
|
2419
2421
|
# <!--
|
2420
2422
|
# rdoc-file=array.c
|
2421
2423
|
# - max -> element
|
2422
|
-
# - max(
|
2424
|
+
# - max(count) -> new_array
|
2423
2425
|
# - max {|a, b| ... } -> element
|
2424
|
-
# - max(
|
2426
|
+
# - max(count) {|a, b| ... } -> new_array
|
2425
2427
|
# -->
|
2426
2428
|
# Returns one of the following:
|
2427
2429
|
#
|
@@ -2438,8 +2440,8 @@ class Array[unchecked out Elem] < Object
|
|
2438
2440
|
#
|
2439
2441
|
# [1, 0, 3, 2].max # => 3
|
2440
2442
|
#
|
2441
|
-
# With non-negative numeric argument `
|
2442
|
-
# at most `
|
2443
|
+
# With non-negative numeric argument `count` and no block, returns a new array
|
2444
|
+
# with at most `count` elements, in descending order, per method `#<=>`:
|
2443
2445
|
#
|
2444
2446
|
# [1, 0, 3, 2].max(3) # => [3, 2, 1]
|
2445
2447
|
# [1, 0, 3, 2].max(3.0) # => [3, 2, 1]
|
@@ -2454,8 +2456,8 @@ class Array[unchecked out Elem] < Object
|
|
2454
2456
|
# ['0', '', '000', '00'].max {|a, b| a.size <=> b.size }
|
2455
2457
|
# # => "000"
|
2456
2458
|
#
|
2457
|
-
# With non-negative numeric argument `
|
2458
|
-
# at most `
|
2459
|
+
# With non-negative numeric argument `count` and a block, returns a new array
|
2460
|
+
# with at most `count` elements, in descending order, per the block:
|
2459
2461
|
#
|
2460
2462
|
# ['0', '', '000', '00'].max(2) {|a, b| a.size <=> b.size }
|
2461
2463
|
# # => ["000", "00"]
|
@@ -2470,9 +2472,9 @@ class Array[unchecked out Elem] < Object
|
|
2470
2472
|
# <!--
|
2471
2473
|
# rdoc-file=array.c
|
2472
2474
|
# - min -> element
|
2473
|
-
# - min(
|
2475
|
+
# - min(count) -> new_array
|
2474
2476
|
# - min {|a, b| ... } -> element
|
2475
|
-
# - min(
|
2477
|
+
# - min(count) {|a, b| ... } -> new_array
|
2476
2478
|
# -->
|
2477
2479
|
# Returns one of the following:
|
2478
2480
|
#
|
@@ -2489,8 +2491,8 @@ class Array[unchecked out Elem] < Object
|
|
2489
2491
|
#
|
2490
2492
|
# [1, 0, 3, 2].min # => 0
|
2491
2493
|
#
|
2492
|
-
# With non-negative numeric argument `
|
2493
|
-
# at most `
|
2494
|
+
# With non-negative numeric argument `count` and no block, returns a new array
|
2495
|
+
# with at most `count` elements, in ascending order, per method `#<=>`:
|
2494
2496
|
#
|
2495
2497
|
# [1, 0, 3, 2].min(3) # => [0, 1, 2]
|
2496
2498
|
# [1, 0, 3, 2].min(3.0) # => [0, 1, 2]
|
@@ -2505,8 +2507,8 @@ class Array[unchecked out Elem] < Object
|
|
2505
2507
|
# ['0', '', '000', '00'].min {|a, b| a.size <=> b.size }
|
2506
2508
|
# # => ""
|
2507
2509
|
#
|
2508
|
-
# With non-negative numeric argument `
|
2509
|
-
# at most `
|
2510
|
+
# With non-negative numeric argument `count` and a block, returns a new array
|
2511
|
+
# with at most `count` elements, in ascending order, per the block:
|
2510
2512
|
#
|
2511
2513
|
# ['0', '', '000', '00'].min(2) {|a, b| a.size <=> b.size }
|
2512
2514
|
# # => ["", "0"]
|
@@ -2623,15 +2625,15 @@ class Array[unchecked out Elem] < Object
|
|
2623
2625
|
|
2624
2626
|
# <!--
|
2625
2627
|
# rdoc-file=array.c
|
2626
|
-
# - permutation(
|
2627
|
-
# - permutation(
|
2628
|
+
# - permutation(count = self.size) {|permutation| ... } -> self
|
2629
|
+
# - permutation(count = self.size) -> new_enumerator
|
2628
2630
|
# -->
|
2629
2631
|
# Iterates over permutations of the elements of `self`; the order of
|
2630
2632
|
# permutations is indeterminate.
|
2631
2633
|
#
|
2632
|
-
# With a block and an in-range positive integer argument `
|
2633
|
-
# self.size`) given, calls the block with each
|
2634
|
-
# returns `self`:
|
2634
|
+
# With a block and an in-range positive integer argument `count` (`0 < count <=
|
2635
|
+
# self.size`) given, calls the block with each permutation of `self` of size
|
2636
|
+
# `count`; returns `self`:
|
2635
2637
|
#
|
2636
2638
|
# a = [0, 1, 2]
|
2637
2639
|
# perms = []
|
@@ -2646,14 +2648,14 @@ class Array[unchecked out Elem] < Object
|
|
2646
2648
|
# a.permutation(3) {|perm| perms.push(perm) }
|
2647
2649
|
# perms # => [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
|
2648
2650
|
#
|
2649
|
-
# When `
|
2651
|
+
# When `count` is zero, calls the block once with a new empty array:
|
2650
2652
|
#
|
2651
2653
|
# perms = []
|
2652
2654
|
# a.permutation(0) {|perm| perms.push(perm) }
|
2653
2655
|
# perms # => [[]]
|
2654
2656
|
#
|
2655
|
-
# When `
|
2656
|
-
# the block:
|
2657
|
+
# When `count` is out of range (negative or larger than `self.size`), does not
|
2658
|
+
# call the block:
|
2657
2659
|
#
|
2658
2660
|
# a.permutation(-1) {|permutation| fail 'Cannot happen' }
|
2659
2661
|
# a.permutation(4) {|permutation| fail 'Cannot happen' }
|
@@ -3092,7 +3094,7 @@ class Array[unchecked out Elem] < Object
|
|
3092
3094
|
# - sample(random: Random) -> object
|
3093
3095
|
# - sample(count, random: Random) -> new_ary
|
3094
3096
|
# -->
|
3095
|
-
# Returns random elements from `self`, as selected by the object given by
|
3097
|
+
# Returns random elements from `self`, as selected by the object given by the
|
3096
3098
|
# keyword argument `random`.
|
3097
3099
|
#
|
3098
3100
|
# With no argument `count` given, returns one random element from `self`:
|
@@ -3105,7 +3107,7 @@ class Array[unchecked out Elem] < Object
|
|
3105
3107
|
#
|
3106
3108
|
# [].sample # => nil
|
3107
3109
|
#
|
3108
|
-
# With non-negative numeric argument `count` given, returns a new array
|
3110
|
+
# With a non-negative numeric argument `count` given, returns a new array
|
3109
3111
|
# containing `count` random elements from `self`:
|
3110
3112
|
#
|
3111
3113
|
# a.sample(3) # => [8, 9, 2]
|
@@ -3127,12 +3129,12 @@ class Array[unchecked out Elem] < Object
|
|
3127
3129
|
#
|
3128
3130
|
# a.sample(50) # => [6, 4, 1, 8, 5, 9, 0, 2, 3, 7]
|
3129
3131
|
#
|
3130
|
-
# The object given with keyword argument `random` is used as the random
|
3131
|
-
# generator:
|
3132
|
+
# The object given with the keyword argument `random` is used as the random
|
3133
|
+
# number generator:
|
3132
3134
|
#
|
3133
3135
|
# a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
3134
|
-
# a.sample(random: Random.new(1))
|
3135
|
-
# a.sample(4, random: Random.new(1))
|
3136
|
+
# a.sample(random: Random.new(1)) # => 6
|
3137
|
+
# a.sample(4, random: Random.new(1)) # => [6, 10, 9, 2]
|
3136
3138
|
#
|
3137
3139
|
# Related: see [Methods for Fetching](rdoc-ref:Array@Methods+for+Fetching).
|
3138
3140
|
#
|
@@ -3229,7 +3231,7 @@ class Array[unchecked out Elem] < Object
|
|
3229
3231
|
# - shuffle(random: Random) -> new_array
|
3230
3232
|
# -->
|
3231
3233
|
# Returns a new array containing all elements from `self` in a random order, as
|
3232
|
-
# selected by the object given by keyword argument `random`:
|
3234
|
+
# selected by the object given by the keyword argument `random`:
|
3233
3235
|
#
|
3234
3236
|
# a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
3235
3237
|
# a.shuffle # => [0, 8, 1, 9, 6, 3, 4, 7, 2, 5]
|
@@ -3241,8 +3243,8 @@ class Array[unchecked out Elem] < Object
|
|
3241
3243
|
# a.shuffle # => [1, 0, 1, 1, 0, 0, 1, 0, 0, 1]
|
3242
3244
|
# a.shuffle # => [1, 1, 0, 0, 0, 1, 1, 0, 0, 1]
|
3243
3245
|
#
|
3244
|
-
# The object given with keyword argument `random` is used as the random
|
3245
|
-
# generator.
|
3246
|
+
# The object given with the keyword argument `random` is used as the random
|
3247
|
+
# number generator.
|
3246
3248
|
#
|
3247
3249
|
# Related: see [Methods for Fetching](rdoc-ref:Array@Methods+for+Fetching).
|
3248
3250
|
#
|
@@ -3253,20 +3255,20 @@ class Array[unchecked out Elem] < Object
|
|
3253
3255
|
# - shuffle!(random: Random) -> self
|
3254
3256
|
# -->
|
3255
3257
|
# Shuffles all elements in `self` into a random order, as selected by the object
|
3256
|
-
# given by keyword argument `random
|
3258
|
+
# given by the keyword argument `random`. Returns `self`:
|
3257
3259
|
#
|
3258
3260
|
# a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
3259
3261
|
# a.shuffle! # => [5, 3, 8, 7, 6, 1, 9, 4, 2, 0]
|
3260
3262
|
# a.shuffle! # => [9, 4, 0, 6, 2, 8, 1, 5, 3, 7]
|
3261
3263
|
#
|
3262
|
-
#
|
3264
|
+
# Duplicate elements are included:
|
3263
3265
|
#
|
3264
3266
|
# a = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
|
3265
3267
|
# a.shuffle! # => [1, 0, 0, 1, 1, 0, 1, 0, 0, 1]
|
3266
3268
|
# a.shuffle! # => [0, 1, 0, 1, 1, 0, 1, 0, 1, 0]
|
3267
3269
|
#
|
3268
|
-
# The object given with keyword argument `random` is used as the random
|
3269
|
-
# generator.
|
3270
|
+
# The object given with the keyword argument `random` is used as the random
|
3271
|
+
# number generator.
|
3270
3272
|
#
|
3271
3273
|
# Related: see [Methods for Assigning](rdoc-ref:Array@Methods+for+Assigning).
|
3272
3274
|
#
|
@@ -3922,7 +3924,7 @@ class Array[unchecked out Elem] < Object
|
|
3922
3924
|
# <!--
|
3923
3925
|
# rdoc-file=array.c
|
3924
3926
|
# - zip(*other_arrays) -> new_array
|
3925
|
-
# - zip(*other_arrays) {|
|
3927
|
+
# - zip(*other_arrays) {|sub_array| ... } -> nil
|
3926
3928
|
# -->
|
3927
3929
|
# With no block given, combines `self` with the collection of `other_arrays`;
|
3928
3930
|
# returns a new array of sub-arrays:
|
data/core/complex.rbs
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# You can create a Complex object from rectangular coordinates with:
|
13
13
|
#
|
14
|
-
# * A [complex literal](rdoc-ref:
|
14
|
+
# * A [complex literal](rdoc-ref:syntax/literals.rdoc@Complex+Literals).
|
15
15
|
# * Method Complex.rect.
|
16
16
|
# * Method Kernel#Complex, either with numeric arguments or with certain
|
17
17
|
# string arguments.
|
data/core/encoding.rbs
CHANGED
@@ -1302,96 +1302,70 @@ class Encoding::Converter < Object
|
|
1302
1302
|
end
|
1303
1303
|
|
1304
1304
|
# <!-- rdoc-file=transcode.c -->
|
1305
|
-
# AFTER_OUTPUT
|
1306
|
-
#
|
1307
1305
|
# Stop converting after some output is complete but before all of the input was
|
1308
1306
|
# consumed. See primitive_convert for an example.
|
1309
1307
|
#
|
1310
1308
|
Encoding::Converter::AFTER_OUTPUT: Integer
|
1311
1309
|
|
1312
1310
|
# <!-- rdoc-file=transcode.c -->
|
1313
|
-
# CRLF_NEWLINE_DECORATOR
|
1314
|
-
#
|
1315
1311
|
# Decorator for converting LF to CRLF
|
1316
1312
|
#
|
1317
1313
|
Encoding::Converter::CRLF_NEWLINE_DECORATOR: Integer
|
1318
1314
|
|
1319
1315
|
# <!-- rdoc-file=transcode.c -->
|
1320
|
-
# CR_NEWLINE_DECORATOR
|
1321
|
-
#
|
1322
1316
|
# Decorator for converting LF to CR
|
1323
1317
|
#
|
1324
1318
|
Encoding::Converter::CR_NEWLINE_DECORATOR: Integer
|
1325
1319
|
|
1326
1320
|
# <!-- rdoc-file=transcode.c -->
|
1327
|
-
# INVALID_MASK
|
1328
|
-
#
|
1329
1321
|
# Mask for invalid byte sequences
|
1330
1322
|
#
|
1331
1323
|
Encoding::Converter::INVALID_MASK: Integer
|
1332
1324
|
|
1333
1325
|
# <!-- rdoc-file=transcode.c -->
|
1334
|
-
# INVALID_REPLACE
|
1335
|
-
#
|
1336
1326
|
# Replace invalid byte sequences
|
1337
1327
|
#
|
1338
1328
|
Encoding::Converter::INVALID_REPLACE: Integer
|
1339
1329
|
|
1340
1330
|
# <!-- rdoc-file=transcode.c -->
|
1341
|
-
# PARTIAL_INPUT
|
1342
|
-
#
|
1343
1331
|
# Indicates the source may be part of a larger string. See primitive_convert
|
1344
1332
|
# for an example.
|
1345
1333
|
#
|
1346
1334
|
Encoding::Converter::PARTIAL_INPUT: Integer
|
1347
1335
|
|
1348
1336
|
# <!-- rdoc-file=transcode.c -->
|
1349
|
-
# UNDEF_HEX_CHARREF
|
1350
|
-
#
|
1351
1337
|
# Replace byte sequences that are undefined in the destination encoding with an
|
1352
1338
|
# XML hexadecimal character reference. This is valid for XML conversion.
|
1353
1339
|
#
|
1354
1340
|
Encoding::Converter::UNDEF_HEX_CHARREF: Integer
|
1355
1341
|
|
1356
1342
|
# <!-- rdoc-file=transcode.c -->
|
1357
|
-
# UNDEF_MASK
|
1358
|
-
#
|
1359
1343
|
# Mask for a valid character in the source encoding but no related character(s)
|
1360
1344
|
# in destination encoding.
|
1361
1345
|
#
|
1362
1346
|
Encoding::Converter::UNDEF_MASK: Integer
|
1363
1347
|
|
1364
1348
|
# <!-- rdoc-file=transcode.c -->
|
1365
|
-
# UNDEF_REPLACE
|
1366
|
-
#
|
1367
1349
|
# Replace byte sequences that are undefined in the destination encoding.
|
1368
1350
|
#
|
1369
1351
|
Encoding::Converter::UNDEF_REPLACE: Integer
|
1370
1352
|
|
1371
1353
|
# <!-- rdoc-file=transcode.c -->
|
1372
|
-
# UNIVERSAL_NEWLINE_DECORATOR
|
1373
|
-
#
|
1374
1354
|
# Decorator for converting CRLF and CR to LF
|
1375
1355
|
#
|
1376
1356
|
Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR: Integer
|
1377
1357
|
|
1378
1358
|
# <!-- rdoc-file=transcode.c -->
|
1379
|
-
# XML_ATTR_CONTENT_DECORATOR
|
1380
|
-
#
|
1381
1359
|
# Escape as XML AttValue
|
1382
1360
|
#
|
1383
1361
|
Encoding::Converter::XML_ATTR_CONTENT_DECORATOR: Integer
|
1384
1362
|
|
1385
1363
|
# <!-- rdoc-file=transcode.c -->
|
1386
|
-
# XML_ATTR_QUOTE_DECORATOR
|
1387
|
-
#
|
1388
1364
|
# Escape as XML AttValue
|
1389
1365
|
#
|
1390
1366
|
Encoding::Converter::XML_ATTR_QUOTE_DECORATOR: Integer
|
1391
1367
|
|
1392
1368
|
# <!-- rdoc-file=transcode.c -->
|
1393
|
-
# XML_TEXT_DECORATOR
|
1394
|
-
#
|
1395
1369
|
# Escape as XML CharData
|
1396
1370
|
#
|
1397
1371
|
Encoding::Converter::XML_TEXT_DECORATOR: Integer
|
data/core/errors.rbs
CHANGED
@@ -188,6 +188,10 @@ end
|
|
188
188
|
#
|
189
189
|
# LoadError: no such file to load -- this/file/does/not/exist
|
190
190
|
#
|
191
|
+
# <!-- rdoc-file=lib/bundled_gems.rb -->
|
192
|
+
# for RubyGems without Bundler environment. If loading library is not part of
|
193
|
+
# the default gems and the bundled gems, warn it.
|
194
|
+
#
|
191
195
|
class LoadError < ScriptError
|
192
196
|
# <!-- rdoc-file=error.c -->
|
193
197
|
# the path that failed to load
|
data/core/exception.rbs
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
#
|
20
20
|
# * NoMemoryError
|
21
21
|
# * ScriptError
|
22
|
-
# *
|
22
|
+
# * LoadError
|
23
23
|
# * NotImplementedError
|
24
24
|
# * SyntaxError
|
25
25
|
# * SecurityError
|
@@ -51,7 +51,7 @@
|
|
51
51
|
# * ZeroDivisionError
|
52
52
|
# * SystemExit
|
53
53
|
# * SystemStackError
|
54
|
-
# * [fatal](
|
54
|
+
# * [fatal](rdoc-ref:fatal)
|
55
55
|
#
|
56
56
|
class Exception
|
57
57
|
# <!--
|
data/core/file.rbs
CHANGED
@@ -1314,7 +1314,7 @@ class File < IO
|
|
1314
1314
|
#
|
1315
1315
|
# File.join("usr", "mail", "gumby") #=> "usr/mail/gumby"
|
1316
1316
|
#
|
1317
|
-
def self.join: (*
|
1317
|
+
def self.join: (*path) -> String
|
1318
1318
|
|
1319
1319
|
# <!--
|
1320
1320
|
# rdoc-file=file.c
|
@@ -2295,43 +2295,36 @@ File::Constants::DSYNC: Integer
|
|
2295
2295
|
File::Constants::EXCL: Integer
|
2296
2296
|
|
2297
2297
|
# <!-- rdoc-file=dir.c -->
|
2298
|
-
# FNM_CASEFOLD
|
2299
2298
|
# [File::FNM_CASEFOLD](rdoc-ref:File::Constants@File-3A-3AFNM_CASEFOLD)
|
2300
2299
|
#
|
2301
2300
|
File::Constants::FNM_CASEFOLD: Integer
|
2302
2301
|
|
2303
2302
|
# <!-- rdoc-file=dir.c -->
|
2304
|
-
# FNM_DOTMATCH
|
2305
2303
|
# [File::FNM_DOTMATCH](rdoc-ref:File::Constants@File-3A-3AFNM_DOTMATCH)
|
2306
2304
|
#
|
2307
2305
|
File::Constants::FNM_DOTMATCH: Integer
|
2308
2306
|
|
2309
2307
|
# <!-- rdoc-file=dir.c -->
|
2310
|
-
# FNM_EXTGLOB
|
2311
2308
|
# [File::FNM_EXTGLOB](rdoc-ref:File::Constants@File-3A-3AFNM_EXTGLOB)
|
2312
2309
|
#
|
2313
2310
|
File::Constants::FNM_EXTGLOB: Integer
|
2314
2311
|
|
2315
2312
|
# <!-- rdoc-file=dir.c -->
|
2316
|
-
# FNM_NOESCAPE
|
2317
2313
|
# [File::FNM_NOESCAPE](rdoc-ref:File::Constants@File-3A-3AFNM_NOESCAPE)
|
2318
2314
|
#
|
2319
2315
|
File::Constants::FNM_NOESCAPE: Integer
|
2320
2316
|
|
2321
2317
|
# <!-- rdoc-file=dir.c -->
|
2322
|
-
# FNM_PATHNAME
|
2323
2318
|
# [File::FNM_PATHNAME](rdoc-ref:File::Constants@File-3A-3AFNM_PATHNAME)
|
2324
2319
|
#
|
2325
2320
|
File::Constants::FNM_PATHNAME: Integer
|
2326
2321
|
|
2327
2322
|
# <!-- rdoc-file=dir.c -->
|
2328
|
-
# FNM_SHORTNAME
|
2329
2323
|
# [File::FNM_SHORTNAME](rdoc-ref:File::Constants@File-3A-3AFNM_SHORTNAME)
|
2330
2324
|
#
|
2331
2325
|
File::Constants::FNM_SHORTNAME: Integer
|
2332
2326
|
|
2333
2327
|
# <!-- rdoc-file=dir.c -->
|
2334
|
-
# FNM_SYSCASE
|
2335
2328
|
# [File::FNM_SYSCASE](rdoc-ref:File::Constants@File-3A-3AFNM_SYSCASE)
|
2336
2329
|
#
|
2337
2330
|
File::Constants::FNM_SYSCASE: Integer
|
data/core/gc.rbs
CHANGED
@@ -167,7 +167,8 @@ module GC
|
|
167
167
|
# Configuration parameters are GC implementation-specific and may change without
|
168
168
|
# notice.
|
169
169
|
#
|
170
|
-
# This method can be called without parameters to retrieve the current config
|
170
|
+
# This method can be called without parameters to retrieve the current config as
|
171
|
+
# a `Hash` with `Symbol` keys.
|
171
172
|
#
|
172
173
|
# This method can also be called with a `Hash` argument to assign values to
|
173
174
|
# valid config keys. Config keys missing from the passed `Hash` will be left
|
@@ -185,7 +186,24 @@ module GC
|
|
185
186
|
#
|
186
187
|
# This method is only expected to work on CRuby.
|
187
188
|
#
|
188
|
-
#
|
189
|
+
# ### GC Implementation independent values
|
190
|
+
#
|
191
|
+
# The `GC.config` hash can also contain keys that are global and read-only.
|
192
|
+
# These keys are not specific to any one GC library implementation and
|
193
|
+
# attempting to write to them will raise `ArgumentError`.
|
194
|
+
#
|
195
|
+
# There is currently only one global, read-only key:
|
196
|
+
#
|
197
|
+
# implementation
|
198
|
+
# : Returns a `String` containing the name of the currently loaded GC library,
|
199
|
+
# if one has been loaded using `RUBY_GC_LIBRARY`, and "default" in all other
|
200
|
+
# cases
|
201
|
+
#
|
202
|
+
#
|
203
|
+
# ### GC Implementation specific values
|
204
|
+
#
|
205
|
+
# GC libraries are expected to document their own configuration. Valid keys for
|
206
|
+
# Ruby's default GC implementation are:
|
189
207
|
#
|
190
208
|
# rgengc_allow_full_mark
|
191
209
|
# : Controls whether the GC is allowed to run a full mark (young & old
|
data/core/hash.rbs
CHANGED
@@ -1226,7 +1226,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
1226
1226
|
# Returns a new String containing the hash entries:
|
1227
1227
|
#
|
1228
1228
|
# h = {foo: 0, bar: 1, baz: 2}
|
1229
|
-
# h.inspect # => "{:
|
1229
|
+
# h.inspect # => "{foo: 0, bar: 1, baz: 2}"
|
1230
1230
|
#
|
1231
1231
|
def inspect: () -> String
|
1232
1232
|
|
@@ -1628,7 +1628,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
1628
1628
|
# Returns a new String containing the hash entries:
|
1629
1629
|
#
|
1630
1630
|
# h = {foo: 0, bar: 1, baz: 2}
|
1631
|
-
# h.inspect # => "{:
|
1631
|
+
# h.inspect # => "{foo: 0, bar: 1, baz: 2}"
|
1632
1632
|
#
|
1633
1633
|
alias to_s inspect
|
1634
1634
|
|
data/core/io.rbs
CHANGED
@@ -3104,8 +3104,8 @@ class IO < Object
|
|
3104
3104
|
#
|
3105
3105
|
# Returns an Enumerator if no block is given.
|
3106
3106
|
#
|
3107
|
-
def each_line: (?
|
3108
|
-
| (?
|
3107
|
+
def each_line: (?string sep, ?int limit, ?chomp: boolish) { (String line) -> void } -> self
|
3108
|
+
| (?string sep, ?int limit, ?chomp: boolish) -> ::Enumerator[String, self]
|
3109
3109
|
|
3110
3110
|
# <!--
|
3111
3111
|
# rdoc-file=io.c
|
data/core/kernel.rbs
CHANGED
@@ -675,7 +675,7 @@ module Kernel : BasicObject
|
|
675
675
|
#
|
676
676
|
# String([0, 1, 2]) # => "[0, 1, 2]"
|
677
677
|
# String(0..5) # => "0..5"
|
678
|
-
# String({foo: 0, bar: 1}) # => "{:
|
678
|
+
# String({foo: 0, bar: 1}) # => "{foo: 0, bar: 1}"
|
679
679
|
#
|
680
680
|
# Raises `TypeError` if `object` cannot be converted to a string.
|
681
681
|
#
|
@@ -1499,7 +1499,7 @@ module Kernel : BasicObject
|
|
1499
1499
|
# Optional keyword arguments `enc_opts` specify encoding options; see [Encoding
|
1500
1500
|
# options](rdoc-ref:encodings.rdoc@Encoding+Options).
|
1501
1501
|
#
|
1502
|
-
def self?.readlines: (?
|
1502
|
+
def self?.readlines: (?string sep, ?int limit, ?chomp: boolish) -> ::Array[String]
|
1503
1503
|
|
1504
1504
|
# <!--
|
1505
1505
|
# rdoc-file=lib/rubygems/core_ext/kernel_require.rb
|