Short Ruby News - Edition #57

Discover the world of Ruby in this comprehensive newsletter covering week 34 and part of week 35 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.

You can jump directly to a section:

šŸ‘‹ Before going into the newsletter content, please allow me to share some personal news and ask for your help šŸ‘‡

Who am I? I am Lucian Ghinda, the curator of this newsletter. I am a polymorphic Ruby developer with around 15 years of experience with Ruby on Rails, complemented by five years as a Product Owner and around five years as an Engineering Manager. Add to everything around ten years of teaching, mainly through technical workshops or mentoring.

Why hire me? I am a self-starter and know how to take over a complex codebase and pull in resources to get up to speed. I can take an idea to production. I juggle various concepts, from pitching ideas, customer interviews, design thinking, and prototyping to going into Rails source code to understand how things work. I donā€™t shy away from speaking with CEOs, customers, and end-users to clarify or better understand what should be built to solve real business problems.

People describe me as bringing optimism, energy, and passion to teams I join while focusing on high-quality code, performance, and stability.

You can read more about me on my LinkedIn page , some testimonials, or visit my technical blog at allaboutcoding.ghinda.com

šŸ‘ Our Community

šŸ‘ Aleksander Lopez šŸ‡ŗšŸ‡¦ shared how they feel when using Ruby on Rails:

šŸš€ New Products

šŸš€ Lucas Barret launched a new Podcast called GemRuby Show

šŸš€ Andrew Atkinson announced the release of the beta version for their new book High Performance Postgre Sql For Rails: Reliable, Scalable, Maintainable Database Applications:

šŸ“… Events

šŸ“… Helsinki Ruby announced a new meetup September meet-up at Kitty's Lounge on 6 September:

šŸ‘‰ All about Code and Ruby

You can read the discussion on Mastodon here or on Twitter here (nitter alternative)

šŸ‘‰Postmodern started discussing about what could be improved in Ruby world. This started a good discussion about YARD and documentation:

šŸ‘‰ David Heinemeier Hansson announced a series of new tools being presented at Rails World:

šŸ‘‰ Bradley Schaefer shared a tip about naming gem versions:

šŸ‘‰ Johan Halse shared an idea about including a script tag in turbo frame response:

šŸ‘‹ A short reminder: If you are looking for a colleague, I am looking for a great team to join šŸ‘‡

šŸ‘‰ Postmodern asked about validating an HTML form with dry-validation:

šŸ‘‰Joel Drapper announced a new gem and invited people interested to Join the Naming Things Discord Server!

šŸ‘‰ Stephann V. shared a code sample showing that Rails scope accepts classes

šŸ‘‰ Maciej Mensfeld shared they are working on a performance improvement for Karafka:

šŸ‘‰ Gavin Morrice shared a thread about the complexity added by Service Objects. Here is the first part of that thread, but please read it all:

šŸ‘‰ u/lsnouser asked about how to handle poor code bases:

It is an interesting discussion and I will include here only some parts of some responses:

šŸ‘‰ Rob Zolkos asked about how to relaod the src when reopening a details element:

Tony Messias shared a solution to Rob question:

šŸ‘‰ Ruby Cademy shared about Time#utc and how it modifies self:

If you want to understand more here is a screenshot from the documentation:

šŸ‘‰ Matt Swanson shared about using Enumerable#tally:

šŸ‘‰ Stanislav Katkov shared about experimenting with PostgreSQL-based cache by using activesupport-cache-database:

šŸ‘‰ Matt Swanson shared a code sample about

šŸ‘‰ Joe Masilotti shared the release of Turbo Native along with a series of links to get started with Turbo Native:

Here is the list of links:

šŸ‘‰ Michael Chaney shared about using select_all in Rails:

šŸ‘‰ Nate Berkopec shared about serializers:

Keygen replied with:

šŸ‘‰ Matt Swanson asked to make the code cleaner:

Here are some of the proposed solutions:

šŸ‘‰ Avi Flombaum shared a code sample for a module to add reset password and login tokens:

Dorian proposed an alternative password_resetable.rb 

