👐 Short Ruby News - Edition #52

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

You can jump directly to a section:

💸 For only $1.5 per week (just $6.5 a month), you can upgrade to a paid subscriber and contribute to the success of the flourishing Ruby community we all adore while receiving an ad-free version of the newsletter!!

👐 Our Community

👐 Friendly announced there are only 30 tickets available. If you are planning to go, now is a good time to buy your ticket

If you are curious about the venue and the activities we have prepared, Adrian did a short video walkthrough about them:

👐 Chris Oliver reminded us that Rails Hackathon is 10 days away:

👉 All about Code and Ruby

👉 Aristotle Coutinho shared a piece of code showing a sample of pattern matching:

👉 Postmodern shared a Ruby code snippet that allows an object to handle missing constants in the same way as a specific module, without adding extra information to the debugging backtrace:

👉 Brooke Kuhlmann shared a code snippet showing an example of pattern matching:

👉Brooke Kuhlmann shared another snipper in Ruby showing how to combine OOP and FP:

If you are curious about use-cases for Monads in Ruby, I like this long article about Error handling with Monads in Ruby

▶️ if you enjoy this type of content and want to receive it weekly in your inbox you should subscribe:

👉 Cezar Halmagean asked about unit testing AR models:

Here are some of the replies:

👉 Collin shared a code snippet about using attr to set reader and writer:

👉 Nate Hopkins describes Rails as a finely-tuned collection of libraries and highlights the importance of understanding how they interact for effective use:

👉 Adrien Poly shared about http cache coming to Turbo. See the un-merged PR here:

👉 Michael Koper shared a snipped showing how to filter dodgy domains:

👉 Harrison Broadbent shared a quick command to re-seed the database:

👉 Nate Berkopec shared a tip about how to configure dynos on Heroku:

👉 Rob Zolkos asked about making MRSK as a service. There seem to be multiple people thinking about similar ideas. Read all the replies on twitter or on nitter

👉 Matt Swanson shared about defining a custom to_s method

👉 Brad Gessler shared their idea to automatically fill in a new file with namespace:

Xavier jumped in and replied (read on nitter) that he is open to discuss about it, then Brad submitted an issue describing what they want and then this was implemented and it is already in main.

👉 Julian Rubisch shared about using ActionController::ConditionalGet (read the article Julian recommended here)

👉 Brad Gessler shared a code snippet about their framework agnostic form builder called Superforms:

👉 Josef Strzibny shared a library they that is a new Ruby object mapper:

👉 Nate Berkopec shared a tip about setting Puma worker count:

👉 Olivier Buffon shared a way to organise their Gemfile:

I am including here just a part of the Gemfile image they shared to give you a glimpse of the way they organise it. For more perspectives about this you should see the replies to Rob Zolkos quote (read it on nitter)

👉 Matt Swanson shared a code snippet about adding an icon next to an item in a select HTML tag:

👉 Adam shared a snippet showing how to configure IRB

👉Ruby Cademy shared a code snippet showing an implementation of Data Synchronizer:

👉 Nate Hopkins shared a code snippet about having a clean markup and use utility classes:

👉Matt Swanson started a conversation about Hotwire future:

👉 Robert Travis Pierce shared about synching up Ruby version in Gemfile:

👉 hjd_thd asked on /r/ruby about other testing frameworks than RSpec and there are 27 replies there already:

👉 Inevitable-Swan-714 asked about using Refinements on /r/ruby and there are some examples there:

🧰 Gems, Libraries, Tools and Updates

🧰 Stanislav (Stas) Katkov shared an update for POSH TUI:

🧰 Nate Hopkins shared the discovery of a repo that allows writing plugins for NeoVim with Ruby neovim/neovim-ruby: Ruby support for Neovim

🧰 Avo announced a new release version 2.37.0. Read the full release notes here or watch the video where Adrian goes through all changes here 

He also announced a date for the Avo 3 public beta:

🧰Avi Flombaum announced the release of a stable version of shadcn/ui on Rails 

🧰Lázaro Nixon shared a new release of Authentication Zero 3.0.0.alpha1

