Short Ruby News - Edition #104

The one with Josef's new book about Minitest, where Xavier celebrates 15 years of maintaining Rails contributors app and where Andrew launches state-of-the-art transformers gem for Ruby

You can jump directly to a section:

🚀 Launches & 📅 Events

👉 All about Code and Ruby: 💻 Code, 📐Code Design,💡Around, ❤️ Why Choose Ruby

🧰 Gems, Libraries, and Updates: 🆕 New, 🧰 Updates

🤝 Related (but not Ruby-specific)

More content: 📚 🗞 🎧 🎥 ✍🏾 (articles, podcasts, videos, newsletters)

[Sponsor ⬇] reinteractive.com

The reinteractive Application Code Review is a deep dive into your application, providing you a complete window into the state of your app.

🚀 Launches and discounts

📚 Josef Strzibny launched Test Driving Rails: Take Minitest and fixtures for a spin

🚀 Nate Berkopec announced the launch of his new retainer service Ruby on Rails Performance Service

🚀 Rails Plan launched Web Application Metadata Markup

📅 Events

📆 Events happening this week if you want to attend (source: RubyConferences):

📅 Scot Rug announced the new conference Haggis Ruby is coming... | Haggis Ruby

👉 All about Code and Ruby

🥳 Xavier Noria celebrated 15 year of building Rails Contributors - All time

🥳  Evil Martians published a new video showing the atmosphere from the Ruby Meetup co-hosted with YCombinator in San Francisco:

💻 Code Samples

️💻 Michael Chaney shared about doing find_or_initialize by with unpersisted record:

️💻 John Nunemaker shared ActiveRecord scopes can use arel_table, which allows regex matching without having to use SQL strings. Eileen suggested against using the arel_table since it’s a private API

️💻 Nate Hopkins shared a code sample about how using pattern matching could improve readability:

️💻 Michael Chaney shared about how pattern matching will only work with hashes that use symbols as keys:

💻 Bradley Schaefer shared a code sample using module File::File::Constants - RDoc Documentation 

️💻 Ruby Cademy shared how to use ActionDispatch::DebugLocks to diagnose deadlocks efficiently.

️💻 Nidhi Sarvaiya shared a detailed journey how Enums have evolved across multiple versions of Ruby on Rails.

️💻 Igor Alexandrov asked a question about redirect options (he reviewed multiple solutions after the poll ended at Redirect and return in Rails controllers)

️💻 Ruby Cademy shared how ActionView::Helpers::FormBuilder and default_form_builder help us create reusable form components.

️💻 Rob Lacey shared a code sample about assigning undefined local variable and method will still create a nil variable:

️💻️ Samuel Williams shared how moving logic out of initialize helps make testing and implementation easier

He later added:

️💻 Michael Chaney shared a detailed thread about the subtle differences between each_with_object and inject

️💻 Saeloun shared how db:seed:replant works. Read their blog to know more.

️💻 Zhephyn shared a detailed thread introducing ActionCable. Do give it a full read 

💻 Ruby Cademy shared how to use ActionDispatch::PermissionsPolicy and the HTTP Feature-Policy response header to secure your Rails app by controlling browser features

️💻 Ruby Cademy shared a tip about using Rails #future? to check if a date is in the future:

They added that Rails also supports #past?

️💻 RoR vs Wild shared a couple of benchmarks about Strings operations:

Stephen Margheim added:

Xavier Noria added:

Jean Boussier added:

️💻 Akash Manohar shared about configuring scheduled jobs for concurrency when using Goodjob gem:

️💻 RoR Vs Wild shared about Array#find vs Array#bsearch (read the full thread here):

️💻 Marc Köhlbrugge shared a code sample about working with Cloudflare:

️💻 Andrei Bondarev shared a code sample to Enable debug for all Ruby HTTP requests

️💻 Michael Chaney shared a thread about merging queries with Active Record:

️💻 Samuel Williams shared an example about streaming downloads in Rails: async-examples/rails-streaming-download/app/controllers/streaming_controller.rb at main · socketry/async-examples

️💻 Ruby Cademy shared about Rails suppressor method:

️💻 Thibaut Barrère shared a code sample about automating secret retrieval from 1Password via their CLI:

