2016-12-26 07:00:02 -05:00
|
|
|
# -*- rdoc -*-
|
|
|
|
|
|
|
|
= NEWS for Ruby 2.5.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.4.0 release
|
|
|
|
|
|
|
|
=== Language changes
|
|
|
|
|
2017-01-01 04:07:56 -05:00
|
|
|
* Top-level constant look-up is removed. [Feature #11547]
|
|
|
|
|
2017-01-19 04:54:58 -05:00
|
|
|
* rescue/else/ensure are allowed inside do/end blocks. [Feature #12906]
|
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== Core classes updates (outstanding ones only)
|
|
|
|
|
2017-04-05 20:14:57 -04:00
|
|
|
* Array
|
|
|
|
|
|
|
|
* Array#append [Feature #12746]
|
|
|
|
* Array#prepend [Feature #12746]
|
|
|
|
|
2017-05-23 09:47:36 -04:00
|
|
|
* Dir
|
|
|
|
|
|
|
|
* Dir.glob provides new optional keyword argument, :base.
|
2017-05-24 22:50:21 -04:00
|
|
|
[Feature #13056]
|
|
|
|
* Dir.children [Feature #11302]
|
|
|
|
* Dir.each_child [Feature #11302]
|
2017-05-23 09:47:36 -04:00
|
|
|
|
2017-07-14 06:53:35 -04:00
|
|
|
* File
|
|
|
|
|
|
|
|
* :newline option to File.open implies text mode now. [Bug #13350]
|
|
|
|
|
2017-02-26 19:53:26 -05:00
|
|
|
* Integer
|
|
|
|
|
|
|
|
* Integer.sqrt [Feature #13219]
|
2017-04-25 07:42:31 -04:00
|
|
|
* Integer#step does no longer rescue exceptions when given
|
|
|
|
a step value which cannot be compared with #> to 0. [Feature #7688]
|
2017-05-07 03:18:10 -04:00
|
|
|
* Integer#{round,floor,ceil,truncate} now always return an Integer.
|
|
|
|
[Bug #13420]
|
2017-02-26 19:53:26 -05:00
|
|
|
|
2017-04-02 20:10:50 -04:00
|
|
|
* IO
|
|
|
|
|
|
|
|
* IO#pread [Feature #4532]
|
|
|
|
* IO#pwrite [Feature #4532]
|
|
|
|
|
2017-04-09 01:09:44 -04:00
|
|
|
* IOError
|
|
|
|
|
|
|
|
* exception message "stream closed" is changed [Bug #13405]
|
|
|
|
|
2017-05-01 03:50:53 -04:00
|
|
|
* Kernel
|
|
|
|
|
|
|
|
* Kernel#yield_self [Feature #6721]
|
|
|
|
|
2017-04-25 07:42:20 -04:00
|
|
|
* Numeric
|
|
|
|
|
|
|
|
* Numerical comparison operators (<,<=,>=,>) no longer rescue exceptions
|
|
|
|
of #coerce. Return nil in #coerce if the coercion is impossible.
|
|
|
|
[Feature #7688]
|
|
|
|
|
process.c: Use getrusage(2) in Process.times
if getrusage(2) is available, to improve precision of Process.times and
its user like lib/benchmark.rb.
On macOS, since getrusage(2) has better precision than times(3),
they are much improved like:
* Before
Process.times
=> #<struct Process::Tms utime=0.56, stime=0.35, cutime=0.04, cstime=0.03>
puts Benchmark.measure { "a" * 1_000_000_000 }
0.340000 0.310000 0.650000 ( 0.674025)
* After
Process.times
=> #<struct Process::Tms utime=0.561899, stime=0.35076, cutime=0.046483, cstime=0.038929>
puts Benchmark.measure { "a" * 1_000_000_000 }
0.343223 0.310037 0.653260 ( 0.674025)
On Linux, since struct rusage from getrusage(2) is used instead of struct tms
from times(2), they are slightly improved like:
* Before
Process.times
=> #<struct Process::Tms utime=0.43, stime=0.11, cutime=0.0, cstime=0.0>
puts Benchmark.measure { "a" * 1_000_000_000 }
0.120000 0.040000 0.170000 ( 0.171621)
* After
Process.times
=> #<struct Process::Tms utime=0.432, stime=0.116, cutime=0.0, cstime=0.0>
puts Benchmark.measure { "a" * 1_000_000_000 }
0.124000 0.048000 0.172000 ( 0.171621)
[ruby-dev:49471] [Feature #11952]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:48:11 -04:00
|
|
|
* Process
|
|
|
|
|
|
|
|
* Precision of Process.times is improved if getrusage(2) exists. [Feature #11952]
|
|
|
|
|
2017-04-25 07:42:43 -04:00
|
|
|
* Range
|
|
|
|
* Range#initialize no longer rescue exceptions when comparing begin and
|
|
|
|
end with #<=> and raise a "bad value for range" ArgumentError
|
|
|
|
but instead let the exception from the #<=> call go through.
|
|
|
|
[Feature #7688]
|
|
|
|
|
2017-02-11 10:08:33 -05:00
|
|
|
* Regexp
|
|
|
|
* Update Onigmo 6.1.1.
|
|
|
|
* Support absent operator https://github.com/k-takata/Onigmo/issues/82
|
|
|
|
|
2017-02-22 02:16:13 -05:00
|
|
|
* Thread
|
|
|
|
|
|
|
|
* Thread#fetch [Feature #13009]
|
|
|
|
|
2017-02-24 21:31:03 -05:00
|
|
|
* String
|
|
|
|
|
|
|
|
* String#-@ deduplicates unfrozen strings. Already-frozen
|
|
|
|
strings remain unchanged for compatibility. [Feature #13077]
|
2017-03-16 19:17:14 -04:00
|
|
|
* -"literal" (String#-@) optimized to return the same object
|
2017-03-26 06:21:45 -04:00
|
|
|
(same as "literal".freeze in Ruby 2.1+) [Feature #13295]
|
2017-05-21 15:29:58 -04:00
|
|
|
* String#{casecmp,casecmp?} now return nil for non-string arguments
|
|
|
|
instead of raising a TypeError. [Bug #13312]
|
2017-06-21 06:06:44 -04:00
|
|
|
* String#delete_prefix is added to remove prefix [Feature #12694]
|
2017-06-21 03:43:26 -04:00
|
|
|
* String#delete_prefix! is added to remove prefix destructively [Feature #12694]
|
2017-02-24 21:31:03 -05:00
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
|
|
|
|
2017-05-19 12:06:18 -04:00
|
|
|
* Net::HTTP
|
|
|
|
* Add more HTTP status classes
|
|
|
|
|
2017-05-19 12:06:25 -04:00
|
|
|
* Net::HTTP::STATUS_CODES is added as HTTP Status Code Repository [Misc #12935]
|
|
|
|
|
2017-04-23 12:19:23 -04:00
|
|
|
* Net::HTTP#proxy_user and Net::HTTP#proxy_pass now reflects http_proxy
|
|
|
|
environment variable if the system's environment variable is multiuser
|
|
|
|
safe. [Bug #12921]
|
|
|
|
|
2017-04-05 22:10:40 -04:00
|
|
|
* RbConfig
|
|
|
|
* New constants:
|
|
|
|
* RbConfig::LIMITS is added to provide the limits of C types.
|
|
|
|
|
2017-05-20 13:36:09 -04:00
|
|
|
* ERB
|
2017-05-25 11:43:49 -04:00
|
|
|
* Add ERB#result_with_hash to render a template with local variables passed
|
|
|
|
with a Hash object. [Feature #8631]
|
|
|
|
|
2017-05-20 13:36:09 -04:00
|
|
|
* Carriage returns are changed to be trimmed properly if trim_mode is specified
|
2017-05-25 11:43:49 -04:00
|
|
|
and used. Duplicated newlines will be removed on Windows. [Bug #5339] [Bug #11464]
|
2017-05-20 13:36:09 -04:00
|
|
|
|
2017-07-14 04:46:13 -04:00
|
|
|
* Set
|
|
|
|
* Add Set#to_s as alias to #inspect [Feature #13676]
|
|
|
|
|
2017-07-07 13:41:08 -04:00
|
|
|
* WEBrick
|
|
|
|
|
|
|
|
* Add Server Name Indication (SNI) support [Feature #13729]
|
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== Compatibility issues (excluding feature bug fixes)
|
|
|
|
|
2017-05-19 11:13:42 -04:00
|
|
|
* Net::HTTP
|
|
|
|
* Net::HTTP#start now pass :ENV to p_addr by default. [Bug #13351]
|
|
|
|
To avoid this, pass nil explicitly.
|
|
|
|
|
2017-02-27 08:41:38 -05:00
|
|
|
* Random.raw_seed renamed to become Random.urandom. It is now
|
|
|
|
applicable to non-seeding purposes due to [Bug #9569].
|
|
|
|
|
2017-04-18 21:08:16 -04:00
|
|
|
* BasicSocket#read_nonblock and BasicSocket#write_nonblock no
|
|
|
|
longer sets the O_NONBLOCK file description flag as side effect
|
2017-07-07 13:59:09 -04:00
|
|
|
(on Linux only) [Feature #13362]
|
2017-04-18 21:08:16 -04:00
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
|
|
|
|
2017-04-21 02:16:11 -04:00
|
|
|
* mathn.rb
|
|
|
|
Removed from stdlib. [Feature #10169]
|
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== C API updates
|
|
|
|
|
|
|
|
=== Supported platform changes
|
|
|
|
|
|
|
|
=== Implementation improvements
|
|
|
|
|
2017-01-21 23:02:42 -05:00
|
|
|
* (This might not be a "user visible feature change" but) Hash class's
|
|
|
|
hash function is now SipHash13. [Feature #13017]
|
|
|
|
|
2017-01-21 23:14:21 -05:00
|
|
|
* SecureRandom now prefers OS-provided sources than OpenSSL. [Bug #9569]
|
|
|
|
|
2016-12-26 07:00:02 -05:00
|
|
|
=== Miscellaneous changes
|
2017-04-21 01:35:34 -04:00
|
|
|
|
2017-05-19 02:14:43 -04:00
|
|
|
* Print backtrace and error message in reverse order if STDERR is unchanged and a tty.
|
|
|
|
[Feature #8661] [experimental]
|
|
|
|
|
2017-04-21 01:35:34 -04:00
|
|
|
* configure option --with-ext now mandates its arguments. So for
|
|
|
|
instance if you run ./configure --with-ext=openssl,+ then the
|
|
|
|
openssl library is guaranteed compiled, otherwise the build fails
|
|
|
|
abnormally.
|
|
|
|
|
|
|
|
Note however to always add the ",+" at the end of the argument.
|
|
|
|
Otherwise nothing but openssl are built. [Feature #13302]
|