2015-12-24 20:25:26 +03:00
|
|
|
# -*- rdoc -*-
|
|
|
|
|
|
|
|
= NEWS for Ruby 2.4.0
|
|
|
|
|
|
|
|
This document is a list of user visible feature changes made between
|
|
|
|
releases except for bug fixes.
|
|
|
|
|
|
|
|
Note that each entry is kept so brief that no reason behind or
|
|
|
|
reference information is supplied with. For a full list of changes
|
|
|
|
with all sufficient information, see the ChangeLog file or Redmine
|
|
|
|
(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
|
|
|
|
|
|
|
|
== Changes since the 2.3.0 release
|
|
|
|
|
|
|
|
=== Language changes
|
|
|
|
|
2016-04-13 08:36:26 +03:00
|
|
|
* Multiple assignment in conditional expression is now allowed.
|
|
|
|
[Feature #10617]
|
|
|
|
|
2015-12-24 20:25:26 +03:00
|
|
|
=== Core classes updates (outstanding ones only)
|
|
|
|
|
2016-03-17 15:49:19 +03:00
|
|
|
* Array
|
2016-04-15 04:17:51 +03:00
|
|
|
|
2016-03-17 15:49:19 +03:00
|
|
|
* Array#max and Array#min. [Feature #12172]
|
|
|
|
This may cause a tiny incompatibility: if you redefine
|
|
|
|
Enumerable#max and call max to an Array, your redefinition will be
|
|
|
|
now ignored. You should also redefine Array#max.
|
|
|
|
|
2016-04-13 17:55:18 +03:00
|
|
|
* Array#sum [Feature #12217]
|
|
|
|
|
2016-02-16 11:34:47 +03:00
|
|
|
* Dir
|
|
|
|
|
2016-02-16 15:25:54 +03:00
|
|
|
* Dir.empty?. [Feature #10121]
|
2016-02-16 11:34:47 +03:00
|
|
|
|
2016-04-13 09:14:12 +03:00
|
|
|
* File
|
|
|
|
|
|
|
|
* File.empty?. [Feature #9969]
|
|
|
|
|
2016-04-15 04:17:51 +03:00
|
|
|
* Float
|
|
|
|
|
2016-04-18 06:56:33 +03:00
|
|
|
* Float#ceil, Float#floor, and Float#truncate now take an optional
|
|
|
|
digits, as well as Float#round. [Feature #12245]
|
2016-04-15 04:17:51 +03:00
|
|
|
|
|
|
|
* Integer
|
|
|
|
|
2016-04-18 06:55:33 +03:00
|
|
|
* Integer#ceil, Integer#floor, and Integer#truncate now take an optional
|
|
|
|
digits, as well as Integer#round. [Feature #12245]
|
2016-04-15 04:17:51 +03:00
|
|
|
|
2016-02-17 06:21:35 +03:00
|
|
|
* String
|
|
|
|
|
|
|
|
* String.new(capacity: size) [Feature #12024]
|
|
|
|
|
2016-02-21 07:52:04 +03:00
|
|
|
* Symbol
|
|
|
|
|
|
|
|
* Symbol#match now returns MatchData. [Bug #11991]
|
|
|
|
|
2016-02-18 08:29:18 +03:00
|
|
|
* MatchData
|
|
|
|
|
|
|
|
* MatchData#named_captures [Feature #11999]
|
|
|
|
|
2015-12-24 20:25:26 +03:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
|
|
|
|
2016-01-01 16:02:56 +03:00
|
|
|
* CSV
|
2016-04-15 04:17:51 +03:00
|
|
|
|
2016-01-01 16:02:56 +03:00
|
|
|
* Add a liberal_parsing option. [Feature #11839]
|
|
|
|
|
2016-04-19 06:55:13 +03:00
|
|
|
* Logger
|
|
|
|
|
|
|
|
* Allow specifying logger parameters in constructor such
|
|
|
|
as level, progname, datetime_format, formatter. [Feature #12224]
|
|
|
|
* Add shift_period_suffix option. [Feature #10772]
|
|
|
|
|
2016-01-06 11:23:10 +03:00
|
|
|
* optparse
|
2016-04-15 04:17:51 +03:00
|
|
|
|
2016-01-06 11:23:10 +03:00
|
|
|
* Add an into option. [Feature #11191]
|
|
|
|
|
2016-04-15 18:26:48 +03:00
|
|
|
=== Compatibility issues (excluding feature bug fixes)
|
|
|
|
|
|
|
|
* Array#sum is implemented. Ruby itself has no compatibility problem
|
|
|
|
because Ruby didn't have sum method for arrays before Ruby 2.4.
|
|
|
|
However many third party gems, activesupport, facets, simple_stats, etc,
|
|
|
|
defines sum method. These implementations are mostly compatible but
|
|
|
|
there are subtle differences.
|
|
|
|
Ruby's sum method should be mostly compatible but it is impossible to
|
|
|
|
be perfectly compatible with all of them.
|
2015-12-24 20:25:26 +03:00
|
|
|
|
2016-04-23 07:23:29 +03:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
|
|
|
|
2016-04-23 07:27:12 +03:00
|
|
|
* Time
|
|
|
|
|
|
|
|
* Time#to_time now preserves timezone. [Bug #12271]
|
|
|
|
|
2016-04-23 07:23:29 +03:00
|
|
|
* DateTime
|
|
|
|
|
|
|
|
* DateTime#to_time now preserves timezone. [Bug #12189]
|
|
|
|
|
2015-12-24 20:25:26 +03:00
|
|
|
=== C API updates
|
|
|
|
|
2016-01-07 05:34:33 +03:00
|
|
|
* ruby_show_version() will no longer exits the process, if
|
|
|
|
RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0. This will be the default in
|
|
|
|
the future.
|
|
|
|
|
2015-12-24 20:25:26 +03:00
|
|
|
=== Supported platform changes
|
|
|
|
|
|
|
|
=== Implementation improvements
|
2016-03-17 15:49:19 +03:00
|
|
|
|
|
|
|
* In some condition, `[x, y].max` and `[x, y].min` are optimized
|
|
|
|
so that a temporal array is not created. The concrete condition is
|
|
|
|
an implementation detail: currently, the array literal must have no
|
|
|
|
splat, must have at least one expression but literal, the length must
|
|
|
|
be <= 0x100, and Array#max and min must not be redefined. It will work
|
|
|
|
in most casual and real-life use case where it is written with intent
|
|
|
|
to `Math.max(x, y)`.
|