Skip to content

Commit 613f17b

Browse files
authored
Merge pull request #2160 from ruby/update-rdoc
Update rdoc
2 parents fb8af70 + 00bbfe0 commit 613f17b

File tree

116 files changed

+456
-2489
lines changed

Some content is hidden

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

116 files changed

+456
-2489
lines changed

Gemfile.lock

+4-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ GEM
8585
rb-fsevent (0.11.2)
8686
rb-inotify (0.11.1)
8787
ffi (~> 1.0)
88-
rdoc (6.6.3.1)
88+
rdoc (6.9.0)
8989
psych (>= 4.0.0)
9090
regexp_parser (2.9.3)
9191
rspec (3.13.0)
@@ -120,9 +120,9 @@ GEM
120120
rubocop-rubycw (0.1.6)
121121
rubocop (~> 1.0)
122122
ruby-progressbar (1.13.0)
123-
securerandom (0.4.0)
123+
securerandom (0.4.1)
124124
stackprof (0.2.26)
125-
steep (1.9.1)
125+
steep (1.9.2)
126126
activesupport (>= 5.1)
127127
concurrent-ruby (>= 1.1.10)
128128
csv (>= 3.0.9)
@@ -137,6 +137,7 @@ GEM
137137
securerandom (>= 0.1)
138138
strscan (>= 1.0.0)
139139
terminal-table (>= 2, < 4)
140+
uri (>= 0.12.0)
140141
stringio (3.1.2)
141142
strong_json (2.1.2)
142143
strscan (3.1.2)

core/array.rbs

