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
4 changes: 2 additions & 2 deletions 2.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ description: Ruby 2.4 full and annotated changelog
-->

* **Released at:** Dec 25, 2016 (<a class="github" href="https://github.com/ruby/ruby/blob/trunk/doc/NEWS-2.4.0">NEWS</a> file)
* **Status (as of Jul 09, 2022):** EOL, latest is 2.4.10
* **Status (as of Feb 04, 2023):** EOL, latest is 2.4.10
* **This document first published:** Oct 14, 2019
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

## Highlights[](#highlights)

Expand Down
17 changes: 12 additions & 5 deletions 2.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ description: Ruby 2.5 full and annotated changelog
-->

* **Released at:** Dec 25, 2017 (<a class="github" href="https://github.com/ruby/ruby/blob/trunk/doc/NEWS-2.5.0">NEWS</a> file)
* **Status (as of Jul 09, 2022):** EOL, latest is 2.5.9
* **Status (as of Feb 04, 2023):** EOL, latest is 2.5.9
* **This document first published:** Jun 6, 2019
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

## Highlights[](#highlights)

Expand Down Expand Up @@ -145,7 +145,7 @@ When `uplevel: N` provided to `Kernel#warn`, the warning message includes the fi

Ruby 2.4 introduced redefinable `Warning.warn` method, which allowed to control how warnings are handled. But `warn` method wasn't calling it, so initially only warnings issued from C code could've been handled. 2.5 fixes it. <small>(Was not mentioned in NEWS-2.5.0)</small>

