Short Ruby Newsletter

Share this post

Short Ruby News - Edition #52

newsletter.shortruby.com

Discover more from Short Ruby Newsletter

A Monday summary of the articles, discussions, and news from the Ruby community
Over 3,000 subscribers
Continue reading
Sign in

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.

Lucian Ghinda (from ShortRuby)
Jul 24, 2023
Share this post

Short Ruby News - Edition #52

newsletter.shortruby.com
Share

You can jump directly to a section:

๐Ÿ‘ Our Community

๐Ÿ‘‰ย All about Code and Ruby

๐Ÿงฐย Gems, Libraries, and Updates

๐Ÿคย Related (but not Ruby-specific)

More content: ๐Ÿ“š ๐Ÿ—ž ๐ŸŽง ๐ŸŽฅ โœ๐Ÿพ (articles, podcasts, videos, newsletters)


๐Ÿ’ธ For only $1.5 per week (just $6.5 a month), you can become 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!!

Support the newsletter for ~1.5$/week


๐Ÿ‘ 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

Source: @friendlyrb (read on nitter)

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

Source: Venue and Activity Sneak Peek

๐Ÿ‘ Chris Oliver reminded us that Rails Hackathon is 10 days away:

Source: @excid3 (read on nitter)

โ–ถ๏ธ if you enjoy this type of content and want to receive it weekly in your inbox you should subscribe:

๐Ÿ‘‰ All about Code and Ruby

๐Ÿ‘‰ Aristotle Coutinho shared a piece of code showing a sample of pattern matching:

Source: https://aristotelescoutinho.com.br/pattern-matching-i-love/

๐Ÿ‘‰ 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:

Source: @postmodern@ruby.social

๐Ÿ‘‰ Brooke Kuhlmann shared a code snippet showing an example of pattern matching:

Source: @bkuhlmann@ruby.social

๐Ÿ‘‰Brooke Kuhlmann shared another snipper in Ruby showing how to combine OOP and FP:

Source: @bkuhlmann@ruby.social

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

Short Ruby Newsletter is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

๐Ÿ‘‰ Cezar Halmagean asked about unit testing AR models:

Source: @chalmagean (read on nitter)

Here are some of the replies:

Source: @MorriceGavin (read on nitter)
Source: @robzolkos (read on nitter)
Source: @_swanson (read on nitter)
Source: @pinzonjulian (read on nitter)

๐Ÿ‘‰ Collin shared a code snippet about using attr to set reader and writer:

Source: @collin_jilbert (read on nitter)

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

Source: @hopsoft (read on nitter)

๐Ÿ‘‰ Adrien Poly shared about http cache coming to Turbo. See the un-merged PR here:

Source: @adrienpoly (read on nitter)

๐Ÿ‘‰ Michael Koper shared a snipped showing how to filter dodgy domains:

Source: @michaelkoper (read on nitter)

๐Ÿ‘‰ Harrison Broadbent shared a quick command to re-seed the database:

Source: @hrrsnbbnt (read on nitter)

๐Ÿ‘‰ Nate Berkopec shared a tip about how to configure dynos on Heroku:

Source: @nateberkopec (read on nitter)

๐Ÿ‘‰ 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

Source: @robzolkos (read on nitter)

๐Ÿ‘‰ Matt Swanson shared about defining a custom to_s method

Source: @_swanson (read on nitter)

๐Ÿ‘‰ Brad Gessler shared their idea to automatically fill in a new file with namespace:

Source: @bradgessler (read on nitter)

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)

Source: @julian_rubisch (read on nitter)

๐Ÿ‘‰ Brad Gessler shared a code snippet about their framework agnostic form builder called Superforms:

Source: @bradgessler (read on nitter)

๐Ÿ‘‰ Josef Strzibny shared a library they that is a new Ruby object mapper:

Source: @strzibnyj (read on nitter)

๐Ÿ‘‰ Nate Berkopec shared a tip about setting Puma worker count:

Source: @nateberkopec (read on nitter)

๐Ÿ‘‰ Olivier Buffon shared a way to organise their Gemfile:

Source: @olivierbuffon (read on nitter)

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)

Source: @olivierbuffon (read on nitter)

๐Ÿ‘‰ Matt Swanson shared a code snippet about adding an icon next to an item in a select HTML tag:

Source: @_swanson (read on nitter)

๐Ÿ‘‰ Adam shared a snippet showing how to configure IRB

Source: @Robodisco (read on nitter)
Source: @Robodisco (read on nitter)

๐Ÿ‘‰Ruby Cademy shared a code snippet showing an implementation of Data Synchronizer:

Source: @RubyCademy (read on nitter)

๐Ÿ‘‰ Nate Hopkins shared a code snippet about having a clean markup and use utility classes:

Source: @hopsoft (read on nitter)
Source: @hopsoft (read on nitter)

๐Ÿ‘‰Matt Swanson started a conversation about Hotwire future:

Source: @_swanson (read on nitter)

๐Ÿ‘‰ Robert Travis Pierce shared about syncing up Ruby versions in Gemfile:

Source: @roberttpierce (read on nitter)

๐Ÿ‘‰ hjd_thd asked on /r/ruby about other testing frameworks than RSpec and there are 27 replies there already:

Source: https://www.reddit.com/r/ruby/comments/154yk4z/what_is_your_experience_with_testing_frameworks

๐Ÿ‘‰ Inevitable-Swan-714 asked about using Refinements on /r/ruby and there are some examples there:

Source: https://www.reddit.com/r/ruby/comments/1553yca/has_anybody_actually_been_able_to_use_rubys/


