Skip to content

Commit 5ad0451

Browse files
authored
Merge branch 'master' into collection-install-set-pathname
2 parents 0ade8b0 + c016716 commit 5ad0451

38 files changed

Lines changed: 649 additions & 453 deletions

.github/workflows/bundle-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Ruby
1717
uses: ruby/setup-ruby@v1
1818
with:
19-
ruby-version: '4.0.0-preview3'
19+
ruby-version: '4.0'
2020

2121
- name: Set up git
2222
run: |

.github/workflows/c-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v6
1313
- uses: ruby/setup-ruby@v1
1414
with:
15-
ruby-version: "4.0.0-preview3"
15+
ruby-version: "4.0"
1616
bundler-cache: none
1717
- name: Set working directory as safe
1818
run: git config --global --add safe.directory $(pwd)

.github/workflows/comments.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ on:
1010
jobs:
1111
comments:
1212
runs-on: "ubuntu-latest"
13-
env:
14-
RUBY_COMMIT: v4.0.0-preview3
13+
# env:
14+
# RUBY_COMMIT: v4.0.0-preview2
1515
steps:
1616
- uses: actions/checkout@v6
1717
- uses: ruby/setup-ruby@v1
1818
with:
19-
ruby-version: "4.0.0-preview3"
19+
ruby-version: "4.0.0"
2020
bundler: none
2121
- name: Install dependencies
2222
run: |

.github/workflows/ruby.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
ruby: ['3.2', '3.3', '3.4', '4.0.0-preview3', head]
16+
ruby: ['3.2', '3.3', '3.4', '4.0', head]
1717
rubyopt: [""]
1818
job:
1919
- test
2020
include:
2121
- ruby: head
2222
job: stdlib_test rubocop
23-
- ruby: "4.0.0-preview3"
23+
- ruby: "4.0"
2424
job: stdlib_test
25-
- ruby: "4.0.0-preview3"
25+
- ruby: "4.0"
2626
job: test
2727
rubyopt: "--enable-frozen-string-literal"
28-
- ruby: "4.0.0-preview3"
28+
- ruby: "4.0"
2929
job: stdlib_test
3030
rubyopt: "--enable-frozen-string-literal"
31-
- ruby: "4.0.0-preview3"
31+
- ruby: "4.0"
3232
job: rubocop validate test_doc build test_generate_stdlib raap
33-
- ruby: "4.0.0-preview3"
33+
- ruby: "4.0"
3434
job: typecheck_test
3535
env:
3636
RANDOMIZE_STDLIB_TEST_ORDER: "true"
@@ -74,7 +74,7 @@ jobs:
7474
strategy:
7575
fail-fast: false
7676
matrix:
77-
ruby: ['4.0.0-preview3', head]
77+
ruby: ['4.0', head]
7878
steps:
7979
- uses: actions/checkout@v6
8080
- name: Install dependencies
@@ -100,4 +100,3 @@ jobs:
100100
run: |
101101
bin/setup
102102
- run: bundle exec rake clean compile_c99
103-

