Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bundle-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '4.0.0-preview2'
ruby-version: '4.0.0-preview3'

- name: Set up git
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/c-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0.0-preview2"
ruby-version: "4.0.0-preview3"
bundler-cache: none
- name: Set working directory as safe
run: git config --global --add safe.directory $(pwd)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
comments:
runs-on: "ubuntu-latest"
env:
RUBY_COMMIT: v4.0.0-preview2
RUBY_COMMIT: v4.0.0-preview3
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0.0-preview2"
ruby-version: "4.0.0-preview3"
bundler: none
- name: Install dependencies
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.3', '3.4', '4.0.0-preview2', head]
ruby: ['3.2', '3.3', '3.4', '4.0.0-preview3', head]
rubyopt: [""]
job:
- test
include:
- ruby: head
job: stdlib_test rubocop
- ruby: "4.0.0-preview2"
- ruby: "4.0.0-preview3"
job: stdlib_test
- ruby: "4.0.0-preview2"
- ruby: "4.0.0-preview3"
job: test
rubyopt: "--enable-frozen-string-literal"
- ruby: "4.0.0-preview2"
- ruby: "4.0.0-preview3"
job: stdlib_test
rubyopt: "--enable-frozen-string-literal"
- ruby: "4.0.0-preview2"
- ruby: "4.0.0-preview3"
job: rubocop validate test_doc build test_generate_stdlib raap
- ruby: "4.0.0-preview2"
- ruby: "4.0.0-preview3"
job: typecheck_test
env:
RANDOMIZE_STDLIB_TEST_ORDER: "true"
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['4.0.0-preview2', head]
ruby: ['4.0.0-preview3', head]
steps:
- uses: actions/checkout@v6
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions core/array.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ class Array[unchecked out Elem] < Object
# Returns the element from `self` found by a binary search, or `nil` if the
# search found no suitable element.
#
# See [Binary Searching](rdoc-ref:bsearch.rdoc).
# See [Binary Searching](rdoc-ref:language/bsearch.rdoc).
#
# Related: see [Methods for Fetching](rdoc-ref:Array@Methods+for+Fetching).
#
Expand All @@ -1229,7 +1229,7 @@ class Array[unchecked out Elem] < Object
# Returns the integer index of the element from `self` found by a binary search,
# or `nil` if the search found no suitable element.
#
# See [Binary Searching](rdoc-ref:bsearch.rdoc).
# See [Binary Searching](rdoc-ref:language/bsearch.rdoc).
#
# Related: see [Methods for Fetching](rdoc-ref:Array@Methods+for+Fetching).
#
Expand Down Expand Up @@ -2618,7 +2618,7 @@ class Array[unchecked out Elem] < Object
# - pack(template, buffer: nil) -> string
# -->
# Formats each element in `self` into a binary string; returns that string. See
# [Packed Data](rdoc-ref:packed_data.rdoc).
# [Packed Data](rdoc-ref:language/packed_data.rdoc).
#
def pack: (string fmt, ?buffer: String?) -> String

Expand Down
53 changes: 32 additions & 21 deletions core/complex.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,24 @@ class Complex < Numeric

# <!--
# rdoc-file=complex.c
# - complex * numeric -> new_complex
# - self * other -> numeric
# -->
# Returns the product of `self` and `numeric`:
# Returns the numeric product of `self` and `other`:
#
# Complex.rect(9, 8) * 4 # => (36+32i)
# Complex.rect(20, 9) * 9.8 # => (196.0+88.2i)
# Complex.rect(2, 3) * Complex.rect(2, 3) # => (-5+12i)
# Complex.rect(900) * Complex.rect(1) # => (900+0i)
# Complex.rect(-2, 9) * Complex.rect(-9, 2) # => (0-85i)
# Complex.rect(9, 8) * 4 # => (36+32i)
# Complex.rect(20, 9) * 9.8 # => (196.0+88.2i)
# Complex.rect(9, 8) * Rational(2, 3) # => ((6/1)+(16/3)*i)
#
def *: (Numeric) -> Complex

# <!--
# rdoc-file=complex.c
# - complex ** numeric -> new_complex
# - self ** exponent -> complex
# -->
# Returns `self` raised to power `numeric`:
# Returns `self` raised to the power `exponent`:
#
# Complex.rect(0, 1) ** 2 # => (-1+0i)
# Complex.rect(-8) ** Rational(1, 3) # => (1.0000000000000002+1.7320508075688772i)
Expand All @@ -209,23 +210,33 @@ class Complex < Numeric

# <!--
# rdoc-file=complex.c
# - complex + numeric -> new_complex
# - self + other -> numeric
# -->
# Returns the sum of `self` and `numeric`:
# Returns the sum of `self` and `other`:
#
# Complex(1, 2) + 0 # => (1+2i)
# Complex(1, 2) + 1 # => (2+2i)
# Complex(1, 2) + -1 # => (0+2i)
#
# Complex(1, 2) + 1.0 # => (2.0+2i)
#
# Complex(1, 2) + Complex(2, 1) # => (3+3i)
# Complex(1, 2) + Complex(2.0, 1.0) # => (3.0+3.0i)
#
# Complex(1, 2) + Rational(1, 1) # => ((2/1)+2i)
# Complex(1, 2) + Rational(1, 2) # => ((3/2)+2i)
#
# For a computation involving Floats, the result may be inexact (see Float#+):
#
# Complex.rect(2, 3) + Complex.rect(2, 3) # => (4+6i)
# Complex.rect(900) + Complex.rect(1) # => (901+0i)
# Complex.rect(-2, 9) + Complex.rect(-9, 2) # => (-11+11i)
# Complex.rect(9, 8) + 4 # => (13+8i)
# Complex.rect(20, 9) + 9.8 # => (29.8+9i)
# Complex(1, 2) + 3.14 # => (4.140000000000001+2i)
#
def +: (Numeric) -> Complex

