2018-10-17 14:35:28 +03:00
|
|
|
# -*- rdoc -*-
|
2017-12-26 14:36:07 +03:00
|
|
|
|
2018-12-25 18:58:49 +03:00
|
|
|
= NEWS for Ruby 2.7.0
|
2017-12-26 14:36:07 +03:00
|
|
|
|
|
|
|
This document is a list of user visible feature changes made between
|
|
|
|
releases except for bug fixes.
|
|
|
|
|
2018-08-18 12:53:11 +03:00
|
|
|
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
|
2018-10-17 14:35:28 +03:00
|
|
|
(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
|
2017-12-26 14:36:07 +03:00
|
|
|
|
2018-12-25 18:58:49 +03:00
|
|
|
== Changes since the 2.6.0 release
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Language changes
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-04-27 06:09:48 +03:00
|
|
|
* Pattern matching is introduced as an experimental feature. [Feature #14912]
|
2019-04-17 09:48:03 +03:00
|
|
|
|
2018-12-31 18:00:37 +03:00
|
|
|
* Method reference operator, <code>.:</code> is introduced as an
|
|
|
|
experimental feature. [Feature #12125] [Feature #13581]
|
|
|
|
|
2019-01-10 11:19:14 +03:00
|
|
|
* Proc.new and proc with no block in a method called with a block is warned
|
|
|
|
now.
|
|
|
|
|
|
|
|
* lambda with no block in a method called with a block errs.
|
|
|
|
|
2019-05-04 16:02:20 +03:00
|
|
|
* Non-Symbol keys in a keyword arguments hash were prohibited in 2.6.0,
|
|
|
|
but are now allowed again. [Bug #15658]
|
2019-03-11 15:48:33 +03:00
|
|
|
|
2019-03-17 08:21:18 +03:00
|
|
|
* Numbered parameter as the default block parameter is introduced as an
|
|
|
|
experimental feature. [Feature #4475]
|
|
|
|
|
2019-04-03 11:11:41 +03:00
|
|
|
* A beginless range is experimentally introduced. It might not be as useful
|
2019-04-28 19:17:27 +03:00
|
|
|
as an endless range, but would be good for DSL purpose. [Feature #14799]
|
2019-04-03 11:11:41 +03:00
|
|
|
|
|
|
|
ary[..3] # identical to ary[0..3]
|
|
|
|
where(sales: ..100)
|
|
|
|
|
2019-04-18 12:34:40 +03:00
|
|
|
* Setting <code>$;</code> to non-nil value is warned now. Use of it in
|
|
|
|
String#split is warned too.
|
|
|
|
|
2019-04-25 17:46:37 +03:00
|
|
|
* Setting <code>$,</code> to non-nil value is warned now. Use of it in
|
|
|
|
Array#join is warned too.
|
|
|
|
|
2019-04-28 18:24:26 +03:00
|
|
|
* Quoted here-document identifier must end within the same line.
|
|
|
|
|
|
|
|
<<"EOS
|
|
|
|
" # This has been warned since 2.4
|
|
|
|
EOS
|
|
|
|
|
2019-04-23 07:14:27 +03:00
|
|
|
* Pipeline operator is added.
|
|
|
|
|
|
|
|
This code equals to the next code.
|
|
|
|
|
|
|
|
foo()
|
|
|
|
|> bar 1, 2
|
|
|
|
|> display
|
|
|
|
|
|
|
|
foo()
|
|
|
|
.bar(1, 2)
|
|
|
|
.display
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Core classes updates (outstanding ones only)
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-02-07 11:14:10 +03:00
|
|
|
Enumerable::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
2019-05-23 17:24:22 +03:00
|
|
|
* Added Enumerable#filter_map. [Feature #15323]
|
|
|
|
|
2019-03-15 04:19:31 +03:00
|
|
|
* Added Enumerable#tally. [Feature #11076]
|
2019-02-07 11:14:10 +03:00
|
|
|
|
2019-03-11 12:52:40 +03:00
|
|
|
Enumerator::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
2019-04-09 16:08:29 +03:00
|
|
|
* Added Enumerator::Yielder#to_proc so that a Yielder object
|
|
|
|
can be directly passed to another method as a block
|
|
|
|
argument. [Feature #15618]
|
2019-03-11 12:52:40 +03:00
|
|
|
|
2019-04-06 10:02:11 +03:00
|
|
|
FrozenError::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added FrozenError#receiver to return the frozen object that
|
|
|
|
modification was attempted on. To set this object when raising
|
|
|
|
FrozenError in Ruby code, pass it as the second argument to
|
|
|
|
FrozenError.new.
|
|
|
|
|
2019-06-01 18:42:57 +03:00
|
|
|
GC::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added GC.compact method for compacting the heap.
|
|
|
|
This function compacts live objects in the heap so that fewer pages may
|
|
|
|
be used, and the heap may be more CoW friendly. [Feature #15626]
|
|
|
|
|
|
|
|
Details on the algorithm and caveats can be found here:
|
|
|
|
https://bugs.ruby-lang.org/issues/15626
|
|
|
|
|
2019-06-08 15:35:33 +03:00
|
|
|
IO::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added IO#set_encoding_by_bom to check the BOM and set the external
|
|
|
|
encoding. [Bug #15210]
|
|
|
|
|
2019-04-29 04:11:44 +03:00
|
|
|
Integer::
|
|
|
|
|
|
|
|
Modified method::
|
|
|
|
|
|
|
|
* Integer#[] now supports range operation. [Feature #8842]
|
|
|
|
|
|
|
|
0b01001101[2, 4] #=> 0b0011
|
|
|
|
0b01001100[2..5] #=> 0b0011
|
|
|
|
0b01001100[2...6] #=> 0b0011
|
|
|
|
^^^^
|
|
|
|
|
2019-06-01 18:42:11 +03:00
|
|
|
Regexp / String::
|
2019-03-06 06:15:06 +03:00
|
|
|
|
2019-04-09 16:08:29 +03:00
|
|
|
* Update Unicode version and Emoji version from 11.0.0 to
|
|
|
|
12.0.0. [Feature #15321]
|
2019-03-06 06:15:06 +03:00
|
|
|
|
2019-04-09 12:41:00 +03:00
|
|
|
* Update Unicode version to 12.1.0, adding support for
|
2019-04-09 16:08:29 +03:00
|
|
|
U+32FF SQUARE ERA NAME REIWA. [Feature #15195]
|
2019-04-09 12:41:00 +03:00
|
|
|
|
2019-05-23 16:47:55 +03:00
|
|
|
Time::
|
|
|
|
|
|
|
|
* Added Time#ceil method. [Feature #15772]
|
|
|
|
|
|
|
|
* Added Time#floor method. [Feature #15653]
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-04-17 16:20:02 +03:00
|
|
|
Bundler::
|
|
|
|
|
|
|
|
* Upgrade to Bundler 2.1.0.pre.1
|
|
|
|
Bundled from https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852
|
|
|
|
|
2019-06-05 16:29:53 +03:00
|
|
|
CGI::
|
|
|
|
|
|
|
|
* CGI.escapeHTML becomes 2~5x faster when there's at least one escaped character.
|
|
|
|
|
2019-02-02 09:38:09 +03:00
|
|
|
CSV::
|
2019-01-25 09:49:59 +03:00
|
|
|
|
2019-04-15 05:05:03 +03:00
|
|
|
* Upgrade to 3.0.9.
|
2019-01-25 09:49:59 +03:00
|
|
|
See https://github.com/ruby/csv/blob/master/NEWS.md.
|
|
|
|
|
2019-04-09 04:27:36 +03:00
|
|
|
Date::
|
|
|
|
|
2019-05-31 13:12:24 +03:00
|
|
|
* Date.jisx0301, Date#jisx0301, and Date.parse support the new Japanese
|
|
|
|
era. [Feature #15742]
|
2019-04-09 04:27:36 +03:00
|
|
|
|
2019-06-01 18:42:11 +03:00
|
|
|
Delegator::
|
2019-05-12 02:32:00 +03:00
|
|
|
|
|
|
|
* Object#DelegateClass accepts a block and module_evals it in the context
|
|
|
|
of the returned class, similar to Class.new and Struct.new.
|
|
|
|
|
2019-03-28 14:50:19 +03:00
|
|
|
ERB::
|
|
|
|
|
2019-03-28 15:35:20 +03:00
|
|
|
* Prohibit marshaling ERB instance.
|
2019-03-28 14:50:19 +03:00
|
|
|
|
2019-04-25 18:53:36 +03:00
|
|
|
IRB::
|
|
|
|
|
2019-06-01 18:42:11 +03:00
|
|
|
* Introduce syntax highlight inspired by pry.gem to Binding#irb source lines,
|
2019-05-25 07:21:22 +03:00
|
|
|
REPL input, and inspect output of some core-class objects.
|
2019-04-25 18:53:36 +03:00
|
|
|
|
2019-04-16 02:58:06 +03:00
|
|
|
Net::IMAP::
|
|
|
|
|
|
|
|
* Add Server Name Indication (SNI) support. [Feature #15594]
|
|
|
|
|
2019-02-02 09:38:09 +03:00
|
|
|
RSS::
|
2019-01-25 09:35:04 +03:00
|
|
|
|
|
|
|
* Upgrade to RSS 0.2.8.
|
|
|
|
See https://github.com/ruby/rss/blob/master/NEWS.md.
|
|
|
|
|
2019-04-17 16:20:02 +03:00
|
|
|
RubyGems::
|
|
|
|
|
|
|
|
* Upgrade to RubyGems 3.1.0.pre1
|
|
|
|
Bundled from https://github.com/rubygems/rubygems/commit/97b264f0fa248c864b6ee9a23d3ff1cdd217dddb
|
|
|
|
|
2018-11-05 10:01:47 +03:00
|
|
|
=== Compatibility issues (excluding feature bug fixes)
|
2018-11-03 02:07:56 +03:00
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-03-11 16:00:31 +03:00
|
|
|
profile.rb, Profiler__::
|
|
|
|
|
|
|
|
* Removed from standard library. No one maintains it from Ruby 2.0.0.
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== C API updates
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Implementation improvements
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-03-17 08:28:54 +03:00
|
|
|
JIT::
|
|
|
|
|
2019-04-17 12:24:48 +03:00
|
|
|
* JIT-ed code is recompiled to less-optimized code when an optimization assumption is invalidated.
|
|
|
|
|
|
|
|
* Method inlining is performed when a method is considered as pure.
|
2019-04-21 18:04:06 +03:00
|
|
|
This optimization is still experimental and many methods are NOT considered as pure yet.
|
2019-04-17 12:24:48 +03:00
|
|
|
|
2019-04-09 16:08:30 +03:00
|
|
|
* Default value of +--jit-max-cache+ is changed from 1,000 to 100
|
2019-03-17 08:28:54 +03:00
|
|
|
|
2019-04-09 16:08:30 +03:00
|
|
|
* Default value of +--jit-min-calls+ is changed from 5 to 10,000
|
2019-03-17 08:28:54 +03:00
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Miscellaneous changes
|
2019-01-10 11:22:23 +03:00
|
|
|
|
|
|
|
* Require compilers to support C99 [Misc #15347]
|
2019-04-22 15:23:37 +03:00
|
|
|
|
2019-01-10 11:22:23 +03:00
|
|
|
* Details of our dialect: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99
|
2019-04-22 15:23:37 +03:00
|
|
|
|
|
|
|
* Upstream repository is changed from Subversion to Git.
|
|
|
|
|
2019-04-23 16:26:40 +03:00
|
|
|
* https://git.ruby-lang.org/ruby.git
|
|
|
|
|
2019-04-22 15:23:37 +03:00
|
|
|
* RUBY_REVISION class is changed from Integer to String.
|
|
|
|
|
|
|
|
* RUBY_DESCRIPTION includes Git revision instead of Subversion's one.
|