Gemfile.lock

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GEM
3333
base64 (0.3.0)
3434
benchmark (0.5.0)
3535
benchmark-ips (2.14.0)
36-
bigdecimal (4.0.0)
36+
bigdecimal (4.0.1)
3737
concurrent-ruby (1.3.6)
3838
connection_pool (3.0.2)
3939
csv (3.3.5)
@@ -43,23 +43,24 @@ GEM
4343
drb (2.2.3)
4444
erb (6.0.1)
4545
extconf_compile_commands_json (0.0.7)
46-
ffi (1.17.2)
46+
ffi (1.17.3)
4747
fileutils (1.8.0)
4848
goodcheck (3.1.0)
4949
marcel (>= 1.0, < 2.0)
5050
psych (>= 3.1, < 5.0)
5151
rainbow (>= 3.0, < 4.0)
5252
strong_json (>= 1.1, < 2.2)
53-
i18n (1.14.7)
53+
i18n (1.14.8)
5454
concurrent-ruby (~> 1.0)
5555
io-console (0.8.2)
56-
irb (1.15.3)
56+
irb (1.16.0)
5757
pp (>= 0.6.0)
5858
rdoc (>= 4.0.0)
5959
reline (>= 0.4.2)
6060
json (2.18.0)
61-
json-schema (5.1.0)
61+
json-schema (6.1.0)
6262
addressable (~> 2.8)
63+
bigdecimal (>= 3.1, < 5)
6364
language_server-protocol (3.17.0.5)
6465
lint_roller (1.1.0)
6566
listen (3.9.0)
@@ -69,7 +70,7 @@ GEM
6970
marcel (1.1.0)
7071
memory_profiler (1.1.0)
7172
mini_portile2 (2.8.9)
72-
minitest (6.0.0)
73+
minitest (6.0.1)
7374
prism (~> 1.5)
7475
minitest-mock (5.27.0)
7576
mutex_m (0.3.0)
@@ -78,7 +79,7 @@ GEM
7879
net-smtp (0.5.1)
7980
net-protocol
8081
nkf (0.2.0)
81-
nokogiri (1.18.10)
82+
nokogiri (1.19.0)
8283
mini_portile2 (~> 2.8.2)
8384
racc (~> 1.4)
8485
ostruct (0.6.3)
@@ -90,11 +91,11 @@ GEM
9091
pp (0.6.3)
9192
prettyprint
9293
prettyprint (0.2.0)
93-
prism (1.6.0)
94+
prism (1.7.0)
9495
pstore (0.2.0)
9596
psych (4.0.6)
9697
stringio
97-
public_suffix (7.0.0)
98+
public_suffix (7.0.2)
9899
raap (1.3.0)
99100
rbs (~> 3.9.0)
100101
timeout (~> 0.4)
@@ -106,7 +107,7 @@ GEM
106107
rb-fsevent (0.11.2)
107108
rb-inotify (0.11.1)
108109
ffi (~> 1.0)
109-
rdoc (7.0.1)
110+
rdoc (7.0.3)
110111
erb
111112
psych (>= 4.0.0)
112113
tsort
@@ -126,20 +127,20 @@ GEM
126127
diff-lcs (>= 1.2.0, < 2.0)
127128
rspec-support (~> 3.13.0)
128129
rspec-support (3.13.6)
129-
rubocop (1.81.7)
130+
rubocop (1.82.1)
130131
json (~> 2.3)
131132
language_server-protocol (~> 3.17.0.2)
132133
lint_roller (~> 1.1.0)
133134
parallel (~> 1.10)
134135
parser (>= 3.3.0.2)
135136
rainbow (>= 2.2.2, < 4.0)
136137
regexp_parser (>= 2.9.3, < 3.0)
137-
rubocop-ast (>= 1.47.1, < 2.0)
138+
rubocop-ast (>= 1.48.0, < 2.0)
138139
ruby-progressbar (~> 1.7)
139140
unicode-display_width (>= 2.4.0, < 4.0)
140-
rubocop-ast (1.48.0)
141+
rubocop-ast (1.49.0)
141142
parser (>= 3.3.7.2)
142-
prism (~> 1.4)
143+
prism (~> 1.7)
143144
rubocop-on-rbs (1.8.0)
144145
lint_roller (~> 1.1)
145146
rbs (~> 3.5)
@@ -170,21 +171,21 @@ GEM
170171
strscan (>= 1.0.0)
171172
terminal-table (>= 2, < 5)
172173
uri (>= 0.12.0)
173-
stringio (3.1.9)
174+
stringio (3.2.0)
174175
strong_json (2.1.2)
175-
strscan (3.1.5)
176+
strscan (3.1.6)
176177
tempfile (0.3.1)
177178
terminal-table (4.0.0)
178179
unicode-display_width (>= 1.1.1, < 4)
179-
test-unit (3.7.3)
180+
test-unit (3.7.7)
180181
power_assert
181-
timeout (0.5.0)
182+
timeout (0.6.0)
182183
tsort (0.2.0)
183184
tzinfo (2.0.6)
184185
concurrent-ruby (~> 1.0)
185186
unicode-display_width (3.2.0)
186187
unicode-emoji (~> 4.1)
187-
unicode-emoji (4.1.0)
188+
unicode-emoji (4.2.0)
188189
uri (1.1.1)
189190
zlib (3.2.2)
190191

bin/generate_docs.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
set -ex
44

55
if [ -z ${RUBY_COMMIT} ]; then
6-
RUBY_COMMIT=v`ruby -e 'puts RUBY_VERSION.gsub(".", "_")'`
6+
RUBY_COMMIT=v`ruby -e '
7+
case
8+
when RUBY_VERSION >= "4.0.0"
9+
puts RUBY_VERSION
10+
else
11+
puts RUBY_VERSION.gsub(".", "_")
12+
end
13+
'`
714
fi
815

916
if [ -z ${RBS_RDOC_BASE_DIR} ]; then

