Skip to content

Commit f47effb

Browse files
committed
Advent of Changelog: Day 22
1 parent ed1054b commit f47effb

File tree

5 files changed

+128
-16
lines changed

5 files changed

+128
-16
lines changed

3.3.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ description: Ruby 3.3 full and annotated changelog
88
# Ruby 3.3
99

1010
* **Released at:** Dec 25, 2023 ([NEWS.md](TODO) file)
11-
* **Status (as of Dec 21, 2023):** TODO
11+
* **Status (as of Dec 22, 2023):** TODO
1212
* **This document first published:** Dec 25, 2023
13-
* **Last change to this document:** Dec 21, 2023
13+
* **Last change to this document:** Dec 22, 2023
1414

1515
<!--
1616
* **Reason:**
@@ -343,7 +343,6 @@ The method now requires fully-specified date-time string.
343343
# Ruby 3.3:
344344
# in `unpack': unknown pack directive 'r' in 'r*' (ArgumentError)
345345
```
346-
* **Notes:**
347346

348347
### Enumerables and collections[](#enumerables-and-collections)
349348

@@ -428,7 +427,6 @@ A new "weak map" concept implementation. Unlike `ObjectSpace::WeakMap`, it compa
428427
files_to_close.delete(file2) { puts "Already removed"; 0 }
429428
# Prints nothing, returns true
430429
```
431-
* **Notes:**
432430

433431
#### `Thread::Queue#freeze` and `SizedQueue#freeze` raise `TypeError`[](#threadqueuefreeze-and-sizedqueuefreeze-raise-typeerror)
434432