📐 Thinking about Code Design

️📐 Mohammad A. Ali shared about running Ruby apps with 1M MAUs combined using a single server:

️️📐 Nate Berkopec shared how installing jemalloc is a no-brainer if you’re running a Rails application, which gives instant memory savings by making a 3-line change

He lated added the 3 lines proposed:

Szymon Fiedler also added that using jemalloc was very helpful in reducing memory utilization:

️️️📐 Dmitry Davydov shared about Ruby GVL:

️📐 Mohammad A. Ali shared a thread about Ruby on Rails performance:

💡 Around code (news, findings, books, and more - all about Ruby)

💡 Avo shared a list of issues marked as good first issues to their open-source repo:

💡 Robby Russell shared that he was looking for the migration guide from Webpacker for Rails apps. Some folks suggested the vite-rails docs.

️💡 Josef Strzibny shared how to fix the Ruby formatter in Zed editor

🤝 Zed shared the launch of Zed AI in collaboration with Anthropic AI.

❤️ Why Choose Ruby and Rails

❤️ ️Ross Kaffenberger shared the things available out of the box when using Ruby on Rails

❤️ David Heinemeier Hansson elaborated on the Provide Sharp Knives part of the Ruby on Rails doctrine.

❤️ Paweł Dąbrowski shared about using Ruby for 16 years:

❤️ Luan Estradioto shared 

❤️ Raman shared 

❤️ Ted Martin shared about Rails:

❤️  Brandur Leach shared about Explore Companies that use Ruby around the world

Tobi Lutke added

🧰 Gems, Libraries, Tools and Updates

🆕 New Gems and Repos

🆕 Andrew Kane announced a new version of ransformers-ruby: State-of-the-art transformers for Ruby

🆕 Adrian Marin announced a new gem of active_storage-blurhash - A blurhash integration for images stored in ActiveStorage

🆕 Greg Navis announced a new project pocus: Simple server provisioning via POSIX-shell

🆕 Javi Ramirez announced a new version of allgood: Quickly set up a health check page for your Rails app

🆕 Rails Plan announced a new gem mokkku: Mokkku is a simple library to provide fake data that is unique for your project. You can easily use LLM like GPT, Gemini, or Claude to fill the mock that based on your database schema.

🆕 Lucas Carlson announced a new version of kamalx: KamalX is a command-line tool that enhances the user experience of the Kamal by making it more user-friendly and easier to understand

🆕 Sebastian Buza published a new gem called Ruby2sass - a powerful and flexible Ruby DSL for generating SASS and CSS

🧰 Updates

🧰 Ruby On Rails announced a new version of Ruby on Rails - Rails 7.2.1 has been released!

Also Rails 7.1.4 has been released! 

🧰 Marco Roth announced a new PR for about Automate fetching Meetups from Meetup.com by marcoroth · Pull Request #720 · ruby-conferences/ruby-conferences.github.io

🧰 Stan Lo announced a small update docs.ruby-lang.org

🧰 Lekë Mula announced a new version of Release v0.4.0 · lekemula/solargraph-rspec · GitHub

🧰 Maciej Mensfeld announced a new version of Recurring Tasks - Karafka framework documentation

🧰 Koichi Ito announced a new version of Release RuboCop Rails 2.26.0 · rubocop/rubocop-rails · GitHub

🧰 Justin Collins announced a new version of Brakeman: Brakeman 6.2.1 Released

👀 Keep an eye on

👀 Sebastian Buza submitted a new feature request for Ruby about Rewrite Array#bsearch in Ruby

🤝 Related (but not Ruby-specific)

🤝 Alazycoder shared a code sample for upgrading from PostgreSQL 15 to PostgreSQL 16:

🤝 Mike Coutermarsh shared his thoughts on why focusing on “good code” is not the thing one should optimize for

🤝 David Heinemeier Hansson shared optimizing for resilience prematurely is not worth it.

🤝John Nunemaker shared an article about State of Independent SaaS Report: Benchmark Report and Data for the Bootstrapped SaaS Industry — MicroConf

🤝 Lucian Ghinda shared a detailed thread about designing tests. He talks about the guidelines one should consider while writing tests:

🤝 Jason Swett shared that code design skills and testing skills move in lockstep.

