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
|
2019-12-23 16:45:24 +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-10-21 12:46:54 +03:00
|
|
|
==== Pattern matching
|
|
|
|
|
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
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
case [0, [1, 2, 3]]
|
|
|
|
in [a, [b, *c]]
|
|
|
|
p a #=> 0
|
|
|
|
p b #=> 1
|
|
|
|
p c #=> [2, 3]
|
|
|
|
end
|
|
|
|
|
|
|
|
case {a: 0, b: 1}
|
|
|
|
in {a: 0, x: 1}
|
|
|
|
:unreachable
|
|
|
|
in {a: 0, b: var}
|
|
|
|
p var #=> 1
|
|
|
|
end
|
|
|
|
|
2019-12-20 15:37:46 +03:00
|
|
|
case -1
|
|
|
|
in 0 then :unreachable
|
|
|
|
in 1 then :unreachable
|
|
|
|
end #=> NoMatchingPatternError
|
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
json = <<END
|
|
|
|
{
|
|
|
|
"name": "Alice",
|
|
|
|
"age": 30,
|
|
|
|
"children": [{ "name": "Bob", "age": 2 }]
|
|
|
|
}
|
|
|
|
END
|
2019-12-20 15:37:46 +03:00
|
|
|
|
|
|
|
JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: name, age: age}]}
|
|
|
|
|
|
|
|
p name #=> "Bob"
|
|
|
|
p age #=> 2
|
|
|
|
|
|
|
|
JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: "Charlie", age: age}]}
|
|
|
|
#=> NoMatchingPatternError
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* See the following slides for more details:
|
2019-10-21 12:46:54 +03:00
|
|
|
* https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7
|
2019-12-23 16:45:24 +03:00
|
|
|
* Note that the slides are slightly obsolete.
|
2019-10-21 12:46:54 +03:00
|
|
|
|
|
|
|
==== The spec of keyword arguments is changed towards 3.0
|
2018-12-31 18:00:37 +03:00
|
|
|
|
2019-09-27 19:43:31 +03:00
|
|
|
* Automatic conversion of keyword arguments and positional arguments is
|
|
|
|
deprecated, and conversion will be removed in Ruby 3. [Feature #14183]
|
2019-09-02 08:31:22 +03:00
|
|
|
|
2019-09-27 19:43:31 +03:00
|
|
|
* When a method call passes a Hash at the last argument, and when it
|
2019-12-23 11:46:08 +03:00
|
|
|
passes no keywords, and when the called method accepts keywords,
|
|
|
|
a warning is emitted. To continue treating the hash as keywords,
|
|
|
|
add a double splat operator to avoid the warning and ensure
|
|
|
|
correct behavior in Ruby 3.
|
2019-08-31 01:03:27 +03:00
|
|
|
|
2019-10-16 19:21:18 +03:00
|
|
|
def foo(key: 42); end; foo({key: 42}) # warned
|
|
|
|
def foo(**kw); end; foo({key: 42}) # warned
|
|
|
|
def foo(key: 42); end; foo(**{key: 42}) # OK
|
|
|
|
def foo(**kw); end; foo(**{key: 42}) # OK
|
2019-09-27 19:43:31 +03:00
|
|
|
|
|
|
|
* When a method call passes keywords to a method that accepts keywords,
|
|
|
|
but it does not pass enough required positional arguments, the
|
|
|
|
keywords are treated as a final required positional argument, and a
|
|
|
|
warning is emitted. Pass the argument as a hash instead of keywords
|
|
|
|
to avoid the warning and ensure correct behavior in Ruby 3.
|
|
|
|
|
2019-10-16 19:21:18 +03:00
|
|
|
def foo(h, **kw); end; foo(key: 42) # warned
|
|
|
|
def foo(h, key: 42); end; foo(key: 42) # warned
|
|
|
|
def foo(h, **kw); end; foo({key: 42}) # OK
|
|
|
|
def foo(h, key: 42); end; foo({key: 42}) # OK
|
2019-09-27 19:43:31 +03:00
|
|
|
|
|
|
|
* When a method accepts specific keywords but not a keyword splat, and
|
|
|
|
a hash or keywords splat is passed to the method that includes both
|
|
|
|
Symbol and non-Symbol keys, the hash will continue to be split, and
|
|
|
|
a warning will be emitted. You will need to update the calling code
|
|
|
|
to pass separate hashes to ensure correct behavior in Ruby 3.
|
|
|
|
|
2019-10-16 19:21:18 +03:00
|
|
|
def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned
|
|
|
|
def foo(h={}, key: 42); end; foo({"key" => 43, key: 42}) # warned
|
|
|
|
def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
|
2019-09-27 19:43:31 +03:00
|
|
|
|
|
|
|
* If a method does not accept keywords, and is called with keywords,
|
|
|
|
the keywords are still treated as a positional hash, with no warning.
|
|
|
|
This behavior will continue to work in Ruby 3.
|
|
|
|
|
2019-10-16 19:21:18 +03:00
|
|
|
def foo(opt={}); end; foo( key: 42 ) # OK
|
2019-08-31 01:03:27 +03:00
|
|
|
|
2019-12-23 11:46:08 +03:00
|
|
|
* Non-symbols are allowed as keyword argument keys if the method accepts
|
2019-09-27 19:43:31 +03:00
|
|
|
arbitrary keywords. [Feature #14183]
|
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
* Non-Symbol keys in a keyword arguments hash were prohibited in 2.6.0,
|
|
|
|
but are now allowed again. [Bug #15658]
|
|
|
|
|
2019-10-21 15:30:47 +03:00
|
|
|
def foo(**kw); p kw; end; foo("str" => 1) #=> {"str"=>1}
|
2019-09-27 19:43:31 +03:00
|
|
|
|
2019-09-28 07:51:27 +03:00
|
|
|
* <code>**nil</code> is allowed in method definitions to explicitly mark
|
|
|
|
that the method accepts no keywords. Calling such a method with keywords
|
|
|
|
will result in an ArgumentError. [Feature #14183]
|
2019-09-27 19:43:31 +03:00
|
|
|
|
2019-10-16 19:21:18 +03:00
|
|
|
def foo(h, **nil); end; foo(key: 1) # ArgumentError
|
|
|
|
def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError
|
|
|
|
def foo(h, **nil); end; foo("str" => 1) # ArgumentError
|
|
|
|
def foo(h, **nil); end; foo({key: 1}) # OK
|
|
|
|
def foo(h, **nil); end; foo({"str" => 1}) # OK
|
2019-08-31 01:03:27 +03:00
|
|
|
|
2019-09-27 19:43:31 +03:00
|
|
|
* Passing an empty keyword splat to a method that does not accept keywords
|
|
|
|
no longer passes an empty hash, unless the empty hash is necessary for
|
|
|
|
a required parameter, in which case a warning will be emitted. Remove
|
|
|
|
the double splat to continue passing a positional hash. [Feature #14183]
|
2019-08-31 01:03:27 +03:00
|
|
|
|
2019-09-27 19:43:31 +03:00
|
|
|
h = {}; def foo(*a) a end; foo(**h) # []
|
|
|
|
h = {}; def foo(a) a end; foo(**h) # {} and warning
|
|
|
|
h = {}; def foo(*a) a end; foo(h) # [{}]
|
|
|
|
h = {}; def foo(a) a end; foo(h) # {}
|
2019-08-31 01:03:27 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
==== Numbered parameters
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-12-24 04:23:38 +03:00
|
|
|
* Numbered parameters as default block parameters are introduced.
|
|
|
|
[Feature #4475]
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
[1, 2, 10].map { _1.to_s(16) } #=> ["1", "2", "a"]
|
|
|
|
[[1, 2], [3, 4]].map { _1 + _2 } #=> [3, 7]
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
You can still define a local variable named +_1+ and so on,
|
|
|
|
and that is honored when present, but renders a warning.
|
2019-11-12 10:15:58 +03:00
|
|
|
|
2019-12-20 08:54:44 +03:00
|
|
|
_1 = 0 #=> warning: `_1' is reserved for numbered parameter; consider another name
|
2019-12-14 10:05:15 +03:00
|
|
|
[1].each { p _1 } # prints 0 instead of 1
|
2019-11-12 10:15:58 +03:00
|
|
|
|
2019-10-21 15:26:47 +03:00
|
|
|
==== proc/lambda without block is deprecated
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-09-28 07:49:49 +03:00
|
|
|
* Proc.new and Kernel#proc with no block in a method called with a block is
|
|
|
|
warned now.
|
2019-01-10 11:19:14 +03:00
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
def foo
|
|
|
|
proc
|
|
|
|
end
|
2019-12-14 10:05:15 +03:00
|
|
|
foo { puts "Hello" } #=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
|
2019-01-10 11:19:14 +03:00
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
* Kernel#lambda with no block in a method called with a block raises an exception.
|
2019-03-11 15:48:33 +03:00
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
def bar
|
|
|
|
lambda
|
|
|
|
end
|
|
|
|
bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError)
|
|
|
|
|
|
|
|
==== Other miscellaneous changes
|
2019-03-17 08:21:18 +03:00
|
|
|
|
2019-12-22 00:23:20 +03:00
|
|
|
* A beginless range is experimentally introduced. It might be useful
|
|
|
|
in +case+, new call-sequence of the <code>Comparable#clamp</code>,
|
|
|
|
constants and DSLs. [Feature #14799]
|
2019-04-03 11:11:41 +03:00
|
|
|
|
|
|
|
ary[..3] # identical to ary[0..3]
|
2019-12-22 00:23:20 +03:00
|
|
|
|
|
|
|
case RUBY_VERSION
|
|
|
|
when ..."2.4" then puts "EOL"
|
|
|
|
# ...
|
|
|
|
end
|
|
|
|
|
|
|
|
age.clamp(..100)
|
|
|
|
|
2019-04-03 11:11:41 +03:00
|
|
|
where(sales: ..100)
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Setting <code>$;</code> to a non-nil value is warned now.
|
|
|
|
Use of it in String#split is warned too.
|
2019-04-18 12:34:40 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Setting <code>$,</code> to a non-nil value is warned now.
|
|
|
|
Use of it in Array#join is warned too.
|
2019-04-25 17:46:37 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Quoted here-document identifiers must end within the same line.
|
2019-04-28 18:24:26 +03:00
|
|
|
|
|
|
|
<<"EOS
|
2019-10-21 12:46:54 +03:00
|
|
|
" # This had been warned since 2.4; Now it raises a SyntaxError
|
2019-04-28 18:24:26 +03:00
|
|
|
EOS
|
|
|
|
|
2019-07-14 08:40:38 +03:00
|
|
|
* The flip-flop syntax deprecation is reverted. [Feature #5400]
|
|
|
|
|
2019-09-15 17:12:24 +03:00
|
|
|
* Comment lines can be placed between fluent dot now.
|
|
|
|
|
|
|
|
foo
|
|
|
|
# .bar
|
|
|
|
.baz # => foo.baz
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Calling a private method with a literal +self+ as the receiver
|
2019-09-19 20:32:50 +03:00
|
|
|
is now allowed. [Feature #11297] [Feature #16123]
|
|
|
|
|
2019-10-07 22:55:22 +03:00
|
|
|
* Modifier rescue now operates the same for multiple assignment as single
|
|
|
|
assignment:
|
|
|
|
|
|
|
|
a, b = raise rescue [1, 2]
|
|
|
|
# Previously parsed as: (a, b = raise) rescue [1, 2]
|
|
|
|
# Now parsed as: a, b = (raise rescue [1, 2])
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* +yield+ in singleton class syntax is warned and will be deprecated later. [Feature #15575].
|
2019-10-21 11:09:52 +03:00
|
|
|
|
2019-11-18 18:12:50 +03:00
|
|
|
def foo
|
|
|
|
class << Object.new
|
2019-12-14 10:05:15 +03:00
|
|
|
yield #=> warning: `yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]
|
2019-11-18 18:12:50 +03:00
|
|
|
end
|
|
|
|
end
|
2019-12-14 10:05:15 +03:00
|
|
|
foo { p :ok }
|
2019-11-18 18:12:50 +03:00
|
|
|
|
2019-11-12 11:04:11 +03:00
|
|
|
* Argument forwarding by <code>(...)</code> is introduced. [Feature #16253]
|
2019-10-18 21:05:03 +03:00
|
|
|
|
|
|
|
def foo(...)
|
|
|
|
bar(...)
|
|
|
|
end
|
|
|
|
|
|
|
|
All arguments to +foo+ are forwarded to +bar+, including keyword and
|
|
|
|
block arguments.
|
2019-12-23 16:45:24 +03:00
|
|
|
Note that the parentheses are mandatory. <code>bar ...</code> is parsed
|
|
|
|
as an endless range.
|
2019-10-18 21:05:03 +03:00
|
|
|
|
2019-11-14 23:15:01 +03:00
|
|
|
* Access and setting of <code>$SAFE</code> is now always warned. <code>$SAFE</code>
|
|
|
|
will become a normal global variable in Ruby 3.0. [Feature #16131]
|
|
|
|
|
|
|
|
* <code>Object#{taint,untaint,trust,untrust}</code> and related functions in the C-API
|
|
|
|
no longer have an effect (all objects are always considered untainted), and are now
|
|
|
|
warned in verbose mode. This warning will be disabled even in non-verbose mode in
|
2019-11-28 15:45:43 +03:00
|
|
|
Ruby 3.0, and the methods and C functions will be removed in Ruby 3.2. [Feature #16131]
|
2019-11-14 23:15:01 +03:00
|
|
|
|
2019-12-24 03:53:36 +03:00
|
|
|
* Refinements take place at Object#method and Module#instance_method. [Feature #15373]
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Core classes updates (outstanding ones only)
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-10-07 08:12:29 +03:00
|
|
|
Array::
|
|
|
|
|
2019-12-20 21:47:56 +03:00
|
|
|
New methods::
|
2019-10-07 08:12:29 +03:00
|
|
|
|
|
|
|
* Added Array#intersection. [Feature #16155]
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added Array#minmax, with a faster implementation than Enumerable#minmax. [Bug #15929]
|
2019-12-20 21:47:56 +03:00
|
|
|
|
2019-10-15 16:32:10 +03:00
|
|
|
Comparable::
|
|
|
|
|
|
|
|
Modified method::
|
|
|
|
|
|
|
|
* Comparable#clamp now accepts a Range argument. [Feature #14784]
|
|
|
|
|
2019-10-21 15:30:47 +03:00
|
|
|
-1.clamp(0..2) #=> 0
|
|
|
|
1.clamp(0..2) #=> 1
|
|
|
|
3.clamp(0..2) #=> 2
|
2019-12-22 00:23:20 +03:00
|
|
|
# With beginless and endless ranges:
|
|
|
|
-1.clamp(0..) #=> 0
|
|
|
|
3.clamp(..2) #=> 2
|
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-06-05 07:41:02 +03:00
|
|
|
Complex::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added Complex#<=>.
|
|
|
|
So <code>0 <=> 0i</code> will not raise NoMethodError. [Bug #15857]
|
2019-06-05 07:41:02 +03:00
|
|
|
|
2019-09-02 09:08:53 +03:00
|
|
|
Dir::
|
|
|
|
|
2019-11-12 11:46:39 +03:00
|
|
|
Modified methods::
|
2019-09-02 09:08:53 +03:00
|
|
|
|
2019-10-21 19:27:49 +03:00
|
|
|
* Dir.glob and Dir.[] no longer allow NUL-separated glob pattern.
|
2019-09-02 09:08:53 +03:00
|
|
|
Use Array instead. [Feature #14643]
|
|
|
|
|
2019-06-17 02:50:44 +03:00
|
|
|
Encoding::
|
|
|
|
|
2019-10-23 07:18:48 +03:00
|
|
|
New encoding::
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added new encoding CESU-8. [Feature #15931]
|
2019-06-17 02:50:44 +03:00
|
|
|
|
2019-02-07 11:14:10 +03:00
|
|
|
Enumerable::
|
|
|
|
|
2019-07-14 11:54:22 +03:00
|
|
|
New methods::
|
2019-02-07 11:14:10 +03:00
|
|
|
|
2019-05-23 17:24:22 +03:00
|
|
|
* Added Enumerable#filter_map. [Feature #15323]
|
|
|
|
|
2019-10-21 15:30:47 +03:00
|
|
|
[1, 2, 3].filter_map {|x| x.odd? ? x.to_s : nil } #=> ["1", "3"]
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-03-15 04:19:31 +03:00
|
|
|
* Added Enumerable#tally. [Feature #11076]
|
2019-02-07 11:14:10 +03:00
|
|
|
|
2019-10-21 15:30:47 +03:00
|
|
|
["A", "B", "C", "B", "A"].tally #=> {"A"=>2, "B"=>2, "C"=>1}
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-03-11 12:52:40 +03:00
|
|
|
Enumerator::
|
|
|
|
|
2019-10-23 07:18:48 +03:00
|
|
|
New methods::
|
2019-03-11 12:52:40 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added Enumerator.produce to generate an Enumerator from any custom
|
|
|
|
data transformation. [Feature #14781]
|
2019-10-26 14:02:59 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
require "date"
|
2019-10-26 14:02:59 +03:00
|
|
|
dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
|
2019-12-23 16:45:24 +03:00
|
|
|
dates.detect(&:tuesday?) #=> next Tuesday
|
2019-10-26 14:02:59 +03:00
|
|
|
|
2019-06-05 14:39:21 +03:00
|
|
|
* Added Enumerator::Lazy#eager that generates a non-lazy enumerator
|
|
|
|
from a lazy enumerator. [Feature #15901]
|
|
|
|
|
2019-10-22 13:39:42 +03:00
|
|
|
a = %w(foo bar baz)
|
2019-10-22 13:46:44 +03:00
|
|
|
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
|
|
|
|
p e.class #=> Enumerator
|
|
|
|
p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
|
2019-10-22 13:39:42 +03:00
|
|
|
|
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-09-14 13:43:51 +03:00
|
|
|
Fiber::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added Fiber#raise that behaves like Fiber#resume but raises an
|
|
|
|
exception on the resumed fiber. [Feature #10344]
|
|
|
|
|
2019-10-17 08:42:38 +03:00
|
|
|
File::
|
2019-10-21 12:46:54 +03:00
|
|
|
|
2019-10-17 08:42:38 +03:00
|
|
|
Modified method::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* File.extname now returns a dot string for names ending with a dot on
|
2019-12-23 06:07:15 +03:00
|
|
|
non-Windows platforms. [Bug #15267]
|
2019-10-17 08:42:38 +03:00
|
|
|
|
|
|
|
File.extname("foo.") #=> "."
|
|
|
|
|
2019-04-06 10:02:11 +03:00
|
|
|
FrozenError::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added FrozenError#receiver to return the frozen object on which
|
|
|
|
modification was attempted. To set this object when raising
|
2019-12-23 07:23:08 +03:00
|
|
|
FrozenError in Ruby code, FrozenError.new accepts a +:receiver+
|
|
|
|
option. [Feature #15751]
|
2019-04-06 10:02:11 +03:00
|
|
|
|
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::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Integer#[] now supports range operations. [Feature #8842]
|
2019-04-29 04:11:44 +03:00
|
|
|
|
|
|
|
0b01001101[2, 4] #=> 0b0011
|
|
|
|
0b01001100[2..5] #=> 0b0011
|
|
|
|
0b01001100[2...6] #=> 0b0011
|
2019-12-23 16:45:24 +03:00
|
|
|
# ^^^^
|
2019-04-29 04:11:44 +03:00
|
|
|
|
2019-11-20 11:21:38 +03:00
|
|
|
Method::
|
2019-09-26 18:27:47 +03:00
|
|
|
|
2019-11-20 11:21:38 +03:00
|
|
|
Modified method::
|
2019-09-26 18:27:47 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Method#inspect shows more information. [Feature #14145]
|
2019-09-26 18:27:47 +03:00
|
|
|
|
2019-05-07 13:52:24 +03:00
|
|
|
Module::
|
|
|
|
|
2019-10-23 07:18:48 +03:00
|
|
|
New methods::
|
2019-06-22 19:44:07 +03:00
|
|
|
|
2019-06-30 18:47:55 +03:00
|
|
|
* Added Module#const_source_location to retrieve the location where a
|
2019-06-22 19:44:07 +03:00
|
|
|
constant is defined. [Feature #10771]
|
|
|
|
|
2019-10-07 22:55:22 +03:00
|
|
|
* Added Module#ruby2_keywords for marking a method as passing keyword
|
|
|
|
arguments through a regular argument splat, useful when delegating
|
|
|
|
all arguments to another method in a way that can be backwards
|
|
|
|
compatible with older Ruby versions. [Bug #16154]
|
|
|
|
|
2019-10-23 07:18:48 +03:00
|
|
|
Modified methods::
|
2019-05-07 13:52:24 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Module#autoload? now takes an +inherit+ optional argument, like
|
2019-05-07 13:52:24 +03:00
|
|
|
Module#const_defined?. [Feature #15777]
|
2019-09-26 14:25:42 +03:00
|
|
|
|
2019-10-23 07:18:48 +03:00
|
|
|
* Module#name now always returns a frozen String. The returned String is
|
2019-09-26 14:41:41 +03:00
|
|
|
always the same for a given Module. This change is
|
|
|
|
experimental. [Feature #16150]
|
2019-05-07 13:52:24 +03:00
|
|
|
|
2019-11-20 11:21:38 +03:00
|
|
|
NilClass / TrueClass / FalseClass::
|
|
|
|
|
|
|
|
Modified methods::
|
|
|
|
|
2019-12-23 11:46:08 +03:00
|
|
|
* NilClass#to_s, TrueClass#to_s, and FalseClass#to_s now always return a
|
2019-11-20 11:21:38 +03:00
|
|
|
frozen String. The returned String is always the same for each of these
|
|
|
|
values. This change is experimental. [Feature #16150]
|
|
|
|
|
2019-08-29 16:06:05 +03:00
|
|
|
ObjectSpace::WeakMap::
|
|
|
|
|
|
|
|
Modified method::
|
|
|
|
|
|
|
|
* ObjectSpace::WeakMap#[]= now accepts special objects as either key or
|
|
|
|
values. [Feature #16035]
|
|
|
|
|
2019-12-20 21:47:56 +03:00
|
|
|
Proc::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added Proc#ruby2_keywords for marking the proc as passing keyword
|
|
|
|
arguments through a regular argument splat, useful when delegating
|
|
|
|
all arguments to another method or proc in a way that can be backwards
|
|
|
|
compatible with older Ruby versions. [Feature #16404]
|
|
|
|
|
|
|
|
Range::
|
|
|
|
|
|
|
|
New method::
|
|
|
|
|
|
|
|
* Added Range#minmax, with a faster implementation than Enumerable#minmax.
|
2019-12-23 09:37:45 +03:00
|
|
|
It returns a maximum that now corresponds to Range#max. [Bug #15807]
|
2019-12-20 21:47:56 +03:00
|
|
|
|
2019-12-22 00:23:20 +03:00
|
|
|
Modified method::
|
|
|
|
|
|
|
|
* Range#=== now uses #cover? for String arguments, too (in Ruby 2.6, it was
|
|
|
|
changed from #include? for all types except strings). [Bug #15449]
|
|
|
|
|
|
|
|
|
2019-07-14 14:33:41 +03:00
|
|
|
RubyVM::
|
|
|
|
|
|
|
|
Removed method::
|
|
|
|
|
2019-09-26 18:48:48 +03:00
|
|
|
* +RubyVM.resolve_feature_path+ moved to
|
|
|
|
<code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230]
|
2019-07-14 14:33:41 +03:00
|
|
|
|
2019-10-26 23:33:43 +03:00
|
|
|
String::
|
|
|
|
|
|
|
|
Unicode::
|
|
|
|
|
|
|
|
* Update Unicode version and Emoji version from 11.0.0 to
|
|
|
|
12.0.0. [Feature #15321]
|
|
|
|
|
|
|
|
* Update Unicode version to 12.1.0, adding support for
|
|
|
|
U+32FF SQUARE ERA NAME REIWA. [Feature #15195]
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Update Unicode Emoji version to 12.1. [Feature #16272]
|
2019-10-31 09:19:59 +03:00
|
|
|
|
2019-11-29 05:17:27 +03:00
|
|
|
Symbol::
|
|
|
|
|
|
|
|
New methods::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added Symbol#start_with? and Symbol#end_with? methods. [Feature #16348]
|
2019-11-29 05:17:27 +03:00
|
|
|
|
2019-05-23 16:47:55 +03:00
|
|
|
Time::
|
|
|
|
|
2019-07-14 11:58:25 +03:00
|
|
|
New methods::
|
|
|
|
|
2019-05-23 16:47:55 +03:00
|
|
|
* Added Time#ceil method. [Feature #15772]
|
|
|
|
|
|
|
|
* Added Time#floor method. [Feature #15653]
|
|
|
|
|
2019-09-19 13:49:12 +03:00
|
|
|
Modified method::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Time#inspect is separated from Time#to_s and it shows
|
|
|
|
the time's sub second. [Feature #15958]
|
2019-09-19 13:49:12 +03:00
|
|
|
|
2019-08-30 05:01:25 +03:00
|
|
|
UnboundMethod::
|
|
|
|
|
2019-10-21 12:46:54 +03:00
|
|
|
New method::
|
2019-08-30 05:01:25 +03:00
|
|
|
|
|
|
|
* Added UnboundMethod#bind_call method. [Feature #15955]
|
|
|
|
|
2019-09-26 18:48:48 +03:00
|
|
|
<code>umethod.bind_call(obj, ...)</code> is semantically equivalent
|
|
|
|
to <code>umethod.bind(obj).call(...)</code>. This idiom is used in
|
|
|
|
some libraries to call a method that is overridden. The added
|
2019-12-23 16:45:24 +03:00
|
|
|
method does the same without allocation of an intermediate Method
|
2019-09-26 18:48:48 +03:00
|
|
|
object.
|
|
|
|
|
|
|
|
class Foo
|
|
|
|
def add_1(x)
|
|
|
|
x + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
class Bar < Foo
|
|
|
|
def add_1(x) # override
|
|
|
|
x + 2
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
obj = Bar.new
|
|
|
|
p obj.add_1(1) #=> 3
|
|
|
|
p Foo.instance_method(:add_1).bind(obj).call(1) #=> 2
|
|
|
|
p Foo.instance_method(:add_1).bind_call(obj, 1) #=> 2
|
2019-08-30 05:01:25 +03:00
|
|
|
|
2019-12-22 07:56:20 +03:00
|
|
|
Warning::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
New methods::
|
2019-12-22 07:56:20 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Added Warning.[] and Warning.[]= to manage emit/suppress of
|
2019-12-24 05:14:13 +03:00
|
|
|
some categories of warnings. [Feature #16345] [Feature #16420]
|
2019-08-30 05:01:25 +03:00
|
|
|
|
2019-07-13 16:26:47 +03:00
|
|
|
$LOAD_PATH::
|
|
|
|
|
2019-07-14 11:58:25 +03:00
|
|
|
New method::
|
|
|
|
|
2019-09-26 18:48:48 +03:00
|
|
|
* Added <code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230]
|
2019-07-13 16:26:47 +03:00
|
|
|
|
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::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Upgrade to Bundler 2.1.0.
|
2019-12-16 04:09:13 +03:00
|
|
|
See https://github.com/bundler/bundler/releases/tag/v2.1.0
|
2019-04-17 16:20:02 +03:00
|
|
|
|
2019-06-05 16:29:53 +03:00
|
|
|
CGI::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* CGI.escapeHTML becomes 2~5x faster when there is at least one escaped character.
|
|
|
|
See https://github.com/ruby/ruby/pull/2226
|
2019-06-05 16:29:53 +03:00
|
|
|
|
2019-02-02 09:38:09 +03:00
|
|
|
CSV::
|
2019-01-25 09:49:59 +03:00
|
|
|
|
2019-10-12 08:03:21 +03:00
|
|
|
* Upgrade to 3.1.2.
|
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-12-23 16:45:24 +03:00
|
|
|
* Introduce syntax highlighting inspired by the Pry gem to Binding#irb
|
|
|
|
source lines, REPL input, and inspect output of some core-class objects.
|
2019-04-25 18:53:36 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Introduce multiline editing mode provided by Reline.
|
2019-07-15 10:25:50 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Show documentation when completion.
|
2019-07-15 10:25:50 +03:00
|
|
|
|
|
|
|
* Enable auto indent and save/load history by default.
|
|
|
|
|
2019-09-02 08:43:35 +03:00
|
|
|
Net::FTP::
|
|
|
|
|
2019-10-22 13:32:04 +03:00
|
|
|
* Add Net::FTP#features to check available features, and Net::FTP#option to
|
|
|
|
enable/disable each of them. [Feature #15964]
|
2019-09-02 08:43:35 +03:00
|
|
|
|
2019-12-09 14:19:11 +03:00
|
|
|
Net::HTTP::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Add +ipaddr+ optional parameter to Net::HTTP#start to replace the address for
|
|
|
|
the TCP/IP connection. [Feature #5180]
|
2019-12-09 14:19:11 +03:00
|
|
|
|
2019-04-16 02:58:06 +03:00
|
|
|
Net::IMAP::
|
|
|
|
|
|
|
|
* Add Server Name Indication (SNI) support. [Feature #15594]
|
|
|
|
|
2019-07-14 11:22:13 +03:00
|
|
|
open-uri::
|
|
|
|
|
|
|
|
* Warn open-uri's "open" method at Kernel.
|
2019-07-15 03:36:52 +03:00
|
|
|
Use URI.open instead. [Misc #15893]
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* The default charset of "text/*" media type is UTF-8 instead of
|
2019-09-02 08:31:22 +03:00
|
|
|
ISO-8859-1. [Bug #15933]
|
2019-07-14 11:22:13 +03:00
|
|
|
|
2019-10-18 11:53:17 +03:00
|
|
|
OptionParser::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Now show "Did you mean?" for unknown options. [Feature #16256]
|
2019-10-18 11:53:17 +03:00
|
|
|
|
2019-10-18 16:17:06 +03:00
|
|
|
test.rb:
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
require "optparse"
|
2019-10-18 16:17:06 +03:00
|
|
|
OptionParser.new do |opts|
|
|
|
|
opts.on("-f", "--foo", "foo") {|v| }
|
|
|
|
opts.on("-b", "--bar", "bar") {|v| }
|
|
|
|
opts.on("-c", "--baz", "baz") {|v| }
|
|
|
|
end.parse!
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
$ ruby test.rb --baa
|
|
|
|
Traceback (most recent call last):
|
|
|
|
test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)
|
|
|
|
Did you mean? baz
|
|
|
|
bar
|
2019-10-18 11:53:17 +03:00
|
|
|
|
2019-07-15 09:45:51 +03:00
|
|
|
Pathname::
|
2019-07-14 11:44:33 +03:00
|
|
|
|
2019-12-23 16:46:58 +03:00
|
|
|
* Pathname.glob now delegates 3 arguments to Dir.glob
|
|
|
|
to accept +base+ keyword. [Feature #14405]
|
2019-07-14 11:44:33 +03:00
|
|
|
|
2019-06-20 09:59:20 +03:00
|
|
|
Racc::
|
|
|
|
|
2019-06-20 11:40:08 +03:00
|
|
|
* Merge 1.4.15 from upstream repository and added cli of racc.
|
2019-06-20 09:59:20 +03:00
|
|
|
|
2019-07-15 09:49:59 +03:00
|
|
|
Reline::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* New stdlib that is compatible with the readline stdlib but is
|
|
|
|
implemented in pure Ruby. It also provides a multiline editing mode.
|
2019-07-15 09:49:59 +03:00
|
|
|
|
2019-10-12 06:07:15 +03:00
|
|
|
REXML::
|
|
|
|
|
|
|
|
* Upgrade to 3.2.3.
|
|
|
|
See https://github.com/ruby/rexml/blob/master/NEWS.md.
|
|
|
|
|
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::
|
|
|
|
|
2019-12-23 11:46:08 +03:00
|
|
|
* Upgrade to RubyGems 3.1.1.
|
2019-12-16 14:47:02 +03:00
|
|
|
See https://github.com/rubygems/rubygems/releases/tag/v3.1.0
|
2019-04-17 16:20:02 +03:00
|
|
|
|
2019-10-14 06:40:50 +03:00
|
|
|
StringScanner::
|
|
|
|
|
|
|
|
* Upgrade to 1.0.3.
|
|
|
|
See https://github.com/ruby/strscan/blob/master/NEWS.md.
|
|
|
|
|
2018-11-05 10:01:47 +03:00
|
|
|
=== Compatibility issues (excluding feature bug fixes)
|
2018-11-03 02:07:56 +03:00
|
|
|
|
2019-10-21 10:59:52 +03:00
|
|
|
* The following libraries are no longer bundled gems.
|
|
|
|
Install corresponding gems to use these features.
|
2019-10-23 07:23:43 +03:00
|
|
|
* CMath (cmath gem)
|
|
|
|
* Scanf (scanf gem)
|
|
|
|
* Shell (shell gem)
|
|
|
|
* Synchronizer (sync gem)
|
|
|
|
* ThreadsWait (thwait gem)
|
2019-11-29 11:15:56 +03:00
|
|
|
* E2MM (e2mmap gem)
|
2019-09-20 06:12:37 +03:00
|
|
|
|
2019-10-21 11:00:16 +03:00
|
|
|
Proc::
|
2019-12-23 16:45:24 +03:00
|
|
|
* The Proc#to_s format was changed. [Feature #16101]
|
2019-10-21 11:00:16 +03:00
|
|
|
|
2019-12-23 09:55:39 +03:00
|
|
|
Range::
|
|
|
|
* Range#minmax used to iterate on the range to determine the maximum.
|
|
|
|
It now uses the same algorithm as Range#max. In rare cases (e.g.
|
2019-12-23 16:45:24 +03:00
|
|
|
ranges of Floats or Strings), this may yield different results. [Bug #15807]
|
2019-12-23 09:55:39 +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-11-14 10:09:36 +03:00
|
|
|
* Promote stdlib to default gems
|
2019-12-23 11:46:08 +03:00
|
|
|
* The following default gems were published on rubygems.org
|
2019-11-25 04:54:09 +03:00
|
|
|
* benchmark
|
2019-11-14 10:09:36 +03:00
|
|
|
* cgi
|
|
|
|
* delegate
|
|
|
|
* getoptlong
|
|
|
|
* net-pop
|
|
|
|
* net-smtp
|
|
|
|
* open3
|
|
|
|
* pstore
|
|
|
|
* singleton
|
2019-12-23 11:46:08 +03:00
|
|
|
* The following default gems were only promoted at ruby-core,
|
|
|
|
but not yet published on rubygems.org.
|
2019-11-14 10:09:36 +03:00
|
|
|
* monitor
|
|
|
|
* observer
|
|
|
|
* timeout
|
|
|
|
* tracer
|
|
|
|
* uri
|
|
|
|
* yaml
|
|
|
|
|
2019-10-07 22:55:22 +03:00
|
|
|
pathname::
|
|
|
|
|
|
|
|
* Kernel#Pathname when called with a Pathname argument now returns
|
|
|
|
the argument instead of creating a new Pathname. This is more
|
|
|
|
similar to other Kernel methods, but can break code that modifies
|
|
|
|
the return value and expects the argument not to be modified.
|
|
|
|
|
2019-03-11 16:00:31 +03:00
|
|
|
profile.rb, Profiler__::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Removed from standard library. It was unmaintained since Ruby 2.0.0.
|
2019-03-11 16:00:31 +03:00
|
|
|
|
2019-12-24 05:28:18 +03:00
|
|
|
=== Command line option
|
|
|
|
|
|
|
|
* +-W+ option has been extended with a following +:+, to manage categorized
|
|
|
|
warnings. [Feature #16345] [Feature #16420]
|
|
|
|
|
|
|
|
# deprecation warning
|
|
|
|
$ ruby -e '$; = ""'
|
|
|
|
-e:1: warning: `$;' is deprecated
|
|
|
|
|
|
|
|
# suppress the deprecation warning
|
|
|
|
$ ruby -W:no-deprecated -e '$; = //'
|
|
|
|
|
|
|
|
# works with RUBYOPT environment variable
|
|
|
|
$ RUBYOPT=-W:no-deprecated ruby -e '$; = //'
|
|
|
|
|
|
|
|
# experimental feature warning
|
|
|
|
$ ruby -e '0 in a'
|
|
|
|
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
|
|
|
|
|
|
|
|
# suppress experimental feature warning
|
|
|
|
$ ruby -W:no-experimental -e '0 in a'
|
|
|
|
|
|
|
|
# suppress both by using RUBYOPT
|
|
|
|
$ RUBYOPT='-W:no-deprecated -W:no-experimental' ruby -e '($; = "") in a'
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== C API updates
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-10-07 22:55:22 +03:00
|
|
|
* Many <code>*_kw</code> functions have been added for setting whether
|
|
|
|
the final argument being passed should be treated as keywords. You
|
|
|
|
may need to switch to these functions to avoid keyword argument
|
|
|
|
separation warnings, and to ensure correct behavior in Ruby 3.
|
|
|
|
|
|
|
|
* The <code>:</code> character in rb_scan_args format string is now
|
|
|
|
treated as keyword arguments. Passing a positional hash instead of
|
|
|
|
keyword arguments will emit a deprecation warning.
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* C API declarations with +ANYARGS+ are changed not to use +ANYARGS+.
|
|
|
|
See https://github.com/ruby/ruby/pull/2404
|
2019-09-01 08:54:04 +03:00
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Implementation improvements
|
2017-12-28 23:09:24 +03:00
|
|
|
|
2019-07-01 07:24:39 +03:00
|
|
|
Fiber::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Allow selecting different coroutine implementations by using
|
|
|
|
+--with-coroutine=+, e.g.
|
2019-07-01 07:24:39 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
$ ./configure --with-coroutine=ucontext
|
|
|
|
$ ./configure --with-coroutine=copy
|
2019-07-01 07:24:39 +03:00
|
|
|
|
|
|
|
* Replace previous stack cache with fiber pool cache. The fiber pool
|
|
|
|
allocates many stacks in a single memory region. Stack allocation
|
|
|
|
becomes O(log N) and fiber creation is amortized O(1). Around 10x
|
|
|
|
performance improvement was measured in micro-benchmarks.
|
|
|
|
|
2019-10-07 22:55:22 +03:00
|
|
|
File::
|
|
|
|
* File.realpath now uses realpath(3) on many platforms, which can
|
|
|
|
significantly improve performance.
|
|
|
|
|
2019-10-21 10:48:37 +03:00
|
|
|
Hash::
|
|
|
|
* Change data structure of small Hash objects. [Feature #15602]
|
|
|
|
|
2019-10-19 22:52:20 +03:00
|
|
|
Monitor::
|
|
|
|
* Monitor class is written in C-extension. [Feature #16255]
|
|
|
|
|
2019-06-23 16:28:23 +03:00
|
|
|
Thread::
|
|
|
|
|
|
|
|
* VM stack memory allocation is now combined with native thread stack,
|
|
|
|
improving thread allocation performance and reducing allocation related
|
2019-12-23 16:45:24 +03:00
|
|
|
failures. Around 10x performance improvement was measured in micro-benchmarks.
|
2019-06-23 16:28:23 +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-12-23 11:46:08 +03:00
|
|
|
* The default value of +--jit-max-cache+ is changed from 1,000 to 100.
|
2019-03-17 08:28:54 +03:00
|
|
|
|
2019-12-23 11:46:08 +03:00
|
|
|
* The default value of +--jit-min-calls+ is changed from 5 to 10,000.
|
2019-03-17 08:28:54 +03:00
|
|
|
|
2019-12-23 22:16:40 +03:00
|
|
|
RubyVM::
|
|
|
|
|
|
|
|
* Per-call-site method cache, which has been there since around 1.9, was
|
|
|
|
improved: cache hit rate raised from 89% to 94%.
|
|
|
|
See https://github.com/ruby/ruby/pull/2583
|
|
|
|
|
2019-12-21 23:20:08 +03:00
|
|
|
RubyVM::InstructionSequence::
|
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* RubyVM::InstructionSequence#to_binary method generates compiled binary.
|
2019-12-21 23:20:08 +03:00
|
|
|
The binary size is reduced. [Feature #16163]
|
|
|
|
|
2018-10-17 14:35:28 +03:00
|
|
|
=== Miscellaneous changes
|
2019-01-10 11:22:23 +03:00
|
|
|
|
2019-06-30 18:47:55 +03:00
|
|
|
* Support for IA64 architecture has been removed. Hardware for testing was
|
2019-06-23 16:28:23 +03:00
|
|
|
difficult to find, native fiber code is difficult to implement, and it added
|
|
|
|
non-trivial complexity to the interpreter. [Feature #15894]
|
|
|
|
|
2019-12-23 16:45:24 +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
|
|
|
|
2019-08-12 13:13:30 +03:00
|
|
|
* Ruby's upstream repository is changed from Subversion to Git.
|
2019-04-22 15:23:37 +03:00
|
|
|
|
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.
|
2019-11-11 11:17:26 +03:00
|
|
|
|
2019-12-23 16:45:24 +03:00
|
|
|
* Support built-in methods in Ruby with the <code>_\_builtin_</code> syntax. [Feature #16254]
|
|
|
|
|
2019-11-11 11:17:26 +03:00
|
|
|
Some methods are defined in *.rb (such as trace_point.rb).
|
|
|
|
For example, it is easy to define a method which accepts keyword arguments.
|