#​706 — June 6, 2024

Read on the Web

Together with  FastRuby.io

Ruby Weekly

Bundler Auto-Install Just Got a Whole Lot Better — Bundler has a handy new feature. As of Bundler 2.5.10, you can now enable the auto_install config to have Bundler automatically install your bundle on demand, which might be particularly handy when working on a project with others.

Ngan Pham (RubyGems)

Omakub: DHH's 'Omakase' Developer Setup for Ubuntu 24.04 — DHH, no stranger to specifying his preferred conventions generally, now has a script that will turn an Ubuntu machine into a “modern web development system.” On the menu are dotfiles, a terminal workspace, your choice of VS Code or LazyVim, and more. And is there a DHH screencast showing it all off? Of course!

David Heinemeier Hansson

💡 In other DHH news, he's written about why he 'retired from the tech crusades.' Even if DHH isn't your cup of tea, this is one of his nicer posts. "Programming is a beautiful game," he says, encouraging us all to share whatever it is that works for us.

🚀 Need an Action Plan to Upgrade to Rails 7.2 and Ruby 3.3? — The Roadmap by @FastRubyIO: Discover the work and effort it takes to upgrade and ensure security compliance. Backed by 30,000+ hours on upgrades, your zero-downtime upgrade journey begins here. Know how long it will take before you begin.

FastRuby.io | Upgrade Services sponsor

Puts Debuggerer 1.0: Classic Debugging, But Better — Inspired by Aaron Patterson’s ‘I am a puts debuggerer’ post, Andy has created a ‘guilt-free’ puts-style debugging gem that prints out much more useful information than puts/p (or even Amazing Print) alone.

Andy Maleh

A Quick Intro to Endless Methods — No, not those 500 line behemoths we’ve all had to maintain one time or another 🫣.. but Ruby 3.0’s one line methods that don’t require an explicit end.

Lucian Ghinda

📄 Articles, Tutorials & Videos

3 Mental Models for Ruby Enumerators — If you struggle with grokking the Enumerator class or distinguishing it from the Enumerable module, these models may help you iterate like a boss.

Joël Quenneville (Thoughtbot)

The Old vs New case Statementcase/when being the classic approach, and case/in taking the pattern matching route.

Jake Zimmerman

Register Now: Optimizing Slow Queries with EXPLAIN to Fix Bad Query Plans — This webinar is geared towards practitioners that work with Postgres, either as an app dev, or as part of the DB or infra team.

pganalyze sponsor

Lesser Known Rails Helpers to Write Cleaner View Code — Including class_names, safe_join, excerpt, to_sentence, and several others.

Rails Designer

A Trick for Invariant Generics in Sorbet“There’s a neat trick for using generic methods to get around some of the limitations that invariant type members in generic classes carry.”

Jake Zimmerman

Why Ruby’s Timeout is Dangerous (and Thread.raise is Terrifying) — This dates from 2015, believe it or not, but provoked some fresh discussion on social media this week.

Julia Evans

How to Build and Deploy a Telegram Bot with Kamal — Note that the bot is written in Go (yes, we have a newsletter for that), but it’s neat to see Ruby’s own Kamal being used in the deployment.

Kyrylo Silin

📄 Compress Your Images – Optimizing the size of images is good, and you can automate it with a GitHub Action. Andy Croll

📄 Why is Redirect Logic Always So Complex?“and what can we do to address it?” Dave Paola

📄 Things You Wish You Didn't Need to Know About S3 Daniel Grzelak

📄 How to Use Tailwind CSS for Your Rails Project Thomas Riboulet

📄 A Testing Anti-Pattern: Accessing Private Properties Jason Swett

🛠 Code & Tools

WahWah 1.6: A Library for Reading Audio Metadata — Think things like MP3 IDv3 tags, embedded images, and similar metadata in formats including MP3, M4A, OGG, OGA, OPUS, WAV, FLAC, etc. Pure Ruby too, with no dependencies.

Aidewoode

MemoWise 1.9: A Modern Choice for Ruby Memoization — Prepend this to your classes and get access to some helpers to make memoization as easy as pie.

Panorama Education

What’s a “Noisy Neighbor”, and What Can You Do About It? — It’s maddening! You didn’t change a thing, but your app is randomly slowing down. It’s not you, it’s them.

Judoscale sponsor

 Camping 3.2: One of Ruby's Oldest Web Frameworks — You don’t get many Ruby projects with git commits from 19 years ago, nor many that were originally created by why the lucky stiff. Camping is, however, still maintained and its minimalist, composable concepts have aged well.

Various Contributors

Blind Index 2.5: Securely Search Encrypted Database Fields — Works with both Lockbox and attr_encrypted.

Andrew Kane

  • High Voltage 4.0 – Include static pages in your Rails app. It's in maintenance mode, but this release add Rails 7.1 support.

  • Kamal 1.6 – The container-based app deployer. Notably the healthcheck step during deployment has been removed.

  • PostgreSQLCursor 0.6.9 – Extends Active Record for more efficient processing of queries by using Postgres cursors.

  • rbspy 0.21.0 – Sampling CPU profiler for Ruby processes. Now with Ruby 3.1.6 and 3.3.2 support.

  • attr_encrypted 4.1attr_accessors but with encryption and decryption.

  • Elasticsearch Rails 8.0 – Elasticsearch integrations for ActiveModel/Record.

  • Passwordless 1.7 – Rails magic link auth sans passwords.

  • UserAgentParser 2.18.0 – User agent string parser.

  • Ruby Polars 0.11 – Fast DataFrames for Ruby.