* **Discussion:** [Feature #12299, comment #14-15](https://bugs.ruby-lang.org/issues/12299#note-14)
* **Discussion:** <a class="tracker feature" href="https://bugs.ruby-lang.org/issues/12299#note-14#note-14">Feature #12299<small>#note-14</small></a>
* **Documentation:** —
* **Code:**
```ruby
Expand Down Expand Up @@ -375,7 +375,9 @@ The underlying <a class="github" href="https://github.com/k-takata/Onigmo">Onigm
ModernPerson.new('Meredith', 'Williams', 28)
# ArgumentError (wrong number of arguments (given 3, expected 0))
```
* **Follow-up:** Ruby 3.1 introduced [a method](3.1.html#structclasskeyword_init) to check whether some struct should be initialized with keyword arguments, and [a warning](3.1.html#warning-on-passing-keywords-to-a-non-keyword-initialized-struct) on erroneous initialization of non-keyword-args struct with a hash.
* **Follow-ups:**
* Ruby 3.1 introduced [a method](3.1.html#structclasskeyword_init) to check whether some struct should be initialized with keyword arguments, and [a warning](3.1.html#warning-on-passing-keywords-to-a-non-keyword-initialized-struct) on erroneous initialization of non-keyword-args struct with a hash.
* Ruby 3.2 [allowed](3.2.html#struct-can-be-initialized-by-keyword-arguments-by-default) all structs without explicit `keyword_init:` parameter specified to be initialized by both positional and keyword args.

### `Time.at`: units[](#timeat-units)

Expand Down Expand Up @@ -637,6 +639,11 @@ The constant `TMPFILE` is <a class="ruby-doc" href="https://ruby-doc.org/core-2.
# Ruby 2.4: => "/tmp" -- what???
# Ruby 2.5: IOError (File is unnamed (TMPFILE?))
```
* **Follow-up:** Ruby 3.2 [introduced](3.2.html#iopath) a concept of generic `IO#path` which is allowed to be `nil` when the path is unknown, so the behavior changed:
```ruby
f = File.open('/tmp', File::RDWR | File::TMPFILE)
f.path #=> nil
```

#### `File.lutime`[](#filelutime)

Expand Down Expand Up @@ -698,7 +705,7 @@ Much akin to `Hash#fetch`, allows to fetch thread-local variable or provide defa
### Misc[](#misc)

* `Random.raw_seed` renamed to <a class="ruby-doc" href="https://ruby-doc.org/core-2.5.0/Random.html#method-c-urandom"><code>Random.urandom</code></a>. Discussion: <a class="tracker bug" href="https://bugs.ruby-lang.org/issues/9569">Bug #9569</a>.
* `Data` is deprecated. It was a base class for C extensions, and it's not necessary to expose in Ruby level. <a class="tracker feature" href="https://bugs.ruby-lang.org/issues/3072">Feature #3072</a>. **Follow-up:** Fully removed in 3.0.
* `Data` is deprecated. It was a base class for C extensions, and it's not necessary to expose in Ruby level. <a class="tracker feature" href="https://bugs.ruby-lang.org/issues/3072">Feature #3072</a>. **Follow-up:** Fully removed in 3.0; in 3.2, a new class with the same name but different meaning was [reintroduced](3.2.html#data-new-immutable-value-object-class).

## Standard library[](#standard-library)

Expand Down
13 changes: 10 additions & 3 deletions 2.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ description: Ruby 2.6 full and annotated changelog
# Ruby 2.6

* **Released at:** Dec 25, 2018 (<a class="github" href="https://github.com/ruby/ruby/blob/ruby_2_6/NEWS">NEWS</a> file)
* **Status (as of Jul 09, 2022):** EOL, latest is 2.6.10
* **Status (as of Feb 04, 2023):** EOL, latest is 2.6.10
* **This document first published:** Dec 29, 2018
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

> **Note:** As already explained in [Introduction](README.md), this site is dedicated to changes in the **language**, not the **implementation**, therefore the list below lacks mentions of lots of important optimization introduced in 2.6, including the whole JIT big thing. That's not because they are not important, just because this site's goals are different.

Expand Down Expand Up @@ -472,6 +472,7 @@ Several enumerators can now be chained into one with `Enumerator#+(other)` or `E
# or redirected with `ruby test.rb 2> err.log
end
```
* **Follow-up:** In Ruby 3.2, one more related method `#detailed_message` [was added](3.2.html#exceptiondetailed_message).

#### Exception output tweaking[](#exception-output-tweaking)

Expand Down Expand Up @@ -597,7 +598,10 @@ The new module provides an "official" Ruby parser, replacing stdlib Ripper (and
tree.children[2].children[0].children
# => [1]
```
* **Notice:** One may be excited about `RubyVM::AbstractSyntaxTree.of(proc)`, but it doesn't mean the "real" extraction of code from live `Proc`, rather a simple hack with trying to find proc's source file and parse it.
* **Note:** One may be excited about `RubyVM::AbstractSyntaxTree.of(proc)`, but it doesn't mean the "real" extraction of code from live `Proc`, rather a simple hack with trying to find proc's source file and parse it.
* **Follow-up:** In Ruby 3.2, new options were added for `parse`, allowing to:
* Perform [fault-tolerant parsing](3.2.html#error_tolerant-true-option-for-parsing) (parse syntactically wrong/incomplete code);
* [Preserve tokens](3.2.html#keep_tokens-true-option-for-parsing) from source code alongside nodes;

### `TracePoint` improvements[](#tracepoint-improvements)

Expand Down Expand Up @@ -669,6 +673,9 @@ With new parameters provided, you can fine-tune for what methods or specific lin
```
* **Notice:** In absence of docs, we can at least point at [commit message](https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/66003):
> `code` should be consisted of `InstructionSequence` (iseq) (`RubyVM::InstructionSequence.of(code)` should not return nil). If code is a tree of iseq, `TracePoint` is enabled on all of iseqs in a tree.
* **Follow-ups:**
* In 2.7, <a class="ruby-doc" href="https://docs.ruby-lang.org/en/2.7.0/TracePoint.html#method-i-enable">the docs</a> have emerged, and a new parameter named `target_thread:` was introduced. It was missing from the official `NEWS`-file and therefore missing from this changelog _(which is a thing to be fixed!)_
* In 3.2, `target_thread:` began [defaulting to the current thread](3.2.html#tracepoint-for-block-default-to-trace-the-current-thread) with block form of `enable`.

## Standard library[](#standard-library)

Expand Down
9 changes: 6 additions & 3 deletions 2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ description: Ruby 2.7 full and annotated changelog
# Ruby 2.7

* **Released at:** Dec 25, 2019 (<a class="github" href="https://github.com/ruby/ruby/blob/ruby_2_7/NEWS">NEWS</a> file)
* **Status (as of Jul 09, 2022):** 2.7.6 is current _stable_
* **Status (as of Feb 04, 2023):** 2.7.7 is current _stable_
* **This document first published:** Dec 27, 2019
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

<!-- TODO: all links to docs should be replaced with /2.7.0/ suffix instead of /master/ when 2.7.0 would be published -->

Expand Down Expand Up @@ -48,7 +48,10 @@ data in [{user: {login:}, title:, created_at:}, *] # match array of hashes, with
# => ["zverok", "Add pattern matching documentation", "2019-12-25T18:42:03Z"]
```

* **Follow-up:** Pattern matching became a stable (non-experimental) feature, and its power expanded signficantly [in 3.0](#pattern-matching); and then it became even more flexible [in 3.1](3.1.html#pattern-matching).
* **Follow-ups:**
* Pattern matching became a stable (non-experimental) feature, and its power expanded signficantly [in 3.0](#pattern-matching);
* Then, it became even more flexible [in 3.1](3.1.html#pattern-matching);
* In 3.2, several core and standard library classes (`MatchData`, `Time`, `Date`, `DateTime`) [became deconstructible](3.2.html#pattern-matching).

### Keyword argument-related changes[](#keyword-argument-related-changes)

Expand Down
14 changes: 11 additions & 3 deletions 3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ description: Ruby 3.0 full and annotated changelog
# Ruby 3.0

* **Released at:** Dec 25, 2020 (<a class="github" href="https://github.com/ruby/ruby/blob/ruby_3_0/NEWS.md">NEWS.md</a> file)
* **Status (as of Jul 09, 2022):** 3.0.4 is current _stable_
* **Status (as of Feb 04, 2023):** 3.0.5 is current _stable_
* **This document first published:** Dec 25, 2020
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

## Highlights[](#highlights)

Expand Down Expand Up @@ -76,6 +76,7 @@ Just a leftover from the separation of keyword arguments.
# Ruby 3.0:
# args=[1, 2, {:a=>true}], kwargs={} -- no attempt to extract hash into keywords, and no error/warning
```
* **Follow-up:** In Ruby 3.2, one more proc argument splatting behavior [was improved](3.2.html#keyword-argument-separation-leftovers).

### Arguments forwarding (`...`) supports leading arguments[](#arguments-forwarding--supports-leading-arguments)

Expand Down Expand Up @@ -126,6 +127,9 @@ Just a leftover from the separation of keyword arguments.

delegates(5)
```
* **Follow-ups:**
* In Ruby 3.1, a separate anonymous block argument (bare `&`) forwarding [was added](3.1.html#anonymous-block-argument);
* In Ruby 3.2, separate positional and keyword (bare `*` and `**`) forwarding [were added](3.2.html#anonymous-arguments-passing-improvements).

### "Endless" method definition[](#endless-method-definition)

Expand Down Expand Up @@ -357,6 +361,7 @@ Pattern matching now supports "find patterns", with several splats in them.
```
* **Notes:**
* Feature is marked as EXPERIMENTAL, will warn so on an attempt of usage, and may change in the future.
* **Follow-ups:** Feature considered not experimental since 3.2

### Changes in class variable behavior[](#changes-in-class-variable-behavior)

Expand Down Expand Up @@ -1030,6 +1035,7 @@ The method will return true for separate Proc instances if the procs were create
```
* **Notes:**
* See [Ractors](#ractors) explanation below, and <a class="ruby-doc" href="https://docs.ruby-lang.org/en/3.0.0/Ractor.html"><code>Ractor</code></a> class docs for deeper understanding of ractors data sharing model.
* **Follow-up:** In 3.2, the constant was [removed](3.2.html#removals).

### Filesystem and IO[](#filesystem-and-io)

Expand Down Expand Up @@ -1127,7 +1133,9 @@ The improvement of inter-thread concurrency for IO-heavy tasks is achieved with
of blocking the whole thread, they were transferring control while waiting, and all three waits are
performed in parallel.
* **Notes:** The feature is somewhat unprecedented for Ruby in the fact that **no default Scheduler implementation** is provided. Implementing the Scheduler in a reliable way (probably using some additional non-blocking event loop library) is completely up to the user. Considering that the feature is implemented by [Samuel Williams](https://github.com/ioquatix) of the <a class="github" href="https://github.com/socketry/async">Async</a> fame, the Async gem <a class="github" href="https://github.com/socketry/async/blob/master/lib/async/scheduler.rb">utilizes</a> the new feature since the day of 3.0 release.
* **Follow-up:** In Ruby 3.1, [more scheduler hooks were added](3.1.html#fiber-scheduler-new-hooks) to make more core methods support asynchronous execution.
* **Follow-up:s**
* In Ruby 3.1, [more scheduler hooks were added](3.1.html#fiber-scheduler-new-hooks) to make more core methods support asynchronous execution;
* In 3.2, [even more](3.2.html#fiberschedulerio_select) hooks were added, and `SchedulerInteface` documentation abstraction was renamed to `Scheduler`.

#### `Thread.ignore_deadlock` accessor[](#threadignore_deadlock-accessor)

Expand Down
15 changes: 8 additions & 7 deletions 3.1.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: Ruby 3.1 changes
prev: /
next: 3.0
prev: 3.2
next: 3.1
description: Ruby 3.1 full and annotated changelog
---

# Ruby 3.1

* **Released at:** Dec 25, 2021 (<a class="github" href="https://github.com/ruby/ruby/blob/ruby_3_1/NEWS.md">NEWS.md</a> file)
* **Status (as of Jul 09, 2022):** 3.1.2 is current _stable_
* **Status (as of Feb 04, 2023):** 3.1.3 is current _stable_
* **This document first published:** Jan 5, 2022
* **Last change to this document:** Jul 09, 2022
* **Last change to this document:** Feb 04, 2023

> **Note:** As already explained in [Introduction](README.md), this site is dedicated to changes in the **language**, not the **implementation**, therefore the list below lacks mentions of lots of important optimization introduced in 3.1, including a new JIT named YJIT. That's not because they are not important, just because this site's goals are different.

Expand Down Expand Up @@ -106,7 +106,7 @@ In hash literals and method calls, `x:` is now a shortcut for `x: x`—take hash

If method uses its block argument only to pass to another method, it can be marked by anonymous `&`.

* **Reason:** The initial proposal for the feature is 6-year old and focused on avoiding intermediate blocks object allocation on block forwarding. It was considered redundant when block forwarding was optimized in Ruby 2.5; but then the core team decided it is actually a nice and unambiguous shortcut for methods that just pass the block further. As bloc argument is frequently called just `block`, the absence of the name doesn't affect readability.
* **Reason:** The initial proposal for the feature is 6-year old and focused on avoiding intermediate blocks object allocation on block forwarding. It was considered redundant when block forwarding was optimized in Ruby 2.5; but then the core team decided it is actually a nice and unambiguous shortcut for methods that just pass the block further. As block argument is frequently called just `block`, the absence of the name doesn't affect readability.
* **Discussion:** <a class="tracker feature" href="https://bugs.ruby-lang.org/issues/11256">Feature #11256</a>
* **Documentation:** <a class="ruby-doc" href="https://docs.ruby-lang.org/en/3.1/syntax/methods_rdoc.html#label-Block+Argument">doc/syntax/methods.rdoc#Block Argument</a>
* **Code:**
Expand Down Expand Up @@ -333,6 +333,7 @@ The class of the context (`self`) available inside the `refine SomeClass do ...
end
end
```
* **Follow-ups:** In Ruby 3.2, several usability improvments using the new class [were introduced](3.2.html#refinements): ability to ask which refinements some module defines, which refinements are active in the current context, and what class or module the particular refinement refines.

#### `Module#prepend` behavior change[](#moduleprepend-behavior-change)

Expand Down Expand Up @@ -442,6 +443,7 @@ Now, when module is prepended to the class, it always becomes first in the ances
# => true
```
* **Notes:** Another idea discussed was just having `Method#visibility`, but it was hard to decide on the method's name and what it should return, while three predicates are more or less obvious.
* **Follow-up:** [Reverted](3.2.html#methodpublic-protected-and-private-are-removed) in Ruby 3.2: it was considered after all that visibility is not a property of the method, but rather the responsibility of its owner.

### `Kernel#load`: module as a second argument[](#kernelload-module-as-a-second-argument)

Expand Down Expand Up @@ -729,6 +731,7 @@ The new parameter is accepting offsets or timezone objects, and (finally!) allow
#=> #<struct Locale lang=:ua, translations={:user=>"користувач", :application=>"застосунок"}>
# ...no braces necessary, no warning
```
* **Follow-up:** Since 3.2, following the warning, the structs [can be initialized](3.2.html#struct-can-be-initialized-by-keyword-arguments-by-default) by both keyword and positional argument when `keyword_init: true` is not defined.

#### `StructClass#keyword_init?`[](#structclasskeyword_init)

Expand Down Expand Up @@ -895,8 +898,6 @@ A new class representing low-level I/O abstraction. Internally, uses OS mechanis
* **Discussion:** <a class="tracker feature" href="https://bugs.ruby-lang.org/issues/18020">Feature #18020</a>
* **Documentation:** <a class="ruby-doc" href="https://docs.ruby-lang.org/en/3.1/IO/Buffer.html"><code>IO::Buffer</code></a>
* **Code:** _This is a big new class, see class' docs for detailed examples of usage, they are quite succinct._
* **Notes:**
* **Follow-up:**

### `File.dirname`: optional `level` to go up the directory tree[](#filedirname-optional-level-to-go-up-the-directory-tree)

Expand Down
Loading