You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2.7.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ description: Ruby 2.7 full and annotated changelog
8
8
# Ruby 2.7
9
9
10
10
***Released at:** Dec 25, 2019 (<aclass="github"href="https://github.com/ruby/ruby/blob/ruby_2_7/NEWS">NEWS</a> file)
11
-
***Status (as of Sep 20, 2023):** 2.7.8 is EOL
11
+
***Status (as of Dec 21, 2023):** 2.7.8 is EOL
12
12
***This document first published:** Dec 27, 2019
13
-
***Last change to this document:**Sep 20, 2023
13
+
***Last change to this document:**Dec 21, 2023
14
14
15
15
<!-- TODO: all links to docs should be replaced with /2.7.0/ suffix instead of /master/ when 2.7.0 would be published -->
16
16
@@ -121,7 +121,9 @@ In block without explicitly specified parameters, variables `_1` through `_9` ca
121
121
# %w[test me].each { _1.each_char { p _1 } }
122
122
# ^~
123
123
```
124
-
***Follow-up:** Warning on attempt to assign to numbered parameter [became errors in 3.0](3.0.html#other-changes).
124
+
***Follow-ups:**
125
+
*[3.0](3.0.html#other-changes): Warning on attempt to assign to numbered parameter became errors.
126
+
*[3.3](3.3.html#standalone-it-in-blocks-will-become-anonymous-argument-in-ruby-34): a warning introduced indicating that in Ruby 3.4, `it` would become an alternative anonymous block parameter (only one, same as `_1`). There is no plan to deprecate numbered parameters.
125
127
126
128
### Beginless range[](#beginless-range)
127
129
@@ -799,6 +801,7 @@ Like `Array#union` and `#difference`, [added](2.6.html#arrayunion-and-arraydiffe
799
801
map[1]
800
802
# => nil -- value successfully collected, even if key was not GC-able
801
803
```
804
+
***Follow-ups:**[3.3](3.3.html#objectspaceweakkeymap): A new class `ObjectSpace::WeakKeyMap` introduced, more suitable for common use-cases of a "weak mapping." It only has garbage-collectable keys.
802
805
803
806
### `Fiber#raise`[](#fiberraise)
804
807
@@ -1028,7 +1031,7 @@ Allows to emit/suppress separate categories of warnings.
1028
1031
```
1029
1032
***Notes:**
1030
1033
* The only existing categories currently are `:deprecated` (covers all deprecations) and `:experimental` (as of 2.7, covers only pattern matching)
1031
-
* Note that turning of`:deprecated` warning will also mute the warning of features which was deprecated explicitly in your code, for example with <aclass="ruby-doc"href="https://ruby-doc.org/core-2.7.0/Module.html#method-i-deprecate_constant"><code>Module#deprecate_constant</code></a>
1034
+
* Note that turning off`:deprecated` warning will also mute the warning of features which was deprecated explicitly in your code, for example with <aclass="ruby-doc"href="https://ruby-doc.org/core-2.7.0/Module.html#method-i-deprecate_constant"><code>Module#deprecate_constant</code></a>
1032
1035
```ruby
1033
1036
classHTTP
1034
1037
NOT_FOUND=Exception.new
@@ -1041,7 +1044,9 @@ Allows to emit/suppress separate categories of warnings.
1041
1044
# ...no warning issued...
1042
1045
```
1043
1046
*Another way to turn on and off separate categories of warnings is passing `-W:(no-)<category>` flag to ruby interpreter, e.g. `-W:no-experimental` means "no warnings when using experimental features".
1044
-
***Follow-up:**InRuby3.0, it was [allowed for user code](3.0.html#warningwarn-category-keyword-argument) to specify warning category, and intercept it.
1047
+
***Follow-ups:**
1048
+
* [3.0](3.0.html#warningwarn-category-keyword-argument): user code is allowed to specify warning category, and intercept it;
1049
+
* [3.3](3.3.html#new-warning-category-performance): added new warning category: `:performance`.
* The adjustment was considered important enough to be backported to 2.7 branch;
108
109
* "all arguments splat" `...` should be the last statement in the argument list (both on a declaration and a call)
109
110
* on a method declaration, arguments before `...` can only be positional (not keyword) arguments, and can't have default values (it would be `SyntaxError`);
110
111
* on a method call, arguments passed before `...` can't be keyword arguments (it would be `SyntaxError`);
@@ -960,6 +961,7 @@ Just fixes an inconsistency introduced by optimization many versions ago.
960
961
processed.lambda? # => false
961
962
processed.call # => "nil", it is really still not a lambda
962
963
```
964
+
***Follow-ups:**[3.3](3.3.html#kernellambda-raises-when-passed-proc-instance): The warning was turned into an exception.
Copy file name to clipboardExpand all lines: 3.2.md
+21-27Lines changed: 21 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
title: Ruby 3.2 changes
3
-
prev: /
3
+
prev: 3.3
4
4
next: 3.1
5
5
description: Ruby 3.2 full and annotated changelog
6
6
---
7
7
8
8
# Ruby 3.2
9
9
10
10
***Released at:** Dec 25, 2022 (<aclass="github"href="https://github.com/ruby/ruby/blob/ruby_3_2/NEWS.md">NEWS.md</a> file)
11
-
***Status (as of Sep 20, 2023):** 3.2.2 is current _stable_
11
+
***Status (as of Dec 24, 2023):** 3.2.2 is current _stable_
12
12
***This document first published:** Feb 4, 2022
13
-
***Last change to this document:**Sep 20, 2023
13
+
***Last change to this document:**Dec 24, 2023
14
14
15
15
<!--
16
16
* **Reason:**
@@ -249,12 +249,12 @@ A few edge cases after [big keyword argument separation](3.0.html#keyword-argume
249
249
### Removals[](#removals)
250
250
251
251
* Constants:
252
-
*`Fixnum` and `Bignum` (deprecated since unification into `Integer` in [2.4](/2.4.html#fixnum-and-bignum-are-unified-into-integer))
253
-
*`Random::DEFAULT` (deprecated in favor of per-Ractor random generator since [3.0](/3.0.html#randomdefault-behavior-change))
252
+
*`Fixnum` and `Bignum` (deprecated since unification into `Integer` in [2.4](2.4.html#fixnum-and-bignum-are-unified-into-integer))
253
+
*`Random::DEFAULT` (deprecated in favor of per-Ractor random generator since [3.0](3.0.html#randomdefault-behavior-change))
254
254
* Methods:
255
255
*`Dir.exists?`, `File.exists?` (deprecated since 2.1 as a general rule of having "bare verb" as a method name)
256
-
*`Object#=~` (deprecated since [2.6](/2.6.html#minor-changes))
257
-
*`Object#taint`, `#untaint`, `#tainted?`, `#trust`, `#untrust`, `#untrusted?` (deprecated together with a general concept of "safety" since [2.7](/2.7.html#safe-and-taint-concepts-are-deprecated-in-general))
256
+
*`Object#=~` (deprecated since [2.6](2.6.html#minor-changes))
257
+
*`Object#taint`, `#untaint`, `#tainted?`, `#trust`, `#untrust`, `#untrusted?` (deprecated together with a general concept of "safety" since [2.7](2.7.html#safe-and-taint-concepts-are-deprecated-in-general))
258
258
259
259
260
260
## Core classes and modules[](#core-classes-and-modules)
@@ -504,20 +504,7 @@ Returns list of refinements the module defines.
***Code:**See example above that demonstrates usage of `#refined_class` together with `Module#refinements`.
507
-
***Note:**The name of the method implies only classes can be refined, which is nottrue; modules can be refined also, and`refined_class` will promptly returnthem:
Currently [discussed](https://bugs.ruby-lang.org/issues/19366).
507
+
***Follow-ups:** [3.3](3.3.html#refinementrefined_class-is-renamed-to-refinementtarget): Renamed to `#target`, because not only classes can be refined, modules too.
@@ -622,7 +609,9 @@ Several method were added that operate on multibyte strings at byte-offset level
622
609
str.byteslice(1..3) #=> "\xB2і" -- works, even if the slice is mid-character
623
610
str.bytesplice(1..3, '...') # offset 1 does not land on character boundary (IndexError)
624
611
```
625
-
* **Note:** After 3.2 release, `bytesplice` behavior [had changed](https://bugs.ruby-lang.org/issues/19314#note-8) to return `self` instead of replacement string.
612
+
* **Note:**
613
+
* After 3.2 release, `bytesplice` behavior [had changed](https://bugs.ruby-lang.org/issues/19314#note-8) to return `self` instead of replacement string.
614
+
* [3.3](3.3.html#stringbytesplice-new-arguments-to-select-a-portion-of-the-replacement-string): parameters added to `bytesplice` to allow partial copy of the buffer.
626
615
627
616
#### `String#dedup` as an alias for `-"string"`[](#stringdedup-as-an-alias-for--string)
628
617
@@ -753,6 +742,7 @@ The new protocol for `Time.new` is introduced, that parses Time from string.
753
742
#=> 2023-01-29 00:00:00 +0200
754
743
```
755
744
*`Time.new('2023')` works, too, but it is a feature that worked before (force-conversion of singular year argument to integer), see <aclass="tracker bug"href="https://bugs.ruby-lang.org/issues/19293">Bug #19293</a>. It will probably be deprecated, but can't be quickly removed due to backward compatibility.
745
+
***Follow-ups:**: [3.3](3.3.html#timenew-with-string-argument-became-stricter): `Time.new` became stricting, accepting only fully-specified date-time.
756
746
757
747
### `Struct` and `Data`[](#struct-and-data)
758
748
@@ -891,7 +881,8 @@ A new class for containing value objects: it is somewhat similar to `Struct` (an
891
881
res
892
882
#=> #<data Result array=[4, 3, 2, 1]>
893
883
```
894
-
*`#with` method inRuby3.2 is naive and just copies all old andnew attributes to the new instance, without invoking any custom initialization methods. In the next version, though, it [expected to call `#initialize`](https://bugs.ruby-lang.org/issues/19259):
884
+
***Follow-ups:**
885
+
*`#with` method inRuby3.2.0 was naive and just copies all old andnew attributes to the new instance, without invoking any custom initialization methods. It was fixed to [call `#initialize`](https://bugs.ruby-lang.org/issues/19259) in3.2.2:
@@ -1127,7 +1118,8 @@ Previously a part of standard library, Set (a collection of unique elements) was
1127
1118
t.tag #=> 'test'
1128
1119
t.dup.tag #=> nil
1129
1120
```
1130
-
This is a [bug](https://bugs.ruby-lang.org/issues/19362) and will probably <a class="github" href="https://github.com/ruby/ruby/pull/7178">change</a> in Ruby 3.2.2.
1121
+
This is a [bug](https://bugs.ruby-lang.org/issues/19362).
#### `Proc#parameters`: new keyword argument `lambda: true/false`[](#procparameters-new-keyword-argument-lambda-truefalse)
1133
1125
@@ -1162,7 +1154,7 @@ Previously a part of standard library, Set (a collection of unique elements) was
1162
1154
1163
1155
#### `Method#public?`, `#protected?`, and `#private?` are removed[](#methodpublic-protected-and-private-are-removed)
1164
1156
1165
-
Predicates to check method visibility added in Ruby 3.1 were reverted.
1157
+
Predicates to check method visibility [added in Ruby 3.1](3.1.html#methodunboundmethod-public-private-protected) were reverted.
1166
1158
1167
1159
* **Reason:** The new feature implementation have led to several bugs with `Method` class behavior; while investigating the root cause for those bugs, Matz have decided that method's visibility is not its inherent property, but rather a property of the module/object that owns the method, and as such, is already present in form of `Module#{private,public,protected}_instance_methods`and`Object#{private,public,protected}_methods`
@@ -1825,6 +1817,8 @@ A few changes to mention, though:
1825
1817
1826
1818
### Standard library content changes[](#standard-library-content-changes)
1827
1819
1820
+
#### New libraries[](#new-libraries)
1821
+
1828
1822
* <aclass="github"href="https://github.com/ruby/syntax_suggest">syntax_suggest</a> (formerly `dead_end`) gem added. It provides helpful error messages for wrong syntax, trying to guess the place of the error. For example, assuming this `test.rb`:
0 commit comments