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:
๐ 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!!
๐ 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:
โถ๏ธ 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:
๐ 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
๐ 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 syncing up Ruby versions 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:
๐งฐ Kay Rhodes announced a new gem mongodb_meilisearch: Easily integrate Meilisearch into your MongoDB models
๐งฐ Nate Hopkins shared the discovery of a repo that allows writing plugins for NeoVim with Ruby neovim/neovim-ruby: Ruby support for Neovim
๐งฐ Igor Alexandrov shared that their PR is merged to MRSK โ Include service name to lock details by igor-alexandrov ยท Pull Request #387
๐งฐ Samuel Williams shared the Release v1.14.0 ยท rack/rack-cache
๐งฐ 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
๐งฐBenjaminwood shared a PR merged to Rails 7.1 about Active Record commit transaction on `return`, `break` and `throw` by casperisfine ยท Pull Request #48600
๐งฐ Adrien Poly shared a PR that is not yet merged for Turbo about Add HTTP cache store by afcapel ยท Pull Request #949 ยท hotwired/turbo
๐งฐ Janko Marohniฤ announced a PR about Allow WebAuthn login to count for two factors by janko ยท Pull Request #354 ยท jeremyevans/rodauth
๐งฐ 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.
๐งฐ Mike Mc Quaid announced a new version of Homebrew 4.1.0
๐งฐ Carl Mercier shared their Rails repo ultimate-turbo-modal: The ultimate Turbo / Stimulus / Hotwire modal window for Rails
๐งฐ 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
๐ง 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:
โ๐พ 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.