# <!--
# rdoc-file=complex.c
# - complex - numeric -> new_complex
# - self - other -> complex
# -->
# Returns the difference of `self` and `numeric`:
# Returns the difference of `self` and `other`:
#
# Complex.rect(2, 3) - Complex.rect(2, 3) # => (0+0i)
# Complex.rect(900) - Complex.rect(1) # => (899+0i)
Expand All @@ -237,9 +248,9 @@ class Complex < Numeric

# <!--
# rdoc-file=complex.c
# - -complex -> new_complex
# - -self -> complex
# -->
# Returns the negation of `self`, which is the negation of each of its parts:
# Returns `self`, negated, which is the negation of each of its parts:
#
# -Complex.rect(1, 2) # => (-1-2i)
# -Complex.rect(-1, -2) # => (1+2i)
Expand All @@ -248,9 +259,9 @@ class Complex < Numeric

# <!--
# rdoc-file=complex.c
# - complex / numeric -> new_complex
# - self / other -> complex
# -->
# Returns the quotient of `self` and `numeric`:
# Returns the quotient of `self` and `other`:
#
# Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i)
# Complex.rect(900) / Complex.rect(1) # => (900+0i)
Expand Down Expand Up @@ -597,9 +608,9 @@ class Complex < Numeric

# <!--
# rdoc-file=complex.c
# - complex / numeric -> new_complex
# - self / other -> complex
# -->
# Returns the quotient of `self` and `numeric`:
# Returns the quotient of `self` and `other`:
#
# Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i)
# Complex.rect(900) / Complex.rect(1) # => (900+0i)
Expand Down
10 changes: 3 additions & 7 deletions core/encoding.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class Encoding
def inspect: () -> String

# <!-- rdoc-file=encoding.c -->
# Returns the name of the encoding.
# The name of the encoding.
#
# Encoding::UTF_8.name #=> "UTF-8"
#
Expand All @@ -297,12 +297,8 @@ class Encoding
#
def names: () -> Array[String]

# <!--
# rdoc-file=encoding.c
# - enc.name -> string
# - enc.to_s -> string
# -->
# Returns the name of the encoding.
# <!-- rdoc-file=encoding.c -->
# The name of the encoding.
#
# Encoding::UTF_8.name #=> "UTF-8"
#
Expand Down
2 changes: 1 addition & 1 deletion core/enumerable.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
# ["F", 6860]
#
# You can use the special symbol `:_alone` to force an element into its own
# separate chuck:
# separate chunk:
#
# a = [0, 0, 1, 1]
# e = a.chunk{|i| i.even? ? :_alone : true }
Expand Down
19 changes: 18 additions & 1 deletion core/enumerator.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object

# <!--
# rdoc-file=enumerator.c
# - Enumerator.produce(initial = nil) { |prev| block } -> enumerator
# - Enumerator.produce(initial = nil, size: nil) { |prev| block } -> enumerator
# -->
# Creates an infinite enumerator from any block, just called over and over. The
# result of the previous iteration is passed to the next one. If `initial` is
Expand Down Expand Up @@ -169,6 +169,23 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
# Enumerator.produce { scanner.scan(PATTERN) }.slice_after { scanner.eos? }.first
# # => ["7", "+", "38", "/", "6"]
#
# The optional `size` keyword argument specifies the size of the enumerator,
# which can be retrieved by Enumerator#size. It can be an integer,
# `Float::INFINITY`, a callable object (such as a lambda), or `nil` to indicate
# unknown size. When not specified, the size defaults to `Float::INFINITY`.
#
# # Infinite enumerator
# enum = Enumerator.produce(1, size: Float::INFINITY, &:succ)
# enum.size # => Float::INFINITY
#
# # Finite enumerator with known/computable size
# abs_dir = File.expand_path("./baz") # => "/foo/bar/baz"
# traverser = Enumerator.produce(abs_dir, size: -> { abs_dir.count("/") + 1 }) {
# raise StopIteration if it == "/"
# File.dirname(it)
# }
# traverser.size # => 4
#
def self.produce: [T] () { (T? prev) -> T } -> Enumerator[T, bot]
| [T] (T initial) { (T prev) -> T } -> Enumerator[T, bot]

Expand Down
3 changes: 2 additions & 1 deletion core/fiber.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class Fiber < Object
# -->
# Returns the value of the fiber storage variable identified by `key`.
#
# The `key` must be a symbol, and the value is set by Fiber#[]= or Fiber#store.
# The `key` must be a symbol, and the value is set by Fiber#[]= or
# Fiber#storage.
#
# See also Fiber::[]=.
#
Expand Down
2 changes: 1 addition & 1 deletion core/file.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ class File < IO
# rdoc-file=file.c
# - File.owned?(file_name) -> true or false
# -->
# Returns `true` if the named file exists and the effective used id of the
# Returns `true` if the named file exists and the effective user id of the
# calling process is the owner of the file.
#
# *file_name* can be an IO object.
Expand Down
2 changes: 1 addition & 1 deletion core/file_test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ module FileTest
# rdoc-file=file.c
# - File.owned?(file_name) -> true or false
# -->
# Returns `true` if the named file exists and the effective used id of the
# Returns `true` if the named file exists and the effective user id of the
# calling process is the owner of the file.
#
# *file_name* can be an IO object.
Expand Down
Loading