Skip to content

Ruby 2.4 support #4293

@headius

Description

@headius

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

Core classes updates (outstanding ones only)

  • Array

  • Comparable

  • Dir

  • Enumerable

  • Enumerator::Lazy

  • File

  • 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

  • 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

  • Module

  • Numeric

  • 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
  • Regexp

  • 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

  • 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

  • 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

  • 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

Implementation improvements

  • In some condition, [x, y].max and [x, y].min are 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 to Math.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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions