👉 Short Ruby News - Edition #54

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

You can jump directly to a section:

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

[Sponsor⬇]

Find, hire, and manage world-class remote developers in US time zones, pre-vetted for technical and soft skills.Visit Revelo.com to find out more.

👐 Our Community

👐 Friendly.Rb announced that tickets are sold-out:

There are still a few spots available if you want to sponsor this conference:

👐 Avo announced the date for the open beta:

👐 Rubyconftw announced CFP are open for RubyConf Taiwan 2023

👐 Chris Oliver announced in a thread (read it on nitter) winners for RailsHackathon:

🆕 Projects

👉 All about Code and Ruby

👉Plentiful Panda shared two recommendation for a Vim extension zbirenbaum/copilot.lua and zbirenbaum/copilot-cmp:

[Promo Content⬇]

📣 Revelo.com has you covered: Whether you want to build a team from scratch, fill a skill or capability gap, or augment your team.

👉 Vidar Hokstad shared a screenshot of their editor build with Ruby using ruby-x11:

👉Stephann V. shared that destroy_all and delete_all can have different behaviors when they are called on a model or on a collection (see ActiveRecord::Associations::CollectionProxy)

👉Jason Garber shared lessons learned about headless Chrome and Docker:

👉 Paweł świątkowski asked about recommendations of gems with YARD docs:

Here are some recommedations:

👉 Brad Gessler shared their config to make Phlex.fun TailwindCSS autocomplete work in Sublime Text 4 (see the config gist here):

👉 Avi Flombaum shared about the frontend problem in Rails:

👉 Brad Gessler shared they migrated fly.io documentation to Sitepress.cc

[job ad from this edition partner Revelo.com]🚀 [Remote][Latin America] Get a full-time, long-term remote job and a dollar salary in amazing US tech companies.Apply at careers.revelo.com

👉 Jeremy Smith shared a thread about the Ruby Comparable mixin:

You should read the entire thread (read on nitter) where Jeremy describes the test, what failed, and how they found the cause.

👉 It's A&L shared a code sample showing a Rails route globbing example:

👉 Marco Roth shared how a memoization can speed up a lot Ruby code:

👉 Ruby Cademy shared a code sample about falsehoods Rubyists believe:

👉 Phil Smy shared a tip about optimising DB queries:

👉 John Nunemaker shared a tip about using feature flags:

👉 Robert Pankowecki shared a code sample about monkey patching a library and adding a detection for when to re-verify the patch:

👉 Avi Flombaum shared a code sample about:

👉 Matt Swanson shared about using code comments:

There is a good conversation about adding code comments in Ruby. Here are just a few of them:

👉 Avi Flombaum shared a Rails code sample about how to display breakpoint when on Tailwind:

👉 Kevin Newton shared a code sample that uses numbered params :)

👉 Takashi Kokubun shared a quiz (If you plan to think about this don’t click yet to open the quiz on Twitter or Nitter as you will see the result there):

👉 Radoslav Stankov shared a code sample showing how to use `class` as keyword param:

👉 Rob Zolkos shared a tip about making systems test instead of controller tests:

He also shared a Rails repo for anyone that wants to see how this works at GitHub - robzolkos/testperformance

👉 Marco Roth asked about naming a variable that holds a module object:

There are some interesting proposals there. I only picked a couple of them:

🧰 Gems, Libraries, Tools and Updates

🧰 Avi Flombaum announced they started to port hyperui to rails-components.com:

🧰 RubyGems announced the release of version 3.4.18 of RubyGems:

🧰 Piotr Murach announced the release of slideck - Present Markdown-powered slide decks in the terminal

🧰 Nate Hopkins announced the release of version 0.0.12 for TurboBoost Commands

🧰 Carter Bryden shared a code repo that shows how to implement custom domains for users in Rails: rails-custom-domains-example: An example repo for how to implement custom domains as a feature in a Ruby on Rails app

🧰 Andrea Fomera announced a new version 0.7.0 for RicherText.js

More library updates:

🧰 Hexa PDF - Versatile PDF creation and manipulation library - announced the release of version 0.33.0

🧰 Maciej Mensfeld announced a new release of karafka - version 2.1.9

🤝 Related (but not Ruby-specific)

🤝 Adrian Oprea shared tips for improving LCP:

🤝 Jason Swett shared about planning for change:

🤝 Chris Wanstrath shared about hiring based on Github activity graph:

More content: 📚 🗞 🎧 🎥 ✍🏾

🗞 Newsletters

🗞 Harrison Broadbent published a new edition of RailsNotes Newsletter Issue 5

🗞 Ruby Weekly published a new edition about Using Ruby in Jupyter Notebook

🗞️ Allison Pike published a new edition of Once a Maintainer with Julik Tarkhanov

🎧 Podcasts

🎧 Rooftop Ruby Podcast published a new episode As Not Miserable as You Can Be with Dave Copeland“Dave Copeland joins to discuss writing, background jobs, service objects, and more”

🎧 Rubber Duck Dev Show published a new episode about Evaluating Tech Tools with Kora Weaver → “In this episode of the Rubber Duck Dev Show, we discuss some ways you can evaluate your tech stack with Kota Weaver.”

🎧 Drew Bragg published a new episode of Code and the Coding Coders Who Code It about Episode 26 - Thomas Carr “This episode I'm joined by Thomas Carr. Thomas is a Consultant & Software Developer for Emerging Technologies at CGI Federal. Which is a fancy way of saying he gets to play around with all the new tech out there and see what might have real world application”

🎧 The Rails Changelog published a new podcast about 010: Improved Active Storage docs, a new has_secure_token callback with Dave Kimura “Dave Kimura of Drifting Ruby fame joins me to discuss the importance of Ruby on Rails documents. We talk specifically about improved documentation around Active Storage and Active Record encryption, then dive into the new callback for when has_secure_token is triggered”

🎧 Ruby Rogues published a new episode about Can you do AI /Machine Learning in Ruby?“Landon Gray is a Compassionate Consultant, an AI/ML Enthusiast, and a conference speaker. He joins the show to further talk about his conference topic, "AI in Ruby". He begins by explaining how he landed with the idea of using AI or ML in the native Ruby. Additionally, they dive into other Ruby projects that used AI or ML”

🎧 The Ruby on Rails Podcast published a new episode about Episode 481: Advice on Sunsetting a Rails Application with Robby Russell“Robby Russell, CEO of Planet Argon, joins the show to guide Brittany on the steps to take to decommission a Ruby on Rails application. The pair also touch on the idea of how small dev teams would benefit from periodically bringing in "guests" to their codebase”

📽️ 🎥 Videos

Screencasts

🎥 Dean De Hart published new videos about:

🎥 Drifting Ruby published a new video about Episode 412 - Intervals and Timeouts | Drifting Ruby

🎥 Tim Morgan published a new video about COMPILER FUN, DAY 12: LLVM JIT

✍🏾 Articles

What’s new

Harrison Broadbent published an article about Skipping the console with Rails Runner “if you're getting RSI from typing rails console all day, I've got something to show you — rails runner. The rails runner command is a handy Rails command which lets us run commands inside our Rails console, directly from our terminal”

Avi Flombaum published a series of articles about rails-component.com They are a great exploration of what Avi is trying to solve: Rails-Components.com: What is it?,  Why Ruby on Rails Needs Components, Rails Components: More Installer Over Library.

James Adam published an article about Turbo Stream and personalised content“Ever wanted to render different content for the current user vs other users in partials being handled by Turbo? I frequently do, but I was surprised to find basically nothing online about how to do it, nothing in the official documentation and no blog posts describing it. Here’s one approach that works pretty well.”

Jorge Manrubia published a new article about Globals, callbacks and other sacrileges “Maximalist positions are a thing in our industry. Take a technique, outline its drawbacks, extrapolate you can’t use it under any circumstance, and ban it forever. We are lucky that Rails embraces exactly the opposite mindset as one of its pillars”

Jenny Shen published an article about Level up your RubyGems Account Security with Security Devices“We are excited to announce that WebAuthn is fully integrated and is recognized to be the preferred choice for multi-factor authentication (MFA). When users register a security device, they will now be provided with recovery codes and be able to configure their multi-factor authentication level without needing to enable time-based one time password (OTP) MFA”

Arjit Jaiswal published an article about I like my code DAMP“The problem of over-abstraction is well-documented. But there’s another problem too— it enforces our human intuition that redundancy == verbosity == waste. And unfortunately, it leaks into both our subconscious and our linters. So, I propose a new way of thinking: DAMP”

Alkesh Ghorpade published an article about Rails 7.1 enhances PostgreSQL enum functionality“Rails 7.1 adds enum rename, add value and rename value methods to extend its support for PostgreSQL enum types”

I published an article about Projects ideas for learning Ruby or any Ruby web framework“Projects to tackle as you learn a new programming language”

Amanda Perino published an article about Introducing the team behind the Rails World website “We would like to introduce you to the team that brought the Rails World website to life. Back in April we put out a call for junior developers to create the Rails World website under the mentorship of a senior developer”

Lucas Barret published a new article about Playing with Redis and Rails “I will share my thoughts and idea, playing along with Redis and Ruby, Like I said less structured and maybe comments or deep dive, but I had a lot of fun writing and playing with this”

Deep Dives

Kevin Newton published a new article about ActiveRecord::UnionRelation“I wrote a gem back in 2020 called active_record-union_relation, and I’m finally writing a blog post describing it. This is a very small gem that provides the ability to define Active Record relations from UNION queries”

Akshay Khot published an article about Content Security Policy (CSP): What Every Web Developer Must Know “This is a comprehensive guide to Content Security Policy (CSP). If you build websites for a living, CSP is an important concept to know, understand, and implement to protect your users from Cross-Site Scripting (XSS) Injection attacks. This post covers (almost) everything you need to know about CSP”