-26
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,24 @@
1313
# * Index 1 indicates the second element.
1414
# * ...
1515
#
16-
#
1716
# A negative index is an offset, backwards, from the end of the array:
1817
#
1918
# * Index -1 indicates the last element.
2019
# * Index -2 indicates the next-to-last element.
2120
# * ...
2221
#
23-
#
2422
# A non-negative index is *in range* if and only if it is smaller than the size
2523
# of the array. For a 3-element array:
2624
#
2725
# * Indexes 0 through 2 are in range.
2826
# * Index 3 is out of range.
2927
#
30-
#
3128
# A negative index is *in range* if and only if its absolute value is not larger
3229
# than the size of the array. For a 3-element array:
3330
#
3431
# * Indexes -1 through -3 are in range.
3532
# * Index -4 is out of range.
3633
#
37-
#
3834
# Although the effective index into an array is always an integer, some methods
3935
# (both within and outside of class Array) accept one or more non-integer
4036
# arguments that are [integer-convertible
@@ -91,7 +87,6 @@
9187
# Array.new(3) {Array.new(3)}
9288
# # => [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
9389
#
94-
#
9590
# A number of Ruby methods, both in the core and in the standard library,
9691
# provide instance method `to_a`, which converts an object to an array.
9792
#
@@ -122,7 +117,6 @@
122117
# * RubyVM::InstructionSequence#to_a
123118
# * YAML::DBM#to_a
124119
#
125-
#
126120
# ## Example Usage
127121
#
128122
# In addition to the methods it mixes in through the Enumerable module, the
@@ -320,7 +314,6 @@
320314
# * Includes [module Enumerable](rdoc-ref:Enumerable@What-27s+Here), which
321315
# provides dozens of additional methods.
322316
#
323-
#
324317
# Here, class Array provides methods that are useful for:
325318
#
326319
# * [Creating an Array](rdoc-ref:Array@Methods+for+Creating+an+Array)
@@ -334,14 +327,12 @@
334327
# * [Converting](rdoc-ref:Array@Methods+for+Converting)
335328
# * [And more....](rdoc-ref:Array@Other+Methods)
336329
#
337-
#
338330
# ### Methods for Creating an Array
339331
#
340332
# * ::[]: Returns a new array populated with given objects.
341333
# * ::new: Returns a new array.
342334
# * ::try_convert: Returns a new array created from a given object.
343335
#
344-
#
345336
# ### Methods for Querying
346337
#
347338
# * #length, #size: Returns the count of elements.
@@ -358,7 +349,6 @@
358349
# criterion.
359350
# * #hash: Returns the integer hash code.
360351
#
361-
#
362352
# ### Methods for Comparing
363353
#
364354
# * #<=>: Returns -1, 0, or 1 * as `self` is less than, equal to, or greater
@@ -368,7 +358,6 @@
368358
# * #eql?: Returns whether each element in `self` is `eql?` to the
369359
# corresponding element in a given object.
370360
#
371-
#
372361
# ### Methods for Fetching
373362
#
374363
# These methods do not modify `self`.
@@ -411,7 +400,6 @@
411400
# * #sample: Returns one or more random elements.
412401
# * #shuffle: Returns elements in a random order.
413402
#
414-
#
415403
# ### Methods for Assigning
416404
#
417405
# These methods add, replace, or reorder elements in `self`.
@@ -433,7 +421,6 @@
433421
# * #sort_by!: Replaces `self` with its elements sorted, as determined by a
434422
# given block.
435423
#
436-
#
437424
# ### Methods for Deleting
438425
#
439426
# Each of these methods removes elements from `self`:
@@ -450,7 +437,6 @@
450437
# * #slice!: Removes and returns a sequence of elements.
451438
# * #uniq!: Removes duplicates.
452439
#
453-
#
454440
# ### Methods for Combining
455441
#
456442
# * #&: Returns an array containing elements found both in `self` and a given
@@ -470,7 +456,6 @@
470456
# * #product: Returns or yields all combinations of elements from `self` and
471457
# given arrays.
472458
#
473-
#
474459
# ### Methods for Iterating
475460
#
476461
# * #each: Passes each element to a given block.
@@ -487,7 +472,6 @@
487472
# * #repeated_permutation: Calls a given block with permutations of elements
488473
# of `self`; a permutation may use the same element more than once.
489474
#
490-
#
491475
# ### Methods for Converting
492476
#
493477
# * #map, #collect: Returns an array containing the block return-value for
@@ -506,7 +490,6 @@
506490
# * #zip: Returns a new array of arrays containing `self` and given arrays;
507491
# follow the link for details.
508492
#
509-
#
510493
# ### Other Methods
511494
#
512495
# * #*: Returns one of the following:
@@ -516,7 +499,6 @@
516499
# * With string argument `field_separator`, a new string that is
517500
# equivalent to `join(field_separator)`.
518501
#
519-
#
520502
# * #abbrev: Returns a hash of unambiguous abbreviations for elements.
521503
# * #pack: Packs the elements into a binary sequence.
522504
# * #sum: Returns a sum of elements according to either `+` or a given block.
@@ -1952,7 +1934,6 @@ class Array[unchecked out Elem] < Object
19521934
# * Each non-Array element is unchanged.
19531935
# * Each Array is replaced by its individual elements.
19541936
#
1955-
#
19561937
# With non-negative Integer argument `level`, flattens recursively through
19571938
# `level` levels:
19581939
#
@@ -2168,7 +2149,6 @@ class Array[unchecked out Elem] < Object
21682149
# * Uses recursive `element.join(separator)` if `element` is a
21692150
# `kind_of?(Array)`.
21702151
#
2171-
#
21722152
# With no argument, joins using the output field separator, `$,`:
21732153
#
21742154
# a = [:foo, 'bar', 2]
@@ -2292,7 +2272,6 @@ class Array[unchecked out Elem] < Object
22922272
# * The maximum-valued element from `self`.
22932273
# * A new Array of maximum-valued elements selected from `self`.
22942274
#
2295-
#
22962275
# When no block is given, each element in `self` must respond to method `<=>`
22972276
# with an Integer.
22982277
#
@@ -2336,7 +2315,6 @@ class Array[unchecked out Elem] < Object
23362315
# * The minimum-valued element from `self`.
23372316
# * A new Array of minimum-valued elements selected from `self`.
23382317
#
2339-
#
23402318
# When no block is given, each element in `self` must respond to method `<=>`
23412319
# with an Integer.
23422320
#
@@ -2606,7 +2584,6 @@ class Array[unchecked out Elem] < Object
26062584
# including both `self` and `other_arrays`.
26072585
# * The order of the returned combinations is indeterminate.
26082586
#
2609-
#
26102587
# When no block is given, returns the combinations as an Array of Arrays:
26112588
#
26122589
# a = [0, 1, 2]
@@ -3416,7 +3393,6 @@ class Array[unchecked out Elem] < Object
34163393
# * Zero when `a` and `b` are equivalent.
34173394
# * Positive when `a` is to follow `b`.
34183395
#
3419-
#
34203396
# Example:
34213397
#
34223398
# a = 'abcde'.split('').shuffle
@@ -3460,7 +3436,6 @@ class Array[unchecked out Elem] < Object
34603436
# * Zero when `a` and `b` are equivalent.
34613437
# * Positive when `a` is to follow `b`.
34623438
#
3463-
#
34643439
# Example:
34653440
#
34663441
# a = 'abcde'.split('').shuffle
@@ -3811,7 +3786,6 @@ class Array[unchecked out Elem] < Object
38113786
# * The *nth* element of `self`.
38123787
# * The *nth* element of each of the `other_arrays`.
38133788
#
3814-
#
38153789
# If all `other_arrays` and `self` are the same size:
38163790
#
38173791
# a = [:a0, :a1, :a2, :a3]

core/complex.rbs