🤝 David Heinemeier Hansson shared about estimates:

🤝 Tuomas Artman shared about their strategy to handle bugs at Linear:

More content: 📚 🗞 🎧 🎥 ✍🏾

🗞 Newsletters

🗞 Ruby On Rails published a new edition of This Week in Rails about  ActionText store_if_blank, SQLite non-GVL-blocking busy handler, and more!

🗞 Ruby Weekly published a new edition about Thoughts about static typing in Ruby

🗞 Hotwire Weekly published a new edition about Week 34 - Hotwire with Django, Stimulus Social Share Button, and more!

🗞 Awesome Ruby Published a new edition about Issue 431 - Proposal to change private method to work on Constants in Ruby

🗞 RubyCentral published a new edition of their newsletter about August 2024 Newsletter

🎧 Podcasts

🎧 Code with Jason published a new podcast 228 - Test Driven Design with Alex Bunardzic

🎧 Indie Rails published a new podcast about IndieRails | Getting Performant with Nate Berkopec

🎧 Jeremy Smith published a new podcast about Building Liminal

🎧 RemoteRuby published a new podcast about Rails 7.2 – First Impressions

📽️ 🎥 Videos

🎥 RubyKaigi published the list of videos from the RubyKaigi 2024

🎥 Kasper Timm Hansen published a new video about Oaken and ActiveRecord::AssociatedObject

🎥 Arkency published a new video about Rails upgrades 101 — tips and tricks from Piotr Jurewicz

🎥 Yaroslav Shmarov published a new video about SupeRails | Social Share button (very important for PWA & Turbo Native

🎥 Jason Swett published a new video about Testing and OOP - Expression Parser (Part 1) and about Testing and OOP - Changing Expression Parser to use Tokens Instead of Scalars

🎥 Ruby Rogues published a new video about Rails, Assets, ActiveStorage and a Cloudfront CDN 

🎥 Dave Kimura published a new video about  Episode 471 - Dark Mode | Drifting Ruby

✍🏾 Articles

What’s new 🆕

✍️ Evil Martians published a new article about AI-ification of our TestProf toolkit!

✍️ John Nunemaker published a new article about Data Modeling Entitlements and Pricing for SaaS Applications

✍️ Apoorv Tiwari published a detailed guide on migrating from Sidekiq to SolidQueue

✍️ Garrett Dimon published an article about Organizing Rails Code with ActiveRecord Associated Objects and about Data Modeling Entitlements and Pricing for SaaS Applications

✍️ Camilo Payan published an article about How Standard Ruby updates its rules

✍️ Navaneeth D published an article about Rails 7.2 brings SQL queries count to template rendering logs

✍️ Igor Alexandrov published a new article about Redirect and return in Rails controllers

✍️ Haseeb Annadamban published a new article about How to Add PostgreSQL Index based on Query Plan as a Rails Developer

✍️ Stephen Margheim published a new article about Parsing and emitting database.yml

✍️ Allancoder published a new article about Getting started with Rspec for testing

✍️ RailsDesigner published a new article about When to Use call, erb_template, or html.erb in Rails ViewComponents?

✍️ Guillaume published a new article about building Magic Link Authentication for Devise natively in Rails 7.1

✍️ RubyCademy published an article on Twitter about Unlearn programming to learn Ruby

✍️ Maciej Mensfeld published an article about Under the Hood: Enhancing Karafka’s CPU and Memory Efficiency

✍️ Lucian Ghinda published an article about Proposal to change private method to work on Constants in Ruby

How-TOs 📝

📝 Paweł Dąbrowski published a new article about Mokkku, a modern replacement for FFaker

📝 Matt Brictson published an article about Building a better bin/dev script

📝 Kasper Timm Hansen published a new article about Keep your Rails app competitive with Oaken & ActiveRecord::AssociatedObject

📝 Rails Designer published an article about Better Inline Validation for Rails Forms (with ViewComponent or partials)

📝 Martin Streicher published an article about Squash Your Ruby and Rails Bugs Faster

Related

David Heinemeier Hansson published an article about Software estimates have never worked and never will

Geshan Manandhar published a new article about Docker for beginners: a guide to understanding the core concepts

All issues