šŸ‘‰ Harrison Broadbent shared a code sample about using Image Actions - GitHub Marketplace to automatically compress images:

šŸ‘‰ Ruby Cademy shared a code sample about using private_class_method:

šŸ‘‰ Monochrome shared  about monoruby performance:

šŸ§° Gems, Libraries, Tools and Updates

šŸ§° Avo announced a new release for both Avo 2 and Avo 3:

šŸ§° Konnor Rogers announced a new release for rhino-editor - Pull Request #99

Thank you for reading Short Ruby Newsletter. This post is public, so feel free to share it.

šŸ¤ Related (but not Ruby-specific)

šŸ¤ Jason Swett shared about duplication:

šŸ¤ Robby Russell asked us to write recommendations:

šŸ¤ Santiago shared a hot-take about estimates. Here is a part of what they posted:

šŸ¤ Jason Swett shared about technical debt and how we act about it:

More content: šŸ“š šŸ—ž šŸŽ§ šŸŽ„ āœšŸ¾

šŸ—ž Newsletters

šŸ—ž Harrison Broadbent published a new edition of The RailsNotes Newsletter ISSUE #9 (Deploying with Dokku, Hatchbox, Hetzner)

šŸ—ž Sara Jackson published a new edition about This Week In Open Source (September 1, 2023)

šŸ—ž Awesome Ruby Newsletter published a new edition about Awesome Ruby Newsletter Issue 380, Aug 31, 2023

šŸ—ž Greg Molnar published a new edition of Dependent Dropdowns With Hotwire Rails Tricks Issue 17

šŸ—ž RubyRadar published an article about Book.Publish All!

šŸŽ§ Podcasts

šŸŽ§ Lucas Barret published a new podcast GemShowRuby Igor Alexandrov, Wiselink Made by Headliner

šŸŽ§ Emmanuel Hayford published a new episode of The Rails Changelog 012: DHH joins the show to talk Rails 8, Delegated Types, Kamal and more! ā†’ ā€œIn this episode, I'm joined by DHH to discuss Kamal, The Rails Foundation, Rails 8, Delegated Types, On Writing Software Well and a whole lot more! This episode is packed and a must-listenā€

šŸŽ§ Remote Ruby published an episode about No Surprise | Now We Are A Burger Podcast ā†’ ā€œdive into the benefits of building UI components using frameworks like Tailwind CSS and Alpine.js, emphasizing the importance of well-organized and specialized components for better code management. The conversation also touches on the desire for more pre-built component libraries in the Rails ecosystem and the complexities of using various frontend frameworksā€

šŸŽ§ The Ruby on Rails Podcast published a new episode aboutEpisode 485: A Ticket Giveaway And Kamal / Kemalā†’ ā€œThe pair talk about doing hard things first, the renaming of MRSK to Kamal and then a random deep dive on our show's archivesā€

šŸŽ§ Rubber Duck Dev Show published a new episode about Programming & Child Development With Noah Gibbs ā†’ ā€œIn this episode of the Rubber Duck Dev Show, we discuss learning to program and child development with Noah Gibbsā€

šŸŽ§ Rooftop Ruby published a new episode about 23: Head Of Open Source At Ruby Central AndrĆ© Arko ā†’ ā€œRuby Central head of open source AndrĆ© Arko talks Bundler, Ruby Gems, supporting the community, and moreā€

šŸŽ§(related) Adam Wathan published a new podcast about Predictable mistakes of the developer-turned-founder ā†’ ā€œSo many developers (your podcast hosts included) make the same mistakes when trying to turn an idea into a business for the first time. In this episode, Ben and Adam talk through a bunch of these mistakes, why they matter, and what you should do to avoid themā€

šŸ“½ļø šŸŽ„ Videos

Screencasts

šŸŽ„ Dean De Hart published new videos about:

šŸŽ„ Drifting Ruby published a new video about Episode 416 - Forecasting Data | Drifting Ruby

šŸŽ„ GoRails launched a new series called SQL for Beginners

āœšŸ¾ Articles

Whatā€™s new šŸ†•

