Skip to content

Commit f4ecb8b

Browse files
authored
Merge pull request #3035 from ruby/claude/rdoc-comments-update-be6d28
Update RDoc comments with Ruby 4.0.6
2 parents 4ca6229 + bd24e79 commit f4ecb8b

19 files changed

Lines changed: 78 additions & 261 deletions

File tree

.github/workflows/comments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v7
1717
- uses: ruby/setup-ruby@v1
1818
with:
19-
ruby-version: "4.0.1"
19+
ruby-version: "4.0.6"
2020
bundler: none
2121
- name: Install dependencies
2222
run: |

Gemfile.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ GEM
6262
diff-lcs (1.6.2)
6363
digest (3.2.1)
6464
drb (2.2.3)
65-
erb (6.0.4)
65+
erb (6.0.6)
6666
extconf_compile_commands_json (0.0.7)
6767
ffi (1.17.4)
6868
fileutils (1.8.0)
@@ -128,9 +128,10 @@ GEM
128128
rb-fsevent (0.11.2)
129129
rb-inotify (0.11.1)
130130
ffi (~> 1.0)
131-
rdoc (7.2.0)
131+
rdoc (8.0.0)
132132
erb
133-
psych (>= 4.0.0)
133+
prism (>= 1.6.0)
134+
rbs (>= 4.0.0)
134135
tsort
135136
regexp_parser (2.12.0)
136137
reline (0.6.3)

core/pathname.rbs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,6 @@ class Pathname
234234
#
235235
def +: (Pathname | String | _ToStr other) -> Pathname
236236

237-
# <!--
238-
# rdoc-file=pathname_builtin.rb
239-
# - /(other)
240-
# -->
241-
#
242237
alias / +
243238

244239
# <!--
@@ -271,11 +266,6 @@ class Pathname
271266
#
272267
def ==: (untyped) -> bool
273268

274-
# <!--
275-
# rdoc-file=pathname_builtin.rb
276-
# - ===(other)
277-
# -->
278-
#
279269
def ===: (untyped) -> bool
280270

281271
# <!--

core/ractor.rbs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,6 @@ class Ractor
470470
#
471471
def self.store_if_absent: [A] (Symbol) { (nil) -> A } -> A
472472

473-
# <!--
474-
# rdoc-file=ractor.rb
475-
# - <<(...)
476-
# -->
477-
#
478473
alias << send
479474

480475
# <!--
@@ -746,11 +741,6 @@ class Ractor
746741
# Port objects transmit messages between Ractors.
747742
#
748743
class Port[T = untyped]
749-
# <!--
750-
# rdoc-file=ractor.rb
751-
# - <<(obj, move: false)
752-
# -->
753-
#
754744
alias << send
755745

756746
# <!--

core/rubygems/errors.rbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Further RubyGems documentation can be found at:
1818
#
1919
# * [RubyGems Guides](https://guides.rubygems.org)
20-
# * [RubyGems API](https://www.rubydoc.info/github/ruby/rubygems) (also
20+
# * [RubyGems API](https://guides.rubygems.org/rubygems-org-api/) (also
2121
# available from `gem server`)
2222
#
2323
# ## RubyGems Plugins
@@ -90,6 +90,9 @@
9090
#
9191
# -The RubyGems Team
9292
#
93+
# <!-- rdoc-file=lib/rubygems/version.rb -->
94+
# Workaround for directly loading Gem::Version in some cases
95+
#
9396
module Gem
9497
# <!-- rdoc-file=lib/rubygems/errors.rb -->
9598
# Raised when RubyGems is unable to load or activate a gem. Contains the name

core/rubygems/requirement.rbs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,8 @@ module Gem
123123
#
124124
def satisfied_by?: (Gem::Version version) -> bool
125125

126-
# <!--
127-
# rdoc-file=lib/rubygems/requirement.rb
128-
# - ===(version)
129-
# -->
130-
#
131126
alias === satisfied_by?
132127

133-
# <!--
134-
# rdoc-file=lib/rubygems/requirement.rb
135-
# - =~(version)
136-
# -->
137-
#
138128
alias =~ satisfied_by?
139129

140130
# <!--

core/rubygems/rubygems.rbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Further RubyGems documentation can be found at:
1818
#
1919
# * [RubyGems Guides](https://guides.rubygems.org)
20-
# * [RubyGems API](https://www.rubydoc.info/github/ruby/rubygems) (also
20+
# * [RubyGems API](https://guides.rubygems.org/rubygems-org-api/) (also
2121
# available from `gem server`)
2222
#
2323
# ## RubyGems Plugins
@@ -90,6 +90,9 @@
9090
#
9191
# -The RubyGems Team
9292
#
93+
# <!-- rdoc-file=lib/rubygems/version.rb -->
94+
# Workaround for directly loading Gem::Version in some cases
95+
#
9396
module Gem
9497
interface _HashLike[K, V]
9598
def each_pair: () { ([ K, V ]) -> untyped } -> self