๐Ÿงฐ Gems, Libraries, Tools and Updates

๐Ÿงฐ Stanislav (Stas) Katkov shared an update for POSH TUI:

Source: @5katkov (read on nitter)

๐Ÿงฐ Kay Rhodes announced a new gem mongodb_meilisearch: Easily integrate Meilisearch into your MongoDB models

Source: https://github.com/masukomi/mongodb_meilisearch

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

Source: https://github.com/neovim/neovim-ruby

๐Ÿงฐ Igor Alexandrov shared that their PR is merged to MRSK โ†’ Include service name to lock details by igor-alexandrov ยท Pull Request #387

Source: https://github.com/mrsked/mrsk/pull/387

๐Ÿงฐ Samuel Williams shared the Release v1.14.0 ยท rack/rack-cache

Source: https://github.com/rack/rack-cache/releases/tag/v1.14.0

๐Ÿงฐ 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

Source: @avo_hq (read on nitter)

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

Source: @avo_hq (read on nitter)

๐ŸงฐAvi Flombaum announced the release of a stable version of shadcn/ui on Rails

Source: @aviflombaum (read on nitter)

๐ŸงฐLรกzaro Nixon shared a new release of Authentication Zero 3.0.0.alpha1

Source: @lazaronixon (read on nitter)

๐ŸงฐBenjaminwood shared a PR merged to Rails 7.1 about Active Record commit transaction on `return`, `break` and `throw` by casperisfine ยท Pull Request #48600

Source: @benjaminwood (read on nitter)

๐Ÿงฐ Adrien Poly shared a PR that is not yet merged for Turbo about Add HTTP cache store by afcapel ยท Pull Request #949 ยท hotwired/turbo

Source: https://github.com/hotwired/turbo/pull/949

๐Ÿงฐ Janko Marohniฤ‡ announced a PR about Allow WebAuthn login to count for two factors by janko ยท Pull Request #354 ยท jeremyevans/rodauth

Source: @jankomarohnic (read on nitter)

๐Ÿงฐ Evgeniy Demin announced a new release of djezzzl/database_consistency: The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models.

Source: https://github.com/djezzzl/database_consistency/pull/211

๐Ÿงฐ Mike Mc Quaid announced a new version of Homebrew 4.1.0

Source: @MikeMcQuaid (read on nitter)

๐Ÿงฐ Carl Mercier shared their Rails repo ultimate-turbo-modal: The ultimate Turbo / Stimulus / Hotwire modal window for Rails

Source: https://github.com/cmer/ultimate-turbo-modal

๐Ÿงฐ Ivan Marynych announced a new gem fake_picture

Source: https://github.com/the-rubies-way/fake_picture

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

Share

๐Ÿค Related (but not Ruby-specific)

๐Ÿค Avi Flombaum shared a piece of HTML code and how they style them:

Source: @aviflombaum (read on nitter)

๐Ÿค Brandon Weaver asked about how Staff+ Engineers arte spending their time between strategic and tactical work:

Source: @baweaver@ruby.social

Yulian Kuncheff is doing a good summary of the replies:

Source: @yulian@ruby.social

๐ŸคDT shared their system prompt for GPT-4 used when coding:

Source: @DeeperThrill (read on nitter)

๐ŸคKevin Powell shared a code sample showing differences in native nesting in CSS vs Sass/Less:

Source: @KevinJPowell (read on nitter)

๐ŸคJack Forge shared about how it feels like getting older in Tech:

Source: @TheJackForge (read on nitter)

๐ŸคCatalin Pit shared about impact of AI on developers jobs:

Source: @catalinmpit (read on nitter)

๐Ÿค Jason Swett shared an advice about networking while doing job search:

Source: @JasonSwett (read on nitter)

๐Ÿค More content: ๐Ÿ“š ๐Ÿ—ž ๐ŸŽง ๐ŸŽฅ โœ๐Ÿพ

๐Ÿ“š Noel Rappin announced that Programming Ruby 3.2 (5th Edition) is production ready:

Source: @noelrap@ruby.social

๐Ÿ“š Vladimir Dementyev announced that their book Layered Design for Ruby on Rails Applications will be ready in August:

Source: @palkan_tula (read on nitter)

๐Ÿ—ž 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

๐ŸŽง The Rails Changelog published a new podcast about 009: A class-level testing helper, config.autoload_lib, AppSignal is our new sponsor! | The Rails Changelog | Episode 9

๐Ÿ“ฝ๏ธ ๐ŸŽฅ Videos

Screencasts

๐ŸŽฅ Flavio Wuensche published a new video about Fixing N+1 queries on dashboards#index

๐ŸŽฅ Ruby Cademy published a new video about Builders + Object-To-Proc = Happiness!

๐ŸŽฅ Drifting Ruby published a new episode about Episode 411 - Fancy Emails with MJML | Drifting Ruby

๐ŸŽฅ Dean De Hartย published new videos about:

  • User Management Dashboard for Admins in Rails 7

  • Realtime r/place Clone Speedrun in Ruby on Rails 7

  • Craft an Editable Sidebar Rails 7 & Tailwind Guide

  • Timed Delete Your Data with Turbo Jobs (Snapchat) | Ruby on Rails 7

  • Asset Ram Gem for Performance in Ruby on Rails 7

โœ๐Ÿพ 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:

Support the newsletter for ~1.5$/week

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

Share this post

Short Ruby News - Edition #52

newsletter.shortruby.com
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

ยฉ 2023 Lucian Ghinda
Privacy โˆ™ Terms โˆ™ Collection notice
Start WritingGet the app
Substack is the home for great writing