#​701 — May 2, 2024

Read on the Web

Together with  Memetria

Ruby Weekly

Fixing a Footgun in ActiveRecord::Core#inspect — Objects have an inspect method that returns a string representation that can be useful in development and debugging. ActiveRecord objects do too, with some added enhancements to highlight what you need to know. It turns out, however, inadvertently calling on ActiveRecord::Core#inspect in production can cause real performance issues..

Andrew Novoselac

Explaining Thruster, 37signals' HTTP/2 Proxy to Speed Up Your App — Available as a gem, though written in Go, Thruster is an HTTP/2 proxy server that addresses some of Puma’s shortfalls around serving assets. Thruster is one of many options, which Bruno explains in this good-enough-to-have-been-a-blog-post discussion.

Breno Gazzola

Memetria: Secure, Scalable Redis Hosting — High performance Redis hosting with large key tracking, detailed metrics, and a superior uptime record.

Memetria sponsor

Ruby Might Be Faster Than You Think — The “Ruby is Slow” mantra is so often chanted that many probably accept it without thought, but here’s a case where some minor tweaks result in Ruby being 5X faster than the compared language. (Say it with me “Ruby is fast enough.”)

John Hawthorn

JRuby 9.4.7.0 Released — The long standing, reliable, and performant JVM-based Ruby implementation takes another gentle step forward with dependency updates and several fixed edge cases.

The JRuby Team

  • 📅 If you wanted to attend Rails World (mentioned last week), I hope you got a ticket as apparently they sold out in under 20 minutes. A second, smaller batch of tickets is tempted for a later date, however.

  • 🇸🇪 If you want an event you can still get a ticket for, Baltic Ruby takes place in Sweden next month (June 13-15) with Matz attending in person – his first talk in Europe for some years. He's also speaking at Red Dot Ruby in Singapore in July.

  • 💻 DHH's latest thing is "moving continuous integration back to developer machines" in a further effort to reduce complexity.

  • 🎂 I suspect many Rubyists will have written some BASIC once – it's where I started – so congratulations to the BASIC language turning 60 years old.

  • 📉 Over on Reddit, someone has observed that the new Ruby 3.3.1 seems to have resolved some of Ruby's recent memory leak issues.

  • 🐦 Ruby LSP now supports Go to Definition for methods.

📄 Articles, Tutorials & Videos

Choosing the Right Audit Trail Approach in Ruby — A look across the vast landscape of tools and libraries for keeping tabs on data changes, user activity, console use, and more.

Evgeny Li

Backup Strategies for SQLite in Production — Not Ruby specific, but a fantastic primer to a topic that may begin to affect more Rubyists as the idea of running Rails apps on SQLite in production continues to take off.

Mohammad A. Ali

Free eBook: Advanced Database Programming with Rails and Postgres — Learn about subqueries, materialized views, and custom data types in Postgres & Rails and follow along with our examples.

pganalyze sponsor

Adding Your Ruby Gems to AWS CodeArtifact — Amazon Web Services is showing more love to Ruby by enabling the use of CodeArtfact as a private gem server. You can also set it up to pull gems from upstream sources (like rubygems․org) automatically so you can have your custom and public gems all on one server.

Sébastien Stormacq (Amazon)

Rails, Assets, ActiveStorage and a CloudFront CDN — How to configure your Ruby on Rails app to use Amazon CloudFront for assets as well as ActiveStorage / ActionText.

Olly Headey

📄 AnyCable for Rails: How Does it Improve over Action Cable? Abiodun Olowode

📄 Installing Older Ruby Versions on Ubuntu 24.04 and 22.04 Dean Perry

📄 ActiveRecord::Base#pluck Adds Support for Hash Values in Rails 7.2 Nishant Samel

📄 Using Local Font Files in the Rails 7.1 Asset Pipeline Paul Sadauskas

📄 Rails to Enhance Its Log Output with an SQL Query Count Apoorv Tiwari

📄 Refactoring for Readability in Ruby: A Showcase Dmitrii Krasnov

🛠 Code & Tools

XRB: Think ERB But Even More HTML-y — XRB is a simple template engine for Ruby that boasts being 10-20x faster than ERB (not to be confused with Erubi/Erubis, though) with a simpler syntax that’s closer to plain HTML (and which also supports Ruby style #{} interpolation).

Samuel Williams et al.

rbspy 0.20.0: A Sampling Profiler for Ruby — Provides a way to profile a Ruby app even without having to restart it. v0.20.0 extends support to the latest Ruby versions, including 3.3.1.

Evans, Jensen, et al.

Don't Risk Out of Date Ruby & Rails Versions — Get a free security assessment and discuss how our incremental upgrade service — CodeCare Shield — can improve the speed, security and stability of your app.

reinteractive/CodeCare® Shield sponsor

Karafka 2.4: Advanced Kafka Processing for Ruby and Rails — A significant release for a powerful multi-threaded processing framework to use with the Apache Kafka event streaming system. GitHub repo.

Maciej Mensfeld

💡 If you want to learn more about where you might use Kafka and Karafka, Brad Urani's talk ▶️ Event Streaming Patterns for Ruby Services and Guillermo Aguirre's ▶️ Applying Microservices Patterns to a Modular Monolith may provide inspiration.

Measured 3.0: Encapsulate Measurements and Their Units — A library from Shopify for storing, manipulating and converting weights, lengths, and volumes in different units. v3.0 adds Rails integration without needing a separate gem.

Shopify

Rackula 1.4: Generate Static Sites from any Rack Middleware — For turning a Rack-powered webapp into a static copy.

Samuel Williams

⚙️ SidekiqJobController – Finer grained, immediate control over job processing. Circle

  • 🤖 Ruby OpenAI 7.0 – Use OpenAI's APIs from Ruby. v7 also allows easier use of local LLMs (such as via Ollama), support for batches, and updates Assistants support.

  • Mongoid 9.0 – Ruby ODM framework for MongoDB.

  • Doorkeeper 5.7 – OAuth 2 provider for Rails / Grape.

  • ActiveHash 3.3 – Use a hash as a data source ActiveRecord style.

  • Shrine 3.6 – File attachment handling library.

  • Kamal 1.5.1 – The container-based app deployer.

  • httparty 0.22 – The one and only.