Aestimo Kirina published an article about Advanced Usages of Devise for Rails“In this part, we'll explore more advanced usages of Devise, specifically the use of OmniAuth, API authentication, and Authtrail”

Jared Norman published a new article about Service Objects “I've compiled everything you need to know about when to use service objects and documented all the common variations of the pattern so that you can choose the right conventions for your project”. He followed up with What if service objects were just Procs?

How-Tos

Harrison Broadbent published an article about Split your database seeds.rb by Rails environment “The seeds.rb file makes it easy to pre-populate your database with data for development or production. Unfortunately though, since each Ruby on Rails app only has a single seeds.rb file, it can quickly get cluttered. Plus, there's bound to be data you want to seed in production, but not development (or vice-versa)”

Nithin Bekal published an article about Ruby and Jupyter Notebooks “Does Ruby have something similar to Jupyter notebooks? Turns out that you can just use Jupyter notebooks with Ruby if you setup the iruby kernel”

Matt Brictson published an article about Automate Rails deployments with GitHub Actions“I deploy all my Rails apps using Tomo, a Ruby command-line tool I developed. Like MRSK, Capistrano, Mina and other similar gems, Tomo orchestrates deployments by executing scripts over SSH”

Alkesh Ghorpade published an article about Normalize Data with Rails 7.1“Rails 7.1 adds normalizes method to ActiveRecord::Base, which can be used to declare normalization for attribute values. The method can be used to sanitize user inputs, enforce consistent formatting and clean up data from external sources”

BiggerPockets published a new article about Finding unused Rails view partials with DataDog and Github Actions“As a Rails application matures, views gets moved around and sometimes rewritten. This opens up the possibility of dead view partials lying around: partials that are no longer rendered by any views. These unused view partials clutter up our workspace and impose a small maintenance burden. At BiggerPockets, we use DataDog and Github Actions to identify these unused partials so that they can be manually cleaned up”

Brooke Kuhlmann published a new article about Ruby Object InspectionThis article will take a closer look at Ruby object inspection

Mike Coutermarsh published an article about How to make a Fly API call from Ruby“Fly has a graphql API available. You can find ways to use it by looking through their CLI's source code. I recently wanted to automate a Fly API call from a ruby script. And I was not in an environment where I wanted to install the fly CLI”

Povilas Jurčys published an article about Many ways to write RSpec custom matchers“When it comes to creating custom matchers in RSpec, developers have two powerful approaches at their disposal. Each method offers distinct advantages, giving you the flexibility to tailor your matchers to your specific testing needs. In this article, we will delve into both of these approaches to equip you with the knowledge to write expressive and adaptable tests”

Mika Henriksson published a new article about Client side rate limiter “Long-running jobs are bad, like terrible, and should be avoided at almost all costs. Splitting the work into multiple background jobs using batches is a great idea. Now as the work ran in parallel, it finished fast! Unfortunately, it bombarded the external API with too many concurrent requests, and their API returned many rate limit errors”

Max Normand published a new article about The Builder Design Pattern in Ruby “The builder pattern, is part of the «creational design patterns». In summary it simplifies the processes of creating complex objects. We create a builder class that should have everything we need to help ease the complexities around creating our objects”

Kaka Ruto published a new article about Uploading Files to CloudFlare R2 Using Rails ActiveStorage “R2 is a new object storage system by Cloudflare. It is comparable and compatible with Amazon S3, except much simpler and cheaper, and with a very generous free plan. You can read more about it here. Let us see how to set it up with Rails so we can upload files for this article”

Julian Rubisch published a new article about Understanding Rails Apps Through Powerful Visualizations → “When it comes to reviewing a Rails app, two essential factors stand out: discoverability and good visualization of the code structure. Being able to comprehend the core elements and potential threats of a Rails app is crucial for developers and stakeholders alike”

William Kennedy published a new article about Tidy Up Your Views with Request Variants → “When I gave my recent Turbo Native talk for Ruby Ireland, one of the questions that came up repeatedly was about duplicating views for both native and Rails. I got many questions asking if I have “if-else” logic in my views to accommodate mobile”

Brandon Keepers published an article about Switch ActiveJob backends without disruption “Earlier this year, we helped a customer migrate their Rails application to a new ActiveJob backend. As with most applications, their background jobs performed critical workloads, like emailing users, communicating with external services, and keeping things tidy. Even a momentary blip in background job processing can quickly become a user-facing issue”

Related

Birgitta Böckeler published a new article about Exploring Generative AI “Generative AI and particularly LLMs (Large Language Models) have exploded into the public consciousness. Like many software developers I am intrigued by the possibilities, but unsure what exactly it will mean for our profession in the long run. I'll be posting various memos here to describe what my colleagues and I are learning and thinking”

Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.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.