-
-
Notifications
You must be signed in to change notification settings - Fork 933
Description
This bug will track all NEWS items new in Ruby 2.4. This list is based off https://github.com/ruby/ruby/blob/trunk/NEWS.
Only changes relevant to JRuby are listed here. MRI-specific internal changes and features are not included.
NOTE: Pull requests should be done against the ruby-2.4 branch.
Language changes
-
Multiple assignment in conditional expression is now allowed. Feature #10617
-
Refinements is enabled at method by Symbol#to_proc. Feature #9451
-
Refinements is enabled with Kernel#send and BasicObject#__send__. Feature #11476
-
Rescue modifier now applicable to method arguments. Feature #12686
-
Toplevel return is now allowed. Feature #4840
Core classes updates (outstanding ones only)
-
Array
-
Array#max and Array#min. Feature #12172
-
Array#sum Feature #12217
-
Array#concat Feature #12333
-
Array#pack now takes optional argument
buffer:to reuse an already-allocated buffer. Feature #12217
-
-
Comparable
- Comparable#clamp. Feature #10594
-
Dir
- Dir.empty?. Feature #10121
-
Enumerable
- Enumerable#sum Feature #12217
- Enumerable#uniq Feature #11090
- Enumerable#chunk called without a block now return an Enumerator. Feature #2172
-
Enumerator::Lazy
- Enumerator::Lazy#chunk_while GH-1186
- Enumerator::Lazy#uniq Feature #11090
-
File
- File.empty?. Feature #9969
-
Float
-
Float#ceil, Float#floor, and Float#truncate now take an optional digits, as well as Float#round. Feature #12245
-
Float#round now takes an optional keyword argument, half option, and
the default behavior is round-up. Bug #12548 Bug #12958
half option can be one of :even, :up, and :down. Feature #12953
-
-
Hash
- Hash#transform_values and Hash#transform_values! Feature #12512
- Hash#compact and Hash#compact! Feature #11818
-
Integer
-
Integer#ceil, Integer#floor, and Integer#truncate now take an optional digits, as well as Integer#round. Feature #12245
-
Fixnum and Bignum are unified into Integer Feature #12005
-
Integer#digits for extracting columns of place-value notation Feature #12447
-
Integer#round now takes an optional keyword argument, half option, and
the default behavior is round-up. Bug #12548 Bug #12958
half option can be one of :even, :up, and :down. Feature #12953
-
-
IO
- IO#gets, IO#readline, IO#each_line, IO#readlines, IO.foreach now takes an optional keyword argument, chomp flag. Feature #12553
-
Kernel
- Kernel#clone now takes an optional keyword argument, freeze flag. Feature #12300
-
MatchData
- MatchData#named_captures Feature #11999
- MatchData#values_at supports named captures Feature #9179
-
Module
- Module.used_modules Feature #7418
- Module#refine accepts a module as the argument now. Feature #12534
-
Numeric
- Numeric#finite?, Numeric#infinite? Feature #12039
-
Process
- Support CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced by macOS 10.12.
-
Rational
- Rational#round now takes an optional keyword argument, half option, and
the default behavior is round-up. Bug #12548 Bug #12958
half option can be one of :even, :up, and :down. Feature #12953
- Rational#round now takes an optional keyword argument, half option, and
-
Regexp
- Regexp#match? Feature #8110
- meta character \X matches Unicode 9.0 characters with some workarounds for UTR Allow disabling ENV write-through to the real environment [JRUBY-5934] #51 Unicode Emoki, Version 4.0 emoji zwj sequences
- Update Onigmo 6.0.0 (we have never incorporated all of Onigmo's additions into Joni)
-
Regexp/String: Updated Unicode version from 8.0.0 to 9.0.0 Feature #12513
-
String
-
String#upcase, String#downcase, String#capitalize, String#swapcase and their bang variants work for all of Unicode, and are no longer limited to ASCII. Supported encodings are UTF-8, UTF-16BE/LE, UTF-32BE/LE, and ISO-8859-1~16. Variations are available with options. See the documentation of String#downcase for details. Feature #10085
-
String.new(capacity: size) Feature #12024
-
String#concat, String#prepend Feature #12333 Now takes multiple arguments.
-
String#unpack1 Feature #12752
-
String#match? Feature #12898
-
String#each_line, String#lines now takes an optional keyword argument, chomp flag. Feature #12553
-
String#concat, String#prepend now take multiple arguments Feature #12333
-
String#casecmp? Feature #12786
-
-
StringIO
- StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines now take optional keyword argument, chomp flag. Feature #12553
-
Symbol
-
Symbol#match now returns MatchData. Bug #11991
-
Symbol#upcase, Symbol#downcase, Symbol#capitalize, and Symbol#swapcase now work for all of Unicode. See the documentation of String#downcase for details. Feature #10085
-
Symbol#match? Feature #12898
-
Symbol#casecmp? Feature #12786
-
-
Thread
- Thread#report_on_exception and Thread.report_on_exception Feature #6647
-
TracePoint
- TracePoint#callee_id Feature #12747
-
Warning
- New module named Warning is introduced. By default it has only one singleton method, named warn. This makes it possible for 3rd-party libraries to control the way warnings are handled. Feature #12299
Stdlib updates (only items that need specific attention in JRuby)
-
pathname
- New method: Pathname#empty? Feature #12596
-
Readline
- Readline.quoting_detection_proc and Readline.quoting_detection_proc= Feature #12659
Compatibility issues (excluding feature bug fixes)
-
Array#sum and Enumerable#sum are implemented. Feature #12217
-
Fixnum and Bignum are unified into Integer Feature #12005
-
String/Symbol#upcase/downcase/swapcase/capitalize(!) now work for all of Unicode, not only for ASCII. Feature #10085
-
TRUE / FALSE / NIL These constants are now obsoleted. Feature #12574
Stdlib compatibility issues (excluding feature bug fixes)
-
DateTime
- DateTime#to_time now preserves timezone. Bug #12189
-
Psych
- Update Psych 2.2.2
-
RDoc
- Update RDoc 5.0.0
-
RubyGems
- Update RubyGems 2.6.8
-
Time
- Time#to_time now preserves timezone. Bug #12271
-
thread
- the extension library is removed. Till 2.0 it was a pure ruby script "thread.rb", which has precedence over "thread.so", and has been provided in $LOADED_FEATURES since 2.1.
-
Zlib
- Zlib.gzip and Zlib.gunzip Feature #13020
Implementation improvements
-
In some condition,
[x, y].maxand[x, y].minare 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 toMath.max(x, y). -
Thread deadlock detection now shows their backtrace and dependency. Feature #8214
-
st_table (st.c) internal data structure is improved. Feature #12142
-
Rational is extensively optimized. Feature #12484