🇺🇦 #​607 — June 9, 2022

Read on the Web

Ruby Weekly

What Would It Take for Roda to Win? — The creator of the Bridgetown site generator (which itself uses Roda at its heart) explains why he’s such a huge fan of the popular routing-oriented webapp library and how it bridges the gap between small and larger Ruby webapps better than, say, Sinatra.

Jared White

'I Built a Ruby Parser' — A story of a side project that led to Natalie, an early-stage alternative Ruby implementation with ahead-of-time compilation, and the up-and-down journey of getting to something that works. (Natalie can already work with a reasonable subset of Ruby, as seen in an example like this.)

Tim Morgan

AppSignal Logbook: Team Discussion and Full Incident History — With Logbook you get the full incident history. Read and leave team comments, see which notifications were sent at what time, and see team activity for changes in incident states. It's easier than ever to see what the current state of an incident is.

AppSignal sponsor

Why GitLab is Sticking with Rails — The CEO of the popular git forge/devops platform reflects on why GitLab started with Rails (despite its founder coming from a PHP background) and why maintaining a ‘modular monolith’ continues to make sense for them.

Sid Sijbrandij

Sidekiq 6.5: Simple, Efficient Background Processing6.5.0 features refactoring of Sidekiq’s internals, beta support for redis-client, and beta support for DB transaction-aware clients.

Mike Perham

Quick Bits:

Jobs

Ruby/React Full Stack Software Engineer (Paris or Remote) — Help us build a robust frontend and enhance the user experience on our contact center service used by top brands.
RingCentral Engage Digital

Backend Engineer | Remote Within CET (-3/+3 Hours) | Full-Time — Join us as a Backend Engineer to create the finance solution all businesses love - Tailor made remote policy or relocation package.
Qonto

Senior Full Stack Engineer (Remote) — Help us in our transition from a collection of SPAs to a Rails+Hotwire application to rethink how modern real-time web-apps work.
Poll Everywhere

Find Ruby Jobs Through Hired — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers.
Hired

📕 Articles & Tutorials

Why Braintree Added Jitter to Active Job — Occasional spikes of failures led the Braintree team to a ‘thundering herd’ problem and why adding a little randomness to retry intervals calmed everything down. The results of this work ended up in Rails 6.1.

Antross (Braintree / PayPal)

Adding Feature Flags to a Rails App with FlipperFlipper makes it reasonably easy to turn features on or off for specific users or groups of users, enabling a more granular way of testing new features on your app without throwing everyone in at the deep end.

Hans-Jörg Schnedlitz (AppSignal)

Couchbase Capella DBaaS: Store JSON, Query in Milliseconds

Couchbase sponsor

How to Query and Group Records by Duration in Active Record — How do you even save a “duration”, let alone query for records by that value? It’s easier than you think, says Steve.

Steve Polito

Using Active Record with SQLite in a JRuby Desktop App
Andy Maleh

🛠 Code & Tools

ActiveRecord::Summarize: Improved Efficiency for .count and .sum Queries — An Active Record extension that transparently combines related count/sum queries so they can answered in a single pass. “It’s like a go_faster block,” claims the docs, and hardly any changes are required to your existing code either.

Joshua Paine

Strong Migrations 1.1: Catch Unsafe Migrations in Development — Detects potentially dangerous operations and prevents them running by default.

Andrew Kane

Observability for Your Ruby Test Suites — Get instant, real-time visibility into the performance of your Minitest and RSpec tests with Buildkite Test Analytics.

Buildkite sponsor

Phonelib 0.7: Validate Phone Numbers Using Google's libphonenumber Data — Can perform basic validations and formatting checks on international phone numbers.

Vadim Senderovich

cfndsl: A DSL for Generating AWS CloudFormation Templates
Steven Jack

Faraday HTTP Cache: Faraday Middleware That Respects HTTP Caching
SourceLevel

💡 Tip of the Week

Anonymous Block Forwarding

Many of us have likely read or written Ruby code that takes a block argument and delegates it straight to another method. For example:

def some_method(&block)
  other_method(&block)
end

We name a block argument &block (or something similar) just to forward that &block argument to another method.

Last year's Ruby 3.1 release introduced anonymous block forwarding when the argument is being passed to another method. This means that as of Ruby 3.1, you no longed need to name the block parameter and can instead use &. Our example above becomes:

def some_method(&)
  other_method(&)
end

If you're interested in adopting (or avoiding!) this style into your codebase, there's already a RuboCop cop for it!

This week’s tip was written by Jemma Issroff.