🧰 Adrien Poly shared a PR that is not yet merged for Turbo about Add HTTP cache store by afcapel · Pull Request #949 · hotwired/turbo

🧰 Mike Mc Quaid announced a new version of Homebrew 4.1.0

🧰 Ivan Marynych announced a new gem fake_picture

🤝 Related (but not Ruby-specific)

🤝 Avi Flombaum shared a piece of HTML code and how they style them:

🤝 Brandon Weaver asked about how Staff+ Engineers arte spending their time between strategic and tactical work:

Yulian Kuncheff is doing a good summary of the replies:

🤝DT shared their system prompt for GPT-4 used when coding:

🤝Kevin Powell shared a code sample showing differences in native nesting in CSS vs Sass/Less:

🤝Jack Forge shared about how it feels like getting older in Tech:

🤝Catalin Pit shared about impact of AI on developers jobs:

🤝 Jason Swett shared an advice about networking while doing job search:

🤝 More content: 📚 🗞 🎧 🎥 ✍🏾

📚 Noel Rappin announced that Programming Ruby 3.2 (5th Edition) is production ready:

📚 Vladimir Dementyev announced that their book Layered Design for Ruby on Rails Applications will be ready in August:

🗞 Newsletters

🗞 Ruby Weekly published a new edition about Fara-way nicer docs

🗞 Sara Jackson published a new edition of This Week in Open Source (July 21, 2023) - “We saw contributions to Administrate, Shoulda Matchers, Shoulda Context, Appraisal, and thoughtbot’s Guides.”

🗞Emmanuel Hayford published a new edition about A much needed Active Storage documentation with a new option to tri...

🗞️ Ruby Libhunt published a new edition of Issue 374 - Making Sorbet compatible with Ruby 3.2

🎧 Podcasts

🎧 Jason Swett published a new podcast about Evil Martians CEO Irina Nazarova at the Code with Jason Meetup

🎧 Rubber Duck Dev Show published a new episode about Scarpe Diem With Nick Schwaderer

🎧 Drew Bragg published a new episode of Code and the Coding Coders who Code It about Episode 25 - Vini Stock

🎧 The Ruby on Rails Podcast published a new episode about Create What You Want to Exist: Brighton Ruby (Brittany + Nick + Andy)

🎧 The Bike Shed published a new episode about Is REST the Best? APIs and Domain Modeling

📽️ 🎥 Videos

Screencasts

🎥 Ruby Cademy published a new video about Builders + Object-To-Proc = Happiness!

🎥 Dean De Hart published new videos about:

✍🏾 Articles

What’s new

Igor Alexandrov and Sergei Masiutin published an article about Rodauth, A++ Authentication for Ruby and Rails “ I will explore the intricate nature of authentication and explain why Rodauth provides an effective solution. By delving deeper into the complexities of authentication processes, we can gain a better understanding of how Rodauth successfully tackles these challenges”

Kevin Newton published an article about Ruby operators “Ruby’s grammar has a ton of operators. Overtimes, they can mean more than one thing, depending on their context. This blog post enumerates each operator and its meaning”

I published an article about Where to promote an article about Ruby“Discover places to showcase and boost your Ruby-related technical content”

Alkesh Ghorpade published an article about Rails 7.1 adds routes --unused option to detect extraneous routes → “Rails 7.1 adds --unused option to rake routes command to identify extraneous routes. You must execute the routes —unused command on your terminal to get your application's list of unused routes”

Mayank Agnihotri published an article about Rails 7.1 now allows matching exception messages to assert_raises assertion → “While writing minitests or rspec tests in Rails many of us might have or might want to see if the error and it’s message is reported by the application or if some custom error and its message match with the one we added ourselves”

Deep Dives

Mohit Sindhwani added a new article to their series about reversing native gems about Ruby Learning by Reversing: Native Gems, Part 4 → “The first series of Learning by Reversing examines a Ruby native gem to understand how it works. Part 4 digs into the development Makefile and how it supports different activities during development”