Aaron Patterson published an article about Ruby Outperforms C: Breaking The Catch 22 | Rails At Scale ā†’ ā€œIn this post Iā€™d like to present one data point in favor of maintaining a pure Ruby codebase, and then discuss some challenges and downsides of writing native extensions. Finally weā€™ll look at YJIT optimizations and why they donā€™t work as well with native code in the mixā€

Brooke Kuhlmann published an article about Hanami Views ā†’ ā€œAt the moment, the Hanami View gem is in a prerelease state but Iā€™ve been making heavy use of this gem so wanted to share notes in case this information is helpful to you or, at a minimum, prep you for the upcoming 2.1.0 releaseā€

Aaron Patterson published a new article about Fast Tokenizers with StringScanner  ā†’ ā€œToday weā€™re going to specifically look at the lexing part of parsing. Lexing is just breaking down an input string in to a series of tokens. Itā€™s the parserā€™s job to interpret those tokens. My favorite tool for tokenizing documents in Ruby is StringScanner. Today weā€™re going to look at a few tricks for speeding up StringScanner based lexers. Weā€™ll start with a very simple GraphQL lexer and apply a few tricks to speed it upā€

Akshay Khot published an article about Rails Database Migrations Cheatsheet ā†’ ā€œThe database schema evolves continuously. Rails migrations is a powerful and flexible way to update the schema without dropping and re-creating the database. However, all this power and flexibility can be overwhelming. Here's a handy cheatsheet for most common migration operationsā€

Alkesh Ghorpade published an article about Rails 7.1 Makes Increment Counter And Decrement Counter Accept A By Argument ā†’ ā€œRails 7.1 makes increment_counter and decrement_counter accept a 'by' argumentā€

Michał Łęcicki published an article about Easy Introduction To Connection Pool In Ruby ā†’ ā€œLet me introduce the concept of connection pooling and show you an example of easy, performant connections to RabbitMQā€

Andrei Kaleshka published an article about Cheaper And Risk Free Ruby On Rails App Redesign ā†’ ā€œThis article shares the approach we took to apply the new design in one of our projects. The changes we made increased the project revenue by 30%ā€

Szymon Fiedler published an article about How To Become 10x Developer With A Help Of Chat Gpt ā†’ ā€œthere are couple scenarios where tools backed with LLMs shine and can boost your productivityā€

Travis Turner published an interview with Vladimir Dementyev about It Deserved Its Own Tome: Layered Design And The Extended Rails Way ā†’ ā€œThe Evil Martiansā€™ Principal Backend Engineer goes deep on a number of topics: the contents of his book, the importance of maintainability, the Extended Rails Way, sharing his experience-driven methodology for building web apps with Rails, the future of Railsā€

Garrett Dimon published a new article about How We Added Free Plans to Flipper Cloud Using Flipper ā†’ ā€œWe used Flipperā€™s feature flags to iteratively build out everything we needed to offer a free Cloud account to anyone. And since we had been updating, releasing, and testing various elements to support free plans over the course of the last several months, we had a painless releaseā€

Jorge Manrubia published a new article about Minding the small stuff in pull request reviews ā†’ ā€œWe pay attention to the minutia in pull request reviews, and for good reasonsā€

Deep Dives šŸ”

Ben Sheldon published an article about Appropriately Using Rubyā€™s Thread.Handle Interrupt ā†’ ā€œWorking on GoodJob, I spend a lot of time thinking about multithreaded behavior in Ruby. One piece of Ruby functionality that I donā€™t see written about very often is Thread.handle_interruptā€

Lucas Barret published an article about Active Record Internals: You Are Still Not Ready ā†’ ā€œI try to understand better Rails ActiveRecord and how this is designed internally. In the last article, we discussed reflection but did not dive into it. Now we still have some black spells to exploreā€

Noah Gibbs published two new articles about We Turned Lobste.Rs Into A Rails Benchmark For Yjit ā†’ ā€œas YJIT improves we need more data from real world apps to help us understand what will speed up Ruby the most. We turned the Lobsters codebase into a nice new benchmarkā€ and about How We Used A Sq Lite Memory Db For Rails Benchmarking ā†’ ā€œwe want very little database time in our benchmarks, since weā€™re trying to optimise Ruby. One way to do that is to use SQLite rather than a separate database like MySQL or PostgresSQL. In fact, faster yet is an in-memory SQLite database. It doesnā€™t even write to diskā€