-7
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@
1616
# string arguments.
1717
# * Method String#to_c, for certain strings.
1818
#
19-
#
2019
# Note that each of the stored parts may be a an instance one of the classes
2120
# Complex, Float, Integer, or Rational; they may be retrieved:
2221
#
2322
# * Separately, with methods Complex#real and Complex#imaginary.
2423
# * Together, with method Complex#rect.
2524
#
26-
#
2725
# The corresponding (computed) polar values may be retrieved:
2826
#
2927
# * Separately, with methods Complex#abs and Complex#arg.
3028
# * Together, with method Complex#polar.
3129
#
32-
#
3330
# ## Polar Coordinates
3431
#
3532
# The polar coordinates of a complex number are called the *absolute* and
@@ -46,14 +43,12 @@
4643
# * Method Kernel#Complex, with certain string arguments.
4744
# * Method String#to_c, for certain strings.
4845
#
49-
#
5046
# Note that each of the stored parts may be a an instance one of the classes
5147
# Complex, Float, Integer, or Rational; they may be retrieved:
5248
#
5349
# * Separately, with methods Complex#abs and Complex#arg.
5450
# * Together, with method Complex#polar.
5551
#
56-
#
5752
# The corresponding (computed) rectangular values may be retrieved:
5853
#
5954
# * Separately, with methods Complex#real and Complex#imag.
@@ -205,10 +200,8 @@ class Complex < Numeric
205200
# * `object.imag == 0`. # Always true if object is numeric but not
206201
# complex.
207202
#
208-
#
209203
# * `nil` otherwise.
210204
#
211-
#
212205
# Examples:
213206
#
214207
# Complex(2) <=> 3 # => -1

core/constants.rbs

-63
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,33 @@
1-
# <!-- rdoc-file=io.c -->
2-
# ARGF is a stream designed for use in scripts that process files given as
3-
# command-line arguments or passed in via STDIN.
4-
#
5-
# See ARGF (the class) for more details.
6-
#
71
ARGF: RBS::Unnamed::ARGFClass
82

9-
# <!-- rdoc-file=ruby.c -->
10-
# ARGV contains the command line arguments used to run ruby.
11-
#
12-
# A library like OptionParser can be used to process command-line arguments.
13-
#
143
ARGV: Array[String]
154

165
CROSS_COMPILING: true?
176

18-
# <!-- rdoc-file=ruby.c -->
19-
# DATA is a File that contains the data section of the executed file. To create
20-
# a data section use `__END__`:
21-
#
22-
# $ cat t.rb
23-
# puts DATA.gets
24-
# __END__
25-
# hello world!
26-
#
27-
# $ ruby t.rb
28-
# hello world!
29-
#
307
DATA: File
318

32-
# <!-- rdoc-file=version.c -->
33-
# The copyright string for ruby
34-
#
359
RUBY_COPYRIGHT: String
3610

37-
# <!-- rdoc-file=version.c -->
38-
# The full ruby version string, like `ruby -v` prints
39-
#
4011
RUBY_DESCRIPTION: String
4112

42-
# <!-- rdoc-file=version.c -->
43-
# The engine or interpreter this ruby uses.
44-
#
4513
RUBY_ENGINE: String
4614

47-
# <!-- rdoc-file=version.c -->
48-
# The version of the engine or interpreter this ruby uses.
49-
#
5015
RUBY_ENGINE_VERSION: String
5116

52-
# <!-- rdoc-file=version.c -->
53-
# The patchlevel for this ruby. If this is a development build of ruby the
54-
# patchlevel will be -1
55-
#
5617
RUBY_PATCHLEVEL: Integer
5718

58-
# <!-- rdoc-file=version.c -->
59-
# The platform for this ruby
60-
#
6119
RUBY_PLATFORM: String
6220

63-
# <!-- rdoc-file=version.c -->
64-
# The date this ruby was released
65-
#
6621
RUBY_RELEASE_DATE: String
6722

68-
# <!-- rdoc-file=version.c -->
69-
# The GIT commit hash for this ruby.
70-
#
7123
RUBY_REVISION: String
7224

73-
# <!-- rdoc-file=version.c -->
74-
# The running version of ruby
75-
#
7625
RUBY_VERSION: String
7726

78-
# <!-- rdoc-file=io.c -->
79-
# Holds the original stderr
80-
#
8127
STDERR: IO
8228

83-
# <!-- rdoc-file=io.c -->
84-
# Holds the original stdin
85-
#
8629
STDIN: IO
8730

88-
# <!-- rdoc-file=io.c -->
89-
# Holds the original stdout
90-
#
9131
STDOUT: IO
9232

93-
# <!-- rdoc-file=vm.c -->
94-
# The Binding of the top level scope
95-
#
9633
TOPLEVEL_BINDING: Binding

0 commit comments

Comments
 (0)