Akshay Khot published an article about A Brief Introduction to Rails Initializers: Why, What, and How → it says briefly in the title, but it is a pretty good coverage of how initializers work: “At first glance, Rails initializers seem complex, but they're solving a simple, but important problem: run some code after framework and gems are loaded, to initialize the application. This post covers the basics of initializers, including what they are, how they work, and how Rails implements them”

Rafael Montas published an article about Ruby's method-lookup path and Object Individuation “Objects seek their methods in both classes and superclasses, all the way up the inheritance tree; let's see how this method-lookup process works when modules are also involved”

Paweł Dąbrowski published an article about Ruby Struct Explained“Ruby Struct is a built-in class that provides useful functionalities and shortcuts. You can use it for both logic and tests. I will quickly go through its features, compare with other similar stuff, and show some less-known but still useful information about it”

Ismael Celis shared an old article about Railway-style composable pipelines in Ruby “An exploration of patterns for building composable data pipelines in Ruby, from the basics to the possibly YAGNI”

How-Tos

Donn Felker published a new article about HowTo: Setup Tailwind CSS 3 with Middleman → “This post explains how I created the Tailwind CSS 3 + Middleman integration that is available on GitHub”

Domhnall Murphy published an article about Common Distance Metrics Implemented in Ruby → They show how to implement in Ruby the following distance metrics: Euclidean Distance, Manhattan Distance, Chebyshev Distance, Minkowski Distance, Hamming Distance, Cosine Distance, and Jaccard Distance.

Thilo Rusche published an article about Service Objects on Rails → “at SportsKey we have been using service objects to isolate our business logic for quite some time. I’d like to share how we do it, and what I consider the benefits of this approach”

Benito Serna published an article about Fix n+1 queries by caching computed values → “N+1 queries are not always a problem, but I have seen that most of the n+1 queries that are really a problem are when we need to fetch data to compute something”

Jeff Morhous published an article about How to Delegate Methods in Ruby “In this article, we'll dive into three ways to achieve delegation in Ruby: using explicit delegation, the Forwardable module, and ActiveSupport::Delegate (for Rails)”

Matt Brictson published an article about Don’t reinvent the wheel with Rails exception handling → “With the built-in rescue_responses setting, you can map exceptions to error pages in a simple, declarative way. It automatically renders JSON, too”

Steve Polito published an article about Building Value Objects in Rails with composed_of → “In this tutorial, we’ll explore how we can improve the interface of an Active Record Model by extracting existing logic into value objects by using Rails’ composed_of macro”

Josef Strzibny published an article about Running SASS and Tailwind side by side in Rails“What if you want to incrementally switch to Bulma? Or build a marketing site with Tailwind while keep using SASS for your main application? It’s not as hard as you think”

[beginner friendly] Rafael Peña Azar published a new article about Crafting a Ruby Gem: Empowering Developers One Gem at a Time → “n this article, we'll embark on an exciting journey, guiding you through the process of creating and publishing a Ruby gem that addresses a real-world challenge. Together, we'll explore the nuances and practical tips to make your gem shine, impacting the community positively”

Julian Rubisch published a new article about Preview Component - RailsReviews → “In this post, we will look at the reviewer experience in RailsReviews when commenting on a sandbox offense. Essentially this entails a markdown editor a la GitHub, which provides a preview as you type. Notably, we will make sure that only authorized users can edit such a comment, but the customer, for example can not”

Related

Max Chernyak published an article about 4 Reasons to Leave a Code Comment

William Kennedy published a new article about Turbo Native - Native Authentication Part 3 - Android Client → “In this series’s previous two blog posts, we covered setting up a Rails app and an iOS app. In this article, we’re going to do the same for Android”

Kevin Liebholz published a new article about Event Summary “AI Hub Frankfurt - The EU AI Act 2023-07-18” → “Today, I want to share my experience attending “The EU AI Act” event organized by AI Hub Frankfurt on July 18th, 2023. It was an insightful gathering that shed light on the upcoming regulatory landscape surrounding AI and its impact on businesses. In this post, I will provide you with a summary of the keynotes and discussions from the event”

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