Skip to content

Commit e80f75b

Browse files
authored
Merge pull request #2183 from ruby/ruby-3.4-docs
Generate docs based on ruby 3.4.0-rc1
2 parents 0d29fc9 + 494b97d commit e80f75b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6205
-4016
lines changed

.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: v3_3_0
13+
env:
14+
RUBY_COMMIT: v3_4_0_rc1
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: ruby/setup-ruby@v1
1818
with:
19-
ruby-version: "3.3"
19+
ruby-version: "3.4.0-rc1"
2020
bundler: none
2121
- name: Install dependencies
2222
run: |

core/array.rbs

Lines changed: 1717 additions & 1565 deletions
Large diffs are not rendered by default.

core/basic_object.rbs

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
11
# <!-- rdoc-file=object.c -->
2-
# BasicObject is the parent class of all classes in Ruby. It's an explicit
3-
# blank class.
2+
# `BasicObject` is the parent class of all classes in Ruby. In particular,
3+
# `BasicObject` is the parent class of class Object, which is itself the default
4+
# parent class of every Ruby class:
45
#
5-
# BasicObject can be used for creating object hierarchies independent of Ruby's
6-
# object hierarchy, proxy objects like the Delegator class, or other uses where
7-
# namespace pollution from Ruby's methods and classes must be avoided.
6+
# class Foo; end
7+
# Foo.superclass # => Object
8+
# Object.superclass # => BasicObject
89
#
9-
# To avoid polluting BasicObject for other users an appropriately named subclass
10-
# of BasicObject should be created instead of directly modifying BasicObject:
10+
# `BasicObject` is the only class that has no parent:
1111
#
12-
# class MyObjectSystem < BasicObject
13-
# end
12+
# BasicObject.superclass # => nil
1413
#
15-
# BasicObject does not include Kernel (for methods like `puts`) and BasicObject
16-
# is outside of the namespace of the standard library so common classes will not
17-
# be found without using a full class path.
14+
# Class `BasicObject` can be used to create an object hierarchy (e.g., class
15+
# Delegator) that is independent of Ruby's object hierarchy. Such objects:
1816
#
19-
# A variety of strategies can be used to provide useful portions of the standard
20-
# library to subclasses of BasicObject. A subclass could `include Kernel` to
21-
# obtain `puts`, `exit`, etc. A custom Kernel-like module could be created and
22-
# included or delegation can be used via #method_missing:
17+
# * Do not have namespace "pollution" from the many methods provided in class
18+
# Object and its included module Kernel.
19+
# * Do not have definitions of common classes, and so references to such
20+
# common classes must be fully qualified (`::String`, not `String`).
2321
#
24-
# class MyObjectSystem < BasicObject
25-
# DELEGATE = [:puts, :p]
22+
# A variety of strategies can be used to provide useful portions of the Standard
23+
# Library in subclasses of `BasicObject`:
2624
#
27-
# def method_missing(name, *args, &block)
28-
# return super unless DELEGATE.include? name
29-
# ::Kernel.send(name, *args, &block)
30-
# end
25+
# * The immediate subclass could `include Kernel`, which would define methods
26+
# such as `puts`, `exit`, etc.
27+
# * A custom Kernel-like module could be created and included.
28+
# * Delegation can be used via #method_missing:
3129
#
32-
# def respond_to_missing?(name, include_private = false)
33-
# DELEGATE.include?(name) or super
34-
# end
35-
# end
30+
# class MyObjectSystem < BasicObject
31+
# DELEGATE = [:puts, :p]
3632
#
37-
# Access to classes and modules from the Ruby standard library can be obtained
38-
# in a BasicObject subclass by referencing the desired constant from the root
39-
# like `::File` or `::Enumerator`. Like #method_missing, #const_missing can be
40-
# used to delegate constant lookup to `Object`:
33+
# def method_missing(name, *args, &block)
34+
# return super unless DELEGATE.include? name
35+
# ::Kernel.send(name, *args, &block)
36+
# end
4137
#
42-
# class MyObjectSystem < BasicObject
43-
# def self.const_missing(name)
44-
# ::Object.const_get(name)
45-
# end
46-
# end
38+
# def respond_to_missing?(name, include_private = false)
39+
# DELEGATE.include?(name)
40+
# end
41+
# end
4742
#
4843
# ### What's Here
4944
#
@@ -60,6 +55,14 @@
6055
# `self`.
6156
# * #instance_exec: Executes the given block in the context of `self`, passing
6257
# the given arguments.
58+
# * #method_missing: Called when `self` is called with a method it does not
59+
# define.
60+
# * #singleton_method_added: Called when a singleton method is added to
61+
# `self`.
62+
# * #singleton_method_removed: Called when a singleton method is removed from
63+
# `self`.
64+
# * #singleton_method_undefined: Called when a singleton method is undefined
65+
# in `self`.
6366
#
6467
class BasicObject
6568
# <!--

core/comparable.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#
3939
# ## What's Here
4040
#
41-
# Module Comparable provides these methods, all of which use method `<=>`:
41+
# Module Comparable provides these methods, all of which use method `#<=>`:
4242
#
4343
# * #<: Returns whether `self` is less than the given object.
4444
# * #<=: Returns whether `self` is less than or equal to the given object.

0 commit comments

Comments
 (0)