core/array.rbs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,14 +2029,12 @@ class Array[unchecked out Elem] < Object
20292029
# With a block given, calls the block with successive elements of the array;
20302030
# returns the first element for which the block returns a truthy value:
20312031
#
2032-
# (0..9).find {|element| element > 2} # => 3
2032+
# [1, 3, 5].find {|element| element > 2} # => 3
20332033
#
20342034
# If no such element is found, calls `if_none_proc` and returns its return
20352035
# value.
20362036
#
2037-
# (0..9).find(proc {false}) {|element| element > 12} # => false
2038-
# {foo: 0, bar: 1, baz: 2}.find {|key, value| key.start_with?('b') } # => [:bar, 1]
2039-
# {foo: 0, bar: 1, baz: 2}.find(proc {[]}) {|key, value| key.start_with?('c') } # => []
2037+
# [1, 3, 5].find(proc {-1}) {|element| element > 12} # => -1
20402038
#
20412039
# With no block given, returns an Enumerator.
20422040
#
@@ -3022,17 +3020,15 @@ class Array[unchecked out Elem] < Object
30223020
# Returns the last element for which the block returns a truthy value.
30233021
#
30243022
# With a block given, calls the block with successive elements of the array in
3025-
# reverse order; returns the last element for which the block returns a truthy
3023+
# reverse order; returns the first element for which the block returns a truthy
30263024
# value:
30273025
#
3028-
# (0..9).rfind {|element| element < 5} # => 4
3026+
# [1, 2, 3, 4, 5, 6].rfind {|element| element < 5} # => 4
30293027
#
30303028
# If no such element is found, calls `if_none_proc` and returns its return
30313029
# value.
30323030
#
3033-
# (0..9).rfind(proc {false}) {|element| element < -2} # => false
3034-
# {foo: 0, bar: 1, baz: 2}.rfind {|key, value| key.start_with?('b') } # => [:baz, 2]
3035-
# {foo: 0, bar: 1, baz: 2}.rfind(proc {[]}) {|key, value| key.start_with?('c') } # => []
3031+
# [1, 2, 3, 4].rfind(proc {0}) {|element| element < -2} # => 0
30363032
#
30373033
# With no block given, returns an Enumerator.
30383034
#

core/comparable.rbs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,26 @@
5555
module Comparable : _WithSpaceshipOperator
5656
# <!--
5757
# rdoc-file=compar.c
58-
# - obj < other -> true or false
58+
# - self < other -> true or false
5959
# -->
60-
# Compares two objects based on the receiver's `<=>` method, returning true if
61-
# it returns a value less than 0.
60+
# Returns whether `self` is "less than" `other`; equivalent to `(self <=> other)
61+
# < 0`:
62+
#
63+
# 'foo' < 'foo' # => false
64+
# 'foo' < 'food' # => true
6265
#
6366
def <: (untyped other) -> bool
6467

6568
# <!--
6669
# rdoc-file=compar.c
67-
# - obj <= other -> true or false
70+
# - self <= other -> true or false
6871
# -->
69-
# Compares two objects based on the receiver's `<=>` method, returning true if
70-
# it returns a value less than or equal to 0.
72+
# Returns whether `self` is "less than or equal to" `other`; equivalent to
73+
# `(self <=> other) <= 0`:
74+
#
75+
# 'foo' <= 'foo' # => true
76+
# 'foo' <= 'food' # => true
77+
# 'food' <= 'foo' # => false
7178
#
7279
def <=: (untyped other) -> bool
7380

core/complex.rbs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,16 @@ class Complex < Numeric
277277

278278
# <!--
279279
# rdoc-file=complex.c
280-
# - complex <=> object -> -1, 0, 1, or nil
280+
# - self <=> other -> -1, 0, 1, or nil
281281
# -->
282+
# Compares `self` and `other`.
283+
#
282284
# Returns:
283285
#
284-
# * `self.real <=> object.real` if both of the following are true:
286+
# * `self.real <=> other.real` if both of the following are true:
285287
#
286288
# * `self.imag == 0`.
287-
# * `object.imag == 0`. # Always true if object is numeric but not
288-
# complex.
289+
# * `other.imag == 0` (always true if `other` is numeric but not complex).
289290
#
290291
# * `nil` otherwise.
291292
#
@@ -298,6 +299,9 @@ class Complex < Numeric
298299
# Complex.rect(1) <=> Complex.rect(1, 1) # => nil # object.imag not zero.
299300
# Complex.rect(1) <=> 'Foo' # => nil # object.imag not defined.
300301
#
302+
# Class Complex includes module Comparable, each of whose methods uses
303+
# Complex#<=> for comparison.
304+
#
301305
def <=>: (untyped) -> Integer?
302306

303307
# <!--

core/dir.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class Dir
171171
# system's encoding is used:
172172
#
173173
# Dir.new('.').read.encoding # => #<Encoding:UTF-8>
174-
# Dir.new('.', encoding: 'US-ASCII').read.encoding # => #<Encoding:US-ASCII>
174+
# Dir.new('.', encoding: Encoding::US_ASCI).read.encoding # => #<Encoding:US-ASCII>
175175
#
176176
def initialize: (path dir, ?encoding: encoding?) -> void
177177

@@ -704,7 +704,7 @@ class Dir
704704
# system's encoding is used:
705705
#
706706
# Dir.open('.').read.encoding # => #<Encoding:UTF-8>
707-
# Dir.open('.', encoding: 'US-ASCII').read.encoding # => #<Encoding:US-ASCII>
707+
# Dir.open('.', encoding: Encoding::US_ASCII).read.encoding # => #<Encoding:US-ASCII>
708708
#
709709
def self.open: (path dirname, ?encoding: encoding?) -> instance
710710
| [U] (path dirname, ?encoding: encoding?) { (instance) -> U } -> U

0 commit comments

Comments
 (0)