#482 — January 2, 2020

Read on the Web

🎉 As expected, after over a year of development, Ruby 2.7 came out on Christmas Day complete with a variety of new features, tweaks, and the usual bug fixes. Enjoy this special round-up issue focused on the new release before we get back to usual service on January 9 😄
P.S. Be sure to check out the end of the issue to see my personal favorite 2.7 feature!

Ruby Weekly

Ruby 2.7.0 Released — What better place to start than the official news announcement? This post covers some of the new features briefly and provides download links to the source releases. Here’s the 2.7.0 tarball if you want it yourself.

Yui Naruse

Digging Into Ruby 2.7's Changes — Built up from the official news and release notes, this is a deeper look at what each of the new Ruby 2.7 features and changes really mean, complete with short code examples. If you want to read just one post that covers all of the changes in just enough depth, this is the one.

Ruby References

Introducing Automated Postgres EXPLAIN Plan Insights on pganalyze — Other tools might show what happened in the database, pganalyze equips engineering teams with the insights to understand why it happened. Check out our new EXPLAIN insights features to get simple visualizations of costliest plan nodes, slow sorts, and more.

pganalyze sponsor

An Update on Ruby's JIT Development Progress — It was hoped that the experiments done on JIT compilation for Ruby in Ruby 2.6 onwards would yield major benefits by now, but while a lot of work has been done, Rails still poses a problem. Here’s the story.

k0kubun

▶  Pattern Matching: The Big New Feature in Ruby 2.7 — Pattern matching has been introduced as an experimental feature in Ruby 2.7. This presentation from RubyConf looked at the current syntax and the policies around its design.

Kazuki Tsujimoto

▶  A Practical Demo of Ruby 2.7's Pattern Matching Features — A 15 minute screencast that goes beyond the theory and into the practicalities of using Ruby 2.7’s pattern matching support to tighten up code around extracting data from YAML files.

Context Free

Ruby 2.7's New ... Shorthand Syntax for Argument Forwarding — In short, you can use the syntax ... in parameter or argument lists to basically ‘pass through’ (or forward) arguments from one method to another. “It acts similar to calling super without any arguments.”

Narendra Rajput

🛤 Smaller Things Ruby 2.7 Added / Changed

A round-up of less obvious things that Ruby 2.7 has introduced 😄

What's New in IRB in Ruby 2.7? — IRB, the trusty Ruby REPL, isn’t something we often see getting updated with new Ruby releases, but Ruby 2.7 changes it quite a bit by introducing a few niceties like syntax highlighting and multi-line editing. Pry may, however, remain the power user’s REPL of choice.

Prajakta Tambe

The Delegation Challenge of Ruby 2.7 — Ruby 2.7 introduces a deprecation/warning around the behavior of arguments that will require a lot of code is updated to work with Ruby 3.0 (due at the end of 2020). You might find the pull request where Action Mailer is fixing the warnings to be of interest.

Benoit Daloze

Managing Warnings Emitted by Ruby 2.7 — Due to deprecations and syntax changes, Ruby 2.7 will output some warnings where you wouldn’t have seen any before. If you need to curb these (temporarily!) here’s how to turn down the volume.

Prathamesh Sonpatki

RubyGems 3.1.2 Released

Hiroshi Shibata

🎩 My favorite Ruby 2.7 feature!

It's going to seem like such a small thing, but perhaps the most valuable addition to Ruby 2.7 for me is Enumerable#tally!

This hugely speeds up a common (for me, at least) operation which I might previously have done with something like arr.group_by(&:itself).map { |k, v| [k, v.size] }.to_h

If you want to learn a little more about how it works, Brandon Weaver has this introductory post.