2016-12-26 15:00:02 +03: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 12:07:56 +03:00
|
|
|
* Top-level constant look-up is removed. [Feature #11547]
|
|
|
|
|
2017-01-19 12:54:58 +03:00
|
|
|
* rescue/else/ensure are allowed inside do/end blocks. [Feature #12906]
|
|
|
|
|
2017-09-18 05:27:13 +03:00
|
|
|
* refinements take place in string interpolations. [Feature #13812]
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Core classes updates (outstanding ones only)
|
|
|
|
|
2017-04-06 03:14:57 +03:00
|
|
|
* Array
|
|
|
|
|
|
|
|
* Array#append [Feature #12746]
|
|
|
|
* Array#prepend [Feature #12746]
|
|
|
|
|
2017-11-29 11:23:16 +03:00
|
|
|
* Data
|
|
|
|
|
|
|
|
* Now deprecated [Feature #3072]
|
|
|
|
|
2017-05-23 16:47:36 +03:00
|
|
|
* Dir
|
|
|
|
|
|
|
|
* Dir.glob provides new optional keyword argument, :base.
|
2017-05-25 05:50:21 +03:00
|
|
|
[Feature #13056]
|
|
|
|
* Dir.children [Feature #11302]
|
|
|
|
* Dir.each_child [Feature #11302]
|
2017-05-23 16:47:36 +03:00
|
|
|
|
2017-07-14 13:53:35 +03:00
|
|
|
* File
|
|
|
|
|
|
|
|
* :newline option to File.open implies text mode now. [Bug #13350]
|
2017-08-31 14:22:15 +03:00
|
|
|
* File#path now raises an IOError for files opened with
|
|
|
|
File::Constants::TMPFILE option. [Feature #13568]
|
2017-10-02 00:29:27 +03:00
|
|
|
* File.stat, File.exist?, and other rb_stat()-using methods release GVL
|
|
|
|
[Bug #13941]
|
|
|
|
* File.rename releases GVL [Feature #13951]
|
2017-11-29 12:59:20 +03:00
|
|
|
* Add File.lutime [Feature #4052]
|
2017-07-14 13:53:35 +03:00
|
|
|
|
2017-07-19 16:59:58 +03:00
|
|
|
* Hash
|
|
|
|
|
|
|
|
* Hash#transform_keys [Feature #13583]
|
|
|
|
* Hash#transform_keys! [Feature #13583]
|
2017-10-21 09:11:01 +03:00
|
|
|
* Hash#slice [Feature #8499]
|
2017-07-19 16:59:58 +03:00
|
|
|
|
2017-04-03 03:10:50 +03:00
|
|
|
* IO
|
|
|
|
|
|
|
|
* IO#pread [Feature #4532]
|
|
|
|
* IO#pwrite [Feature #4532]
|
2017-10-21 17:25:46 +03:00
|
|
|
* IO#copy_stream tries copy offload with copy_file_range(2) [Feature #13867]
|
2017-10-23 09:05:46 +03:00
|
|
|
* IO#write accepts multiple arguments [Feature #9323]
|
2017-04-03 03:10:50 +03:00
|
|
|
|
2017-04-09 08:09:44 +03:00
|
|
|
* IOError
|
|
|
|
|
|
|
|
* exception message "stream closed" is changed [Bug #13405]
|
|
|
|
|
2017-07-19 18:01:01 +03:00
|
|
|
* Integer
|
|
|
|
|
|
|
|
* Integer.sqrt [Feature #13219]
|
|
|
|
* Integer#step does no longer rescue exceptions when given
|
|
|
|
a step value which cannot be compared with #> to 0. [Feature #7688]
|
|
|
|
* Integer#{round,floor,ceil,truncate} now always return an Integer.
|
|
|
|
[Bug #13420]
|
|
|
|
|
2017-05-01 10:50:53 +03:00
|
|
|
* Kernel
|
|
|
|
|
|
|
|
* Kernel#yield_self [Feature #6721]
|
|
|
|
|
2017-09-28 13:51:37 +03:00
|
|
|
* Net::HTTP
|
|
|
|
|
|
|
|
* Net::HTTP.new supports no_proxy parameter [Feature #11195]
|
2017-10-21 19:25:22 +03:00
|
|
|
* Net::HTTP#min_version/max_version [Feature #9450]
|
2017-09-28 13:51:37 +03:00
|
|
|
|
2017-04-25 14:42:20 +03: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-28 04:48:11 +03:00
|
|
|
* Process
|
|
|
|
|
|
|
|
* Precision of Process.times is improved if getrusage(2) exists. [Feature #11952]
|
|
|
|
|
2017-04-25 14:42:43 +03: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 18:08:33 +03:00
|
|
|
* Regexp
|
2017-09-06 11:19:12 +03:00
|
|
|
* Update to Onigmo 6.1.1.
|
2017-02-11 18:08:33 +03:00
|
|
|
* Support absent operator https://github.com/k-takata/Onigmo/issues/82
|
|
|
|
|
2017-02-25 05:31:03 +03:00
|
|
|
* String
|
|
|
|
|
|
|
|
* String#-@ deduplicates unfrozen strings. Already-frozen
|
|
|
|
strings remain unchanged for compatibility. [Feature #13077]
|
2017-03-17 02:17:14 +03:00
|
|
|
* -"literal" (String#-@) optimized to return the same object
|
2017-03-26 13:21:45 +03:00
|
|
|
(same as "literal".freeze in Ruby 2.1+) [Feature #13295]
|
2017-05-21 22:29:58 +03:00
|
|
|
* String#{casecmp,casecmp?} now return nil for non-string arguments
|
|
|
|
instead of raising a TypeError. [Bug #13312]
|
2017-06-21 13:06:44 +03:00
|
|
|
* String#delete_prefix is added to remove prefix [Feature #12694]
|
2017-06-21 10:43:26 +03:00
|
|
|
* String#delete_prefix! is added to remove prefix destructively [Feature #12694]
|
2017-07-20 19:29:20 +03:00
|
|
|
* String#delete_suffix is added to remove suffix [Feature #13665]
|
|
|
|
* String#delete_suffix! is added to remove suffix destructively [Feature #13665]
|
2017-08-31 09:35:28 +03:00
|
|
|
* String#each_grapheme_cluster and String#grapheme_clusters is added to
|
|
|
|
enumerate grapheme clusters [Feature #13780]
|
2017-10-21 09:51:01 +03:00
|
|
|
* String#start_with? supports regexp [Feature #13712]
|
2017-02-25 05:31:03 +03:00
|
|
|
|
2017-11-02 23:25:37 +03:00
|
|
|
* Regexp/String: Update Unicode version from 9.0.0 to 10.0.0 [Feature #13685]
|
2017-09-06 11:19:12 +03:00
|
|
|
|
2017-07-19 18:01:01 +03:00
|
|
|
* Thread
|
|
|
|
|
|
|
|
* Thread#fetch [Feature #13009]
|
|
|
|
|
2017-08-26 23:55:31 +03:00
|
|
|
* Description set by Thread#name= is now visible on Windows 10.
|
|
|
|
|
2017-09-25 09:20:10 +03:00
|
|
|
* Time
|
|
|
|
|
|
|
|
* Time#at receives 3rd argument which specifies the unit of 2nd argument.
|
|
|
|
[Feature #13919]
|
|
|
|
|
2017-09-18 11:05:53 +03:00
|
|
|
* KeyError
|
|
|
|
|
|
|
|
* KeyError#receiver [Feature #12063]
|
|
|
|
* KeyError#key [Feature #12063]
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
|
|
|
|
2017-09-11 04:33:46 +03:00
|
|
|
* Bundler
|
|
|
|
|
|
|
|
* Add Bundler to Standard Library. [Feature #12733]
|
|
|
|
|
2017-10-21 12:53:52 +03:00
|
|
|
* DRb
|
|
|
|
* ACL::ACLEntry.new no longer suppresses IPAddr::InvalidPrefixError.
|
|
|
|
|
2017-07-19 18:01:01 +03:00
|
|
|
* ERB
|
|
|
|
* Add ERB#result_with_hash to render a template with local variables passed
|
|
|
|
with a Hash object. [Feature #8631]
|
2017-11-10 16:59:01 +03:00
|
|
|
* Default template file encoding is changed from ASCII-8BIT to UTF-8 in erb
|
|
|
|
command. [Bug #14095]
|
2017-07-19 18:01:01 +03:00
|
|
|
|
|
|
|
* Carriage returns are changed to be trimmed properly if trim_mode is specified
|
|
|
|
and used. Duplicated newlines will be removed on Windows. [Bug #5339] [Bug #11464]
|
|
|
|
|
2017-10-21 16:34:19 +03:00
|
|
|
* IPAddr
|
|
|
|
* New methods are added:
|
|
|
|
* IPAddr#prefix
|
|
|
|
* IPAddr#loopback?
|
|
|
|
* IPAddr#private? [Feature #11666]
|
|
|
|
* IPAddr#link_local? [Feature #10912]
|
|
|
|
* IPAddr now rejects invalid address mask. [Bug #13399]
|
2017-10-21 16:38:03 +03:00
|
|
|
* IPAddr#ipv4_compat and #ipv4_compat? are deprecated. [Bug #13769]
|
2017-10-21 16:34:19 +03:00
|
|
|
|
2017-11-24 06:53:27 +03:00
|
|
|
* IRB
|
2017-11-24 07:29:49 +03:00
|
|
|
* `binding.irb` automatically requires irb and runs [Bug #13099] [experimental]
|
|
|
|
* Show source around `binding.irb` on session start [Feature #14124]
|
2017-11-24 06:53:27 +03:00
|
|
|
|
2017-05-19 19:06:18 +03:00
|
|
|
* Net::HTTP
|
|
|
|
* Add more HTTP status classes
|
|
|
|
|
2017-05-19 19:06:25 +03:00
|
|
|
* Net::HTTP::STATUS_CODES is added as HTTP Status Code Repository [Misc #12935]
|
|
|
|
|
2017-04-23 19:19:23 +03: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-10-21 11:34:49 +03:00
|
|
|
* Pathname
|
|
|
|
* New method:
|
|
|
|
* Pathname#glob [Feature #7360]
|
|
|
|
|
2017-11-02 23:26:11 +03:00
|
|
|
* Psych
|
|
|
|
|
|
|
|
* Update to Psych 3.0.0.beta3.
|
|
|
|
|
2017-04-06 05:10:40 +03:00
|
|
|
* RbConfig
|
|
|
|
* New constants:
|
|
|
|
* RbConfig::LIMITS is added to provide the limits of C types.
|
2017-10-21 11:44:56 +03:00
|
|
|
This is available when rbconfig/sizeof is required.
|
2017-04-06 05:10:40 +03:00
|
|
|
|
2017-09-14 13:53:47 +03:00
|
|
|
* Ripper
|
|
|
|
* New method:
|
|
|
|
* Ripper#state is added to tell the state of scanner. [Feature #13686]
|
|
|
|
|
|
|
|
* New constants:
|
|
|
|
* Ripper::EXPR_BEG and so on for Ripper#state.
|
|
|
|
|
2017-10-11 06:44:35 +03:00
|
|
|
* RDoc
|
|
|
|
|
2017-11-02 23:25:37 +03:00
|
|
|
* Update to RDoc 6.0.0.beta3.
|
2017-10-11 11:14:50 +03:00
|
|
|
* Replaced IRB based lexer with Ripper. It much improves the speed of generating document.
|
2017-10-11 06:44:35 +03:00
|
|
|
* https://github.com/ruby/rdoc/pull/512
|
|
|
|
|
|
|
|
* Rubygems
|
|
|
|
|
2017-11-02 23:25:37 +03:00
|
|
|
* Update to Rubygems 2.7.0.
|
2017-11-02 07:25:37 +03:00
|
|
|
* http://blog.rubygems.org/2017/11/01/2.7.0-released.html
|
2017-10-11 06:44:35 +03:00
|
|
|
* http://blog.rubygems.org/2017/08/27/2.6.13-released.html
|
|
|
|
* http://blog.rubygems.org/2017/10/09/unsafe-object-deserialization-vulnerability.html
|
|
|
|
|
2017-10-21 18:21:26 +03:00
|
|
|
* SecureRandom
|
|
|
|
* New methods:
|
|
|
|
* SecureRandom.alphanumeric
|
|
|
|
|
2017-07-14 11:46:13 +03:00
|
|
|
* Set
|
|
|
|
* Add Set#to_s as alias to #inspect [Feature #13676]
|
2017-09-19 17:56:03 +03:00
|
|
|
* Add Set#=== as alias to #include? [Feature #13801]
|
2017-10-22 15:26:21 +03:00
|
|
|
* Add Set#reset [Feature #6589]
|
2017-07-14 11:46:13 +03:00
|
|
|
|
2017-10-23 09:25:39 +03:00
|
|
|
* StringIO
|
|
|
|
* StringIO#write accepts multiple arguments
|
|
|
|
|
2017-11-29 10:57:48 +03:00
|
|
|
* StringScanner
|
|
|
|
* Add StringScanner#size, StringScanner#captures, StringScanner#values_at [Feature #836]
|
|
|
|
|
2017-07-07 20:41:08 +03:00
|
|
|
* WEBrick
|
|
|
|
|
|
|
|
* Add Server Name Indication (SNI) support [Feature #13729]
|
|
|
|
|
2017-10-23 15:59:05 +03:00
|
|
|
* Zlib
|
2017-10-23 10:06:12 +03:00
|
|
|
* Zlib::GzipWriter#write accepts multiple arguments
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Compatibility issues (excluding feature bug fixes)
|
|
|
|
|
2017-07-19 18:01:01 +03:00
|
|
|
* BasicSocket#read_nonblock and BasicSocket#write_nonblock no
|
|
|
|
longer sets the O_NONBLOCK file description flag as side effect
|
|
|
|
(on Linux only) [Feature #13362]
|
|
|
|
|
2017-05-19 18:13:42 +03: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 16:41:38 +03:00
|
|
|
* Random.raw_seed renamed to become Random.urandom. It is now
|
|
|
|
applicable to non-seeding purposes due to [Bug #9569].
|
|
|
|
|
2017-08-31 11:33:35 +03:00
|
|
|
* Socket::Ifaddr#vhid is added [Feature #13803]
|
|
|
|
|
2017-07-21 22:06:07 +03:00
|
|
|
* ConditionVariable, Queue and SizedQueue reimplemented for speed.
|
|
|
|
They no longer subclass Struct. [Feature #13552]
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
|
|
|
|
2017-04-21 09:16:11 +03:00
|
|
|
* mathn.rb
|
|
|
|
Removed from stdlib. [Feature #10169]
|
|
|
|
|
2017-09-24 11:10:08 +03:00
|
|
|
* Rubygems
|
2017-11-07 23:06:25 +03:00
|
|
|
* Removed "ubygems.rb" file from stdlib. It's needless since Ruby 1.9.
|
2017-09-24 11:10:08 +03:00
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== C API updates
|
|
|
|
|
|
|
|
=== Supported platform changes
|
|
|
|
|
2017-10-23 08:56:25 +03:00
|
|
|
* Drop to support NaCl platform
|
|
|
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Implementation improvements
|
|
|
|
|
2017-01-22 07:02:42 +03:00
|
|
|
* (This might not be a "user visible feature change" but) Hash class's
|
|
|
|
hash function is now SipHash13. [Feature #13017]
|
|
|
|
|
2017-01-22 07:14:21 +03:00
|
|
|
* SecureRandom now prefers OS-provided sources than OpenSSL. [Bug #9569]
|
|
|
|
|
2017-07-21 22:06:07 +03:00
|
|
|
* Mutex rewritten to be smaller and faster [Feature #13517]
|
|
|
|
|
2017-10-24 16:59:59 +03:00
|
|
|
* Performance of block passing using block parameters is improved by
|
|
|
|
lazy Proc allocation [Feature #14045]
|
|
|
|
|
2017-11-14 15:58:36 +03:00
|
|
|
* Dynamic instrumentation for TracePoint hooks instead of using "trace"
|
|
|
|
instruction to avoid overhead [Feature #14104]
|
|
|
|
|
2016-12-26 15:00:02 +03:00
|
|
|
=== Miscellaneous changes
|
2017-04-21 08:35:34 +03:00
|
|
|
|
2017-05-19 09:14:43 +03:00
|
|
|
* Print backtrace and error message in reverse order if STDERR is unchanged and a tty.
|
|
|
|
[Feature #8661] [experimental]
|
|
|
|
|
2017-11-29 14:14:23 +03:00
|
|
|
* Print error message in bold/underlined text if STDERR is unchanged and a tty.
|
|
|
|
[Feature #14160] [experimental]
|
|
|
|
|
2017-04-21 08:35:34 +03: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]
|