@@ -731,7 +729,6 @@ A new warning category was introduced for a code that is correct but is known to
731729
* The warning category should be turned on explicitly by providing `-W:performance` CLI option or `Warning[:performance] = true` from the program.
732730
* **Additional reading:** [Performance impact of the memoization idiom on modern Ruby](https://railsatscale.com/2023-10-24-memoization-pattern-and-object-shapes/) by Ruby core team member Jean Boussier.
733731

734-
735732
#### `Process.warmup`[](#processwarmup)
736733

737734
A method to call when a long-running application finalized its loading, and before the regular work is started. TODO: forks?
@@ -766,7 +763,6 @@ Allows to trace when some exception was `rescue`'d in the code of interest.
766763
```
767764
* **Notes:** The event-specific attribute for the event is the same as for `:raise`: <a class="ruby-doc" href="https://docs.ruby-lang.org/en/master/TracePoint.html#method-i-raised_exception"><code>#raised_exception</code></a>.
768765

769-
770766
## Standard library[](#standard-library)
771767

772768
Since Ruby 3.1 release, most of the standard library is extracted to either _default_ or _bundled_ gems; their development happens in separate repositories, and changelogs are either maintained there, or absent altogether. Either way, their changes aren't mentioned in the combined Ruby changelog, and I'll not be trying to follow all of them.

_src/3.3.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ The method now requires fully-specified date-time string.
343343
# Ruby 3.3:
344344
# in `unpack': unknown pack directive 'r' in 'r*' (ArgumentError)
345345
```
346-
* **Notes:**
347346

348347
### Enumerables and collections
349348

@@ -428,7 +427,6 @@ A new "weak map" concept implementation. Unlike `ObjectSpace::WeakMap`, it compa
428427
files_to_close.delete(file2) { puts "Already removed"; 0 }
429428
# Prints nothing, returns true
430429
```
431-
* **Notes:**
432430

433431
#### `Thread::Queue#freeze` and `SizedQueue#freeze` raise `TypeError`
434432

@@ -731,7 +729,6 @@ A new warning category was introduced for a code that is correct but is known to
731729
* The warning category should be turned on explicitly by providing `-W:performance` CLI option or `Warning[:performance] = true` from the program.
732730
* **Additional reading:** [Performance impact of the memoization idiom on modern Ruby](https://railsatscale.com/2023-10-24-memoization-pattern-and-object-shapes/) by Ruby core team member Jean Boussier.
733731

734-
735732
#### `Process.warmup`
736733

737734
A method to call when a long-running application finalized its loading, and before the regular work is started. TODO: forks?
@@ -766,7 +763,6 @@ Allows to trace when some exception was `rescue`'d in the code of interest.
766763
```
767764
* **Notes:** The event-specific attribute for the event is the same as for `:raise`: [#raised_exception](https://docs.ruby-lang.org/en/master/TracePoint.html#method-i-raised_exception).
768765

769-
770766
## Standard library
771767

772768
Since Ruby 3.1 release, most of the standard library is extracted to either _default_ or _bundled_ gems; their development happens in separate repositories, and changelogs are either maintained there, or absent altogether. Either way, their changes aren't mentioned in the combined Ruby changelog, and I'll not be trying to follow all of them.

_src/evolution.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ end
266266
class HTTP
267267
end
268268
```
269+
* [3.3](3.3.md#moduleset_temporary_name) [Module#set_temporary_name](https://docs.ruby-lang.org/en/master/Module.html#method-i-set_temporary_name) to set a human-readable name for a module without assigning it to a constant.
270+
269271

270272
<!--
271273
* **2.0** `#define_method` accepts a UnboundMethod from a Module.
@@ -386,6 +388,7 @@ This section lists changes in how methods are defined and invoked, as well as ne
386388
[1, 2, 3].map { _1 * 100 } # => 100, 200, 300
387389
```
388390
* [3.2](3.2.md#procparameters-new-keyword-argument-lambda-truefalse) [Proc#parameters](https://docs.ruby-lang.org/en/3.2/Proc.html#method-i-parameters): new keyword argument `lambda: true/false`, improving introspection of whether arguments have default values or they are just optional because all `proc` arguments are.
391+
* [3.3](3.3.md#standalone-it-in-blocks-will-become-anonymous-argument-in-ruby-34) Added a warning that since 3.4, `it` would become a synonym for `_1`.
389392

390393
<!--
391394
* **2.1** Returning from lambda proc now always exits from the Proc, not from the method where the lambda is created. Returning from non-lambda proc exits from the method, same as the former behavior.
@@ -394,6 +397,8 @@ This section lists changes in how methods are defined and invoked, as well as ne
394397
* [3.0](3.0.md#kernellambda-warns-if-called-without-a-literal-block) `Kernel#lambda` warns if called without a literal block (—)
395398
* [3.0](3.0.md#proc-and-eql) Procs/lambdas: `Proc#==` and `#eql?` ([Proc#==](https://docs.ruby-lang.org/en/3.0.0/Proc.html#method-i-3D-3D))
396399
* [3.2](3.2.md#procdup-returns-an-instance-of-subclass) Core classes and modules: Procs and methods: `Proc#dup` returns an instance of subclass (—)
400+
* [3.3](3.3.md#kernellambda-raises-when-passed-proc-instance) Core classes and modules: `Kernel#lambda` raises when passed `Proc` instance ([Kernel#lambda](https://docs.ruby-lang.org/en/master/Kernel.html#method-i-lambda) _(no specific details are provided, though)_)
401+
* [3.3](3.3.md#procdup-and-clone-call-initialize_dup-and-initialize_copy) Core classes and modules: `Proc#dup` and `#clone` call `#initialize_dup` and `#initialize_copy` (— (Adheres to the behavior described for [Object#dup](https://docs.ruby-lang.org/en/master/Object.html#method-i-dup) and [#clone](https://docs.ruby-lang.org/en/master/Kernel.html#method-i-clone)))
397402
-->
398403

399404
## `Comparable`
@@ -511,13 +516,17 @@ Included in many classes to implement comparison methods. Once class defines a m
511516
Regexp.new('foo', 'im') #=> /foo/im
512517
```
513518
* [3.2](3.2.md#regexp-redos-vulnerability-prevention) ReDoS vulnerability prevention: [Regexp.timeout](https://docs.ruby-lang.org/en/3.2/Regexp.html#method-c-timeout), [Regexp.timeout=](https://docs.ruby-lang.org/en/3.2/Regexp.html#method-c-timeout-3D), [Regexp.new](https://docs.ruby-lang.org/en/3.2/Regexp.html#method-c-new) (`timeout:` keyword argument), [Regexp.linear_time?](https://docs.ruby-lang.org/en/3.2/Regexp.html#method-c-linear_time-3F).
519+
* [3.3](3.3.md#stringbytesplice-new-arguments-to-select-a-portion-of-the-replacement-string) [String#bytesplice](https://docs.ruby-lang.org/en/master/String.html#method-i-bytesplice): additional arguments to select a portion of the inserted string.
520+
* [3.3](3.3.md#matchdatanamed_captures-symbolize_names-argument) [MatchData#named_captures](https://docs.ruby-lang.org/en/master/MatchData.html#method-i-named_captures): `symbolize_names:` argument.
521+
514522

515523

516524
<!--
517525
* **2.0** Switch Regexp engine to [Onigmo](https://github.com/k-takata/Onigmo)
518526
* **2.1** `pack/unpack` (Array/String): `Q!` and `q!` directives for long long type if platform has the type.
519527
* [2.5](2.5.md#casecmp-and-casecmp-return-nil-for-non-string-arguments) `String#casecmp` and `#casecmp?` return `nil` for non-string arguments ([String#casecmp](https://ruby-doc.org/core-2.5.0/String.html#method-i-casecmp), [String#casecmp?](https://ruby-doc.org/core-2.5.0/String.html#method-i-casecmp-3F))
520528
* [3.0](3.0.md#string-always-returning-string) `String`: always returning `String` (—)
529+
* [3.3](3.3.md#arraypack-and-stringunpack-raise-argumenterror-for-unknown-directives) Core classes and modules: `Array#pack` and `String#unpack`: raise `ArgumentError` for unknown directives ([doc/packed_data.rdoc](https://docs.ruby-lang.org/en/master/packed_data_rdoc.html))
521530
-->
522531

523532
## `Struct`
@@ -581,6 +590,7 @@ Included in many classes to implement comparison methods. Once class defines a m
581590
* **2.0** `Time#to_s` now returns US-ASCII encoding instead of BINARY.
582591
* [2.7](2.7.md#inspect-includes-subseconds) `Time#inspect` includes subseconds ([Time#inspect](https://ruby-doc.org/core-2.7.0/Time.html#method-i-inspect))
583592
* [3.1](3.1.md#strftime-supports--0000-offset) `#strftime` supports `-00:00` offset ([Time#strftime](https://docs.ruby-lang.org/en/3.1/Time.html#method-i-strftime))
593+
* [3.3](3.3.md#timenew-with-string-argument-became-stricter) Core classes and modules: `Time.new` with string argument became stricter ([Time#new](https://docs.ruby-lang.org/en/master/Time.html#method-c-new))
584594
-->
585595

586596
## Enumerables, collections, and iteration
@@ -698,6 +708,9 @@ Included in many classes to implement comparison methods. Once class defines a m
698708
```
699709
* [2.6](2.6.md#rangecover-accepts-range-argument) [#cover?](https://docs.ruby-lang.org/en/2.6.0/Range.html#method-i-cover-3F) accepts range argument
700710
* [2.7](2.7.md#beginless-range) **Beginless range: `(...100)`**
711+
* [3.3](3.3.md#reverse_each) [Range#reverse_each](https://docs.ruby-lang.org/en/master/Range.html#method-i-reverse_each) (specialized form of `Enumerable#reverse_each`)
712+
* [3.3](3.3.md#overlap) [Range#overlap?](https://docs.ruby-lang.org/en/master/Range.html#method-i-overlap-3F)
713+
701714

702715
<!--
703716
* [2.7](2.7.md#for-string) `#===` for `String` ([Range#===](https://ruby-doc.org/core-2.7.0/Range.html#method-i-3D-3D-3D))
@@ -792,6 +805,11 @@ Included in many classes to implement comparison methods. Once class defines a m
792805
* [2.7](2.7.md#objectspaceweakmap-now-accepts-non-gc-able-objects) [ObjectSpace::WeakMap#[]=](https://ruby-doc.org/core-2.7.0/ObjectSpace/WeakMap.html#method-i-5B-5D-3D) now accepts non-GC-able objects
793806
* [3.1](3.1.md#threadqueueinitialize-initial-values-can-be-passed-to-initializer) [Thread::Queue.new](https://docs.ruby-lang.org/en/3.1/Thread/Queue.html#method-c-new) allows initial queue content to be passed
794807
* [3.2](3.2.md#threadqueue-timeouts-for-pop-and-push) [Thread::Queue#pop](https://docs.ruby-lang.org/en/3.2/Thread/Queue.html#method-i-pop), [Thread::SizedQueue#pop](https://docs.ruby-lang.org/en/3.2/Thread/SizedQueue.html#method-i-pop), and [Thread::SizedQueue#push](https://docs.ruby-lang.org/en/3.2/Thread/SizedQueue.html#method-i-push) have `timeout:` argument.
808+
* [3.3](3.3.md#objectspaceweakkeymap) [ObjectSpace::WeakKeyMap](https://docs.ruby-lang.org/en/master/ObjectSpace/WeakKeyMap.html) introduced
809+
* [3.3](3.3.md#objectspaceweakmapdelete) [ObjectSpace::WeakMap#delete](https://docs.ruby-lang.org/en/master/ObjectSpace/WeakMap.html#method-i-delete)
810+
* [3.3](3.3.md#threadqueuefreeze-and-sizedqueuefreeze-raise-typeerror) [Thread::Queue#freeze](https://docs.ruby-lang.org/en/master/Thread/Queue.html#method-i-freeze) and [Thread::SizedQueue#freeze](https://docs.ruby-lang.org/en/master/Thread/SizedQueue.html#method-i-freeze) raise `TypeError`.
811+
812+
795813

796814
## Filesystem and IO
797815

@@ -821,6 +839,10 @@ Included in many classes to implement comparison methods. Once class defines a m
821839
* [3.1](3.1.md#iobuffer) **[IO::Buffer](https://docs.ruby-lang.org/en/3.1/IO/Buffer.html) low-level class introduced**
822840
* [3.2](3.2.md#io-support-for-timeouts-for-blocking-io) Support for timeouts for blocking IO via [IO#timeout=](https://docs.ruby-lang.org/en/3.2/IO.html#method-i-timeout-3D).
823841
* [3.2](3.2.md#iopath) Generic [IO#path](https://docs.ruby-lang.org/en/3.2/IO.html#method-i-path) that can be assigned on [creation](https://docs.ruby-lang.org/en/3.2/IO.html#class-IO-label-Open+Options).
842+
* [3.3](3.3.md#dirfor_fd-and-dirfchdir) [Dir.for_fd](https://docs.ruby-lang.org/en/master/Dir.html#method-c-for_fd) and [Dir.fchdir](https://docs.ruby-lang.org/en/master/Dir.html#method-c-fchdir).
843+
* [3.3](3.3.md#dirchdir) [Dir#chdir](https://docs.ruby-lang.org/en/master/Dir.html#method-i-chdir).
844+
* [3.3](3.3.md#deprecate-subprocess-creation-with-method-dedicated-to-files) Create subprocesses with `IO.read('| command')` and similar methods is deprecated.
845+
824846

825847
<!--
826848
* **2.0** `File.fnmatch?` now expands braces in the pattern if File::FNM_EXTGLOB option is given.
@@ -882,6 +904,7 @@ This section covers exception raising/handling behavior changes, as well as chan
882904
* [2.5](2.5.md#backtrace-and-error-message-in-reverse-order) Backtrace and error message are (experimentally) displayed in a reverse order.
883905
* [2.6](2.6.md#exception-output-tweaking) Exception output tweaking (—)
884906
* [3.0](3.0.md#exception-output-order-is-changed----again) Exception output order is changed -- again (—)
907+
* [3.3](3.3.md#nomethoderror-change-of-rendering-logic) Core classes and modules: `NoMethodError`: change of rendering logic ([NoMethodError](https://docs.ruby-lang.org/en/master/NoMethodError.html))
885908
-->
886909

887910
### Warnings
@@ -892,6 +915,8 @@ This section covers exception raising/handling behavior changes, as well as chan
892915
* [2.5](2.5.md#warn-uplevel-keyword-argument) [Kernel#warn](https://ruby-doc.org/core-2.6/Kernel.html#method-i-warn): `uplevel:` keyword argument allows to tune which line to specify in warning message as a source of warning
893916
* [2.7](2.7.md#warning-and-) [Warning::[]](https://ruby-doc.org/core-2.7.0/Warning.html#method-c-5B-5D) and [Warning::[]=](https://ruby-doc.org/core-2.7.0/Warning.html#method-c-5B-5D-3D) to choose which categories of warnings to show; the categories are predefined by Ruby and only can be `:deprecated` or `:experimental` (or none)
894917
* <span class="ruby-version">[3.0](3.0.md#warningwarn-category-keyword-argument)</span> User code allowed to specify category of its warnings with [Kernel#warn](https://docs.ruby-lang.org/en/3.0.0/Kernel.html#method-i-warn) and intercept the warning category [Warning#warn](https://docs.ruby-lang.org/en/3.0.0/Warning.html#method-i-warn) with `category:` keyword argument; the list of categories is still closed.
918+
* [3.3](3.3.md#new-warning-category-performance) New `Warning` [category](https://docs.ruby-lang.org/en/master/Warning.html#method-c-5B-5D): `:performance`.
919+
895920

896921
## Concurrency and parallelism
897922

@@ -915,9 +940,12 @@ This section covers exception raising/handling behavior changes, as well as chan
915940
* **2.1** [.clock_gettime](https://docs.ruby-lang.org/en/2.1.0/Process.html#method-c-clock_gettime) and [.clock_getres](https://docs.ruby-lang.org/en/2.1.0/Process.html#method-c-clock_getres)
916941
* [2.5](2.5.md#processlast_status-as-an-alias-of-) [Process.last_status](https://ruby-doc.org/core-2.5.0/Process.html#method-c-last_status) as an alias of `$?`
917942
* [3.1](3.1.md#process_fork) [Process._fork](https://docs.ruby-lang.org/en/3.1/Process.html#method-c-_fork)
943+
* [3.3](3.3.md#processwarmup) [Process.warmup](https://docs.ruby-lang.org/en/master/Process.html#method-c-warmup)
944+
918945

919946
<!--
920947
* **2.2** Process execution methods such as [.spawn](https://docs.ruby-lang.org/en/2.2.0/Process.html#method-c-spawn) opens the file in write mode for redirect from `[:out, :err]`.
948+
* [3.3](3.3.md#processstatus--and--are-deprecated) Core classes and modules: Internals: `Process::Status#&` and `#>>` are deprecated ([Process::Status#&](https://docs.ruby-lang.org/en/master/Process/Status.html#method-i-26), [#>>](https://docs.ruby-lang.org/en/master/Process/Status.html#method-i-3E-3E))
921949
-->
922950

923951
### `Fiber`
@@ -931,6 +959,8 @@ This section covers exception raising/handling behavior changes, as well as chan
931959
* [3.2](3.2.md#fiberschedulerio_select) [#io_select](https://docs.ruby-lang.org/en/3.2/Fiber/Scheduler.html#method-i-io_select) hook added
932960
* [3.0](3.0.md#fiberbacktrace--backtrace_locations) [#backtrace](https://docs.ruby-lang.org/en/3.0.0/Fiber.html#method-i-backtrace) and [#backtrace_locations](https://docs.ruby-lang.org/en/3.0.0/Fiber.html#method-i-backtrace_locations)
933961
* [3.2](3.2.md#fiber-storage) **Storage concept**: [.[]](https://docs.ruby-lang.org/en/3.2/Fiber.html#method-c-5B-5D), [.[]=](https://docs.ruby-lang.org/en/3.2/Fiber.html#method-c-5B-5D-3D), [#storage](https://docs.ruby-lang.org/en/3.2/Fiber.html#method-i-storage), and [#storage=](https://docs.ruby-lang.org/en/3.2/Fiber.html#method-i-storage-3D)
962+
* [3.3](3.3.md#fiberkill) [Fiber#kill](https://docs.ruby-lang.org/en/master/Fiber.html#method-i-kill)
963+
934964

935965
<!--
936966
* [3.0](3.0.md#fibertransfer-limitations-changed) `#transfer` limitations changed ([Fiber#transfer](https://docs.ruby-lang.org/en/3.0.0/Fiber.html#method-i-transfer))
@@ -998,6 +1028,8 @@ _Note: in the spirit of the rest of this reference, this section only describes
9981028
* [3.1](3.1.md#tracepointallow_reentry) [.allow_reentry](https://docs.ruby-lang.org/en/3.1/TracePoint.html#method-c-allow_reentry)
9991029
* [3.2](3.2.md#tracepointbinding-returns-nil-for-c_callc_return) [TracePoint#binding](https://docs.ruby-lang.org/en/3.2/TracePoint.html#method-i-binding) returns `nil` for `c_call`/`c_return`
10001030
* [3.2](3.2.md#tracepoint-for-block-default-to-trace-the-current-thread) [TracePoint#enable](https://docs.ruby-lang.org/en/3.2/TracePoint.html#method-i-enable) with a block default to trace the current thread.
1031+
* [3.3](3.3.md#tracepoint-supports-rescue-event) [TracePoint](https://docs.ruby-lang.org/en/master/TracePoint.html#class-TracePoint-label-Events) supports `:rescue` event.
1032+
10011033

10021034
### `RubyVM::AbstractSyntaxTree`
10031035

@@ -1052,8 +1084,10 @@ Refinements are hygienic replacement for reopening of classes and modules. They
10521084
* [2.7](2.7.md#refinements-in-methodinstance_method) Refined methods are achievable with `#method`/`#instance_method`
10531085
* [3.1](3.1.md#refinement-class) **[Refinement](https://docs.ruby-lang.org/en/3.1/Refinement.html) class** representing the `self` inside the `refine` statement. In particular, new method [#import_methods](https://docs.ruby-lang.org/en/3.1/Refinement.html#method-i-import_methods) became available inside `#refine` providing some (incomplete) remedy for inability to `#include` modules while refining some class.
10541086
* [3.2](3.2.md#modulerefinements) [Module#refinements](https://docs.ruby-lang.org/en/3.2/Module.html#method-i-refinements) to introspect which refinements some module defines;
1055-
* [3.2](3.2.md#refinementrefined_class) [Refinement#refined_class](https://docs.ruby-lang.org/en/3.2/Refinement.html#method-i-refined_class) to see what class/module they refine; and
1056-
* [3.2](3.2.md#moduleused_refinements) [Module.used_refinements](https://docs.ruby-lang.org/en/3.2/Module.html#method-c-used_refinements) to check which refinements are active in the current context.
1087+
* [3.2](3.2.md#moduleused_refinements) [Module.used_refinements](https://docs.ruby-lang.org/en/3.2/Module.html#method-c-used_refinements) to check which refinements are active in the current context; and
1088+
* [3.2](3.2.md#refinementrefined_class) [Refinement#refined_class](https://docs.ruby-lang.org/en/3.2/Refinement.html#method-i-refined_class) to see what class/module they refine.
1089+
* [3.3](3.3.md#refinementrefined_class-is-renamed-to-refinementtarget) `Refinement#refined_class` is renamed to [Refinement#target](https://docs.ruby-lang.org/en/master/Refinement.html#method-i-target).
1090+
10571091

10581092
### Freezing
10591093

@@ -1093,4 +1127,4 @@ Freezing of object makes its state immutable. The important thing about freezing
10931127
* [3.0](3.0.md) — 2020
10941128
* [3.1](3.1.md) — 2021
10951129
* [3.2](3.2.md) — 2022
1096-
1130+
* [3.3](3.3.md) — 2023

0 commit comments

Comments
 (0)