Sid Krishnan published an article about The Anatomy Of A Turbo Stream ā†’ ā€œWhy and how does a <turbo-stream> make the DOM change? What do Turbo Streams have to do with web sockets? What even is a <turbo-stream>?ā€

How-Tos šŸ“

Avi Flombaum published a new article about Build a Reset Password in Ruby on Rails ā†’ ā€œAs a continuation of Rails Authentication from Scratch, let's add a password reset feature to our applicationā€. You should also read Rails Authentication From Scratch and Create Rails Magic Login Link.

Mario Alberto ChƔvez CƔrdenas published an article about Full Text Search With Sq Lite And Rails

Harrison Broadbent published an article about Build Dynamic Navs With Current Page? (And Conditional Classes) ā†’ ā€œBy combining the current_page? helper with dynamic classes, we can build a nav that's styled differently based on the page we're onā€

Steve Polito published an article about Speed Up Your Rack Application With Http ā†’ ā€œIn this tutorial, weā€™ll learn how to leverage HTTP to improve the performance of a simple Rack application in an effort to demystify the intricacies of caching strategies and performance enhancement at the foundational levelā€

Matt Brictson published an article about Fixing Thorā€™s Cli Quirks ā†’ ā€œIā€™ve been wanting to build a CLI in Ruby, and Thor is the obvious library to use. But Thor has some weird behaviors that were driving me crazy. Hereā€™s what I found, and how I extended Thor to fix itā€

Felipe Vogel published an article about Roda + Turbo Streams = ā¤ļøā†’ ā€œPorting Wiki Stumble from Rails to Roda and Turbo Streamsā€

Julie Kent published an article about A Step By Step Guide To Building A Ruby Gem From Scratch Honeybadger Developer Blog ā†’ ā€œFrom concept to execution, join me on a step-by-step journey through the process of crafting your own functional Ruby gemā€

Niklas HƤusele published an article about Open Ai Transcription Api And Active Storage Analyzers ā†’ ā€œWeā€™re building an audiofile upload with ActiveStorage. After the file has been uploaded successfully, weā€™re going to use the transcription OpenAI endpoint to get the audiofileā€™s text contentā€

Lars Peters published an article about Generating barcode PDFs with Rails ā†’ ā€œFor a project, I was researching methods to generate individual PDFs with imprinted EAN barcodes. Some of the how-tos and blog articles I found were quite old, and it was not directly obvious if the solution still works and can be recommended in 2023ā€

Cj Avilla published a new article about How to setup react-rails with esbuild ā†’ ā€œThis was the time to add React into our Rails. That'll be easy, I thought. Just a couple hours of work, I thought. PSSSSSH. Naw, dog -- the gods don't want you putting React in your Rails, for some reason. Or, at least they don't want you to without their build toolsā€

Related šŸ”„

Cameron Day published an article about Writing Code You Don't Intend To Keep ā†’ ā€œCode doesn't always need to be permanent. In fact, there's plenty of times that it shouldn't beā€

Josef Strzibny published an article about Business Class 1.1 Released With Paddle Billing, An Improved Crud Generator, And New Pricing ā†’ ā€œThe Rails SaaS boilerplate Business Class goes 1.1. Hereā€™s whatā€™s newā€

Sid Krishnan  published an article about What To Do When The Docs Aren't Enough ā†’ ā€œA lot of the time, once you read the docs, you do end up finding enough guiding information to help overcome the snag and move on to the next increment of work. But every now and then, even if the docs give you some additional context around the problem, you find that you are still in the dark when it comes to actually solving itā€

Please consider becoming a paid subscriber to support this newsletter for just $1.8/week ($7.5/month) and you will receive an ad-free version. Your contribution aids growth and maintains the quality of ShortRuby for everybody:

If you consider upgrading and want more information, please read Why to subscribe to paid.

Reply

or to participate.