core/rubygems/specification.rbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@
1919
# #metadata for restrictions on the format and size of metadata items you may
2020
# add to a specification.
2121
#
22+
# Specifications must be deterministic, as in the example above. For instance,
23+
# you cannot define attributes conditionally:
24+
#
25+
# # INVALID: do not do this.
26+
# unless RUBY_ENGINE == "jruby"
27+
# s.extensions << "ext/example/extconf.rb"
28+
# end
29+
#
2230
class Gem::Specification < Gem::BasicSpecification
2331
end

core/rubygems/version.rbs

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,5 @@
11
%a{annotate:rdoc:skip}
22
module Gem
3-
# <!-- rdoc-file=lib/rubygems/version.rb -->
4-
# The Version class processes string versions into comparable values. A version
5-
# string should normally be a series of numbers separated by periods. Each part
6-
# (digits separated by periods) is considered its own number, and these are used
7-
# for sorting. So for instance, 3.10 sorts higher than 3.2 because ten is
8-
# greater than two.
9-
#
10-
# If any part contains letters (currently only a-z are supported) then that
11-
# version is considered prerelease. Versions with a prerelease part in the Nth
12-
# part sort less than versions with N-1 parts. Prerelease parts are sorted
13-
# alphabetically using the normal Ruby string sorting rules. If a prerelease
14-
# part contains both letters and numbers, it will be broken into multiple parts
15-
# to provide expected sort behavior (1.0.a10 becomes 1.0.a.10, and is greater
16-
# than 1.0.a9).
17-
#
18-
# Prereleases sort between real releases (newest to oldest):
19-
#
20-
# 1. 1.0
21-
# 2. 1.0.b1
22-
# 3. 1.0.a.2
23-
# 4. 0.9
24-
#
25-
# If you want to specify a version restriction that includes both prereleases
26-
# and regular releases of the 1.x series this is the best way:
27-
#
28-
# s.add_dependency 'example', '>= 1.0.0.a', '< 2.0.0'
29-
#
30-
# ## How Software Changes
31-
#
32-
# Users expect to be able to specify a version constraint that gives them some
33-
# reasonable expectation that new versions of a library will work with their
34-
# software if the version constraint is true, and not work with their software
35-
# if the version constraint is false. In other words, the perfect system will
36-
# accept all compatible versions of the library and reject all incompatible
37-
# versions.
38-
#
39-
# Libraries change in 3 ways (well, more than 3, but stay focused here!).
40-
#
41-
# 1. The change may be an implementation detail only and have no effect on the
42-
# client software.
43-
# 2. The change may add new features, but do so in a way that client software
44-
# written to an earlier version is still compatible.
45-
# 3. The change may change the public interface of the library in such a way
46-
# that old software is no longer compatible.
47-
#
48-
# Some examples are appropriate at this point. Suppose I have a Stack class
49-
# that supports a `push` and a `pop` method.
50-
#
51-
# ### Examples of Category 1 changes:
52-
#
53-
# * Switch from an array based implementation to a linked-list based
54-
# implementation.
55-
# * Provide an automatic (and transparent) backing store for large stacks.
56-
#
57-
# ### Examples of Category 2 changes might be:
58-
#
59-
# * Add a `depth` method to return the current depth of the stack.
60-
# * Add a `top` method that returns the current top of stack (without changing
61-
# the stack).
62-
# * Change `push` so that it returns the item pushed (previously it had no
63-
# usable return value).
64-
#
65-
# ### Examples of Category 3 changes might be:
66-
#
67-
# * Changes `pop` so that it no longer returns a value (you must use `top` to
68-
# get the top of the stack).
69-
# * Rename the methods to `push_item` and `pop_item`.
70-
#
71-
# ## RubyGems Rational Versioning
72-
#
73-
# * Versions shall be represented by three non-negative integers, separated by
74-
# periods (e.g. 3.1.4). The first integers is the "major" version number,
75-
# the second integer is the "minor" version number, and the third integer is
76-
# the "build" number.
77-
#
78-
# * A category 1 change (implementation detail) will increment the build
79-
# number.
80-
#
81-
# * A category 2 change (backwards compatible) will increment the minor
82-
# version number and reset the build number.
83-
#
84-
# * A category 3 change (incompatible) will increment the major build number
85-
# and reset the minor and build numbers.
86-
#
87-
# * Any "public" release of a gem should have a different version. Normally
88-
# that means incrementing the build number. This means a developer can
89-
# generate builds all day long, but as soon as they make a public release,
90-
# the version must be updated.
91-
#
92-
# ### Examples
93-
#
94-
# Let's work through a project lifecycle using our Stack example from above.
95-
#
96-
# Version 0.0.1
97-
# : The initial Stack class is release.
98-
#
99-
# Version 0.0.2
100-
# : Switched to a linked=list implementation because it is cooler.
101-
#
102-
# Version 0.1.0
103-
# : Added a `depth` method.
104-
#
105-
# Version 1.0.0
106-
# : Added `top` and made `pop` return nil (`pop` used to return the old top
107-
# item).
108-
#
109-
# Version 1.1.0
110-
# : `push` now returns the value pushed (it used it return nil).
111-
#
112-
# Version 1.1.1
113-
# : Fixed a bug in the linked list implementation.
114-
#
115-
# Version 1.1.2
116-
# : Fixed a bug introduced in the last fix.
117-
#
118-
#
119-
# Client A needs a stack with basic push/pop capability. They write to the
120-
# original interface (no `top`), so their version constraint looks like:
121-
#
122-
# gem 'stack', '>= 0.0'
123-
#
124-
# Essentially, any version is OK with Client A. An incompatible change to the
125-
# library will cause them grief, but they are willing to take the chance (we
126-
# call Client A optimistic).
127-
#
128-
# Client B is just like Client A except for two things: (1) They use the `depth`
129-
# method and (2) they are worried about future incompatibilities, so they write
130-
# their version constraint like this:
131-
#
132-
# gem 'stack', '~> 0.1'
133-
#
134-
# The `depth` method was introduced in version 0.1.0, so that version or
135-
# anything later is fine, as long as the version stays below version 1.0 where
136-
# incompatibilities are introduced. We call Client B pessimistic because they
137-
# are worried about incompatible future changes (it is OK to be pessimistic!).
138-
#
139-
# ## Preventing Version Catastrophe:
140-
#
141-
# From:
142-
# https://www.zenspider.com/ruby/2008/10/rubygems-how-to-preventing-catastrophe.
143-
# html
144-
#
145-
# Let's say you're depending on the fnord gem version 2.y.z. If you specify your
146-
# dependency as ">= 2.0.0" then, you're good, right? What happens if fnord 3.0
147-
# comes out and it isn't backwards compatible with 2.y.z? Your stuff will break
148-
# as a result of using ">=". The better route is to specify your dependency with
149-
# an "approximate" version specifier ("~>"). They're a tad confusing, so here is
150-
# how the dependency specifiers work:
151-
#
152-
# Specification From ... To (exclusive)
153-
# ">= 3.0" 3.0 ... &infin;
154-
# "~> 3.0" 3.0 ... 4.0
155-
# "~> 3.0.0" 3.0.0 ... 3.1
156-
# "~> 3.5" 3.5 ... 4.0
157-
# "~> 3.5.0" 3.5.0 ... 3.6
158-
# "~> 3" 3.0 ... 4.0
159-
#
160-
# For the last example, single-digit versions are automatically extended with a
161-
# zero to give a sensible result.
162-
#
1633
class Version
1644
include Comparable
1655

core/thread.rbs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,10 +1565,10 @@ class Thread::Mutex < Object
15651565

15661566
# <!--
15671567
# rdoc-file=thread_sync.rb
1568-
# - mutex.lock -> self
1568+
# - mutex.unlock -> self
15691569
# -->
1570-
# Attempts to grab the lock and waits if it isn't available. Raises
1571-
# `ThreadError` if `mutex` was locked by the current thread.
1570+
# Releases the lock. Raises `ThreadError` if `mutex` wasn't locked by the
1571+
# current thread.
15721572
#
15731573
def unlock: () -> self
15741574
end
@@ -1751,11 +1751,6 @@ end
17511751
# See Thread::Queue for an example of how a Thread::SizedQueue works.
17521752
#
17531753
class Thread::SizedQueue[E = untyped] < Thread::Queue[E]
1754-
# <!--
1755-
# rdoc-file=thread_sync.rb
1756-
# - <<(object, non_block = false, timeout: nil)
1757-
# -->
1758-
#
17591754
alias << push
17601755

17611756
# <!--

0 commit comments

Comments
 (0)