Ruby 2.4.0 is the first stable release of the Ruby 2.4 series. It introduces many new features, for example:
Improve the internal structure of hash table (st_table) by introducing open addressing and an inclusion order array. This improvement has been discussed with many people, especially with Yura Sokolov.
While you are debugging, you may often use
p to see the value of variables. With pry you can use
binding.pry in your application to launch a REPL and run any Ruby code. r56624 introduces
binding.irb which behaves like that with irb.
Though ISO/IEC 30170:2012 doesn’t specify details of the Integer class, Ruby had two visible Integer classes: Fixnum and Bignum. Ruby 2.4 unifies them into Integer. All C extensions which touch the Fixnum or Bignum class need to be fixed.
String/Symbol#upcase/downcase/swapcase/capitalize(!) now handle Unicode case mappings instead of only ASCII case mappings.
Ruby 2.4 also contains the following performance improvements including language changes:
[x, y].max and
[x, y].min are optimized to not create a temporary array under certain conditions.
Regexp#match?, which executes a regexp match without creating a back reference object and changing
$~ to reduce object allocation.
Ruby ignores exceptions in threads unless another thread explicitly joins them. With
report_on_exception = true, you can notice if a thread has died due to an unhandled exception.
Send us feedback what should be the default for
report_on_exception and about report-on-GC, which shows a report when a thread is garbage collected without join.
Ruby has deadlock detection around waiting threads, but its report doesn’t include enough information for debugging. Ruby 2.4’s deadlock detection shows threads with their backtrace and dependent threads.
See NEWS or commit logs for details.
With those changes, 2523 files changed, 289129 insertions(+), 84670 deletions(-) since Ruby 2.3.0!