

Discover more from Short Ruby Newsletter
This edition was created with the help ofย @adrianthedev/@adrian@ruby.socialย fromย Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and @jcsrb.
You can jump directly to one of the following sections if you like:
๐ Our Community
๐งฐ Gems, Libraries, and Updates
๐ค Related (but not Ruby-specific)
More content: ๐ฅ ๐ง ๐ (articles, podcasts, videos and newsletters)
๐ Our Community
๐ Hanami 2.0 was released. Read the release notes here.

๐ Ruby versions 3.1.3, 3.0.5 and 2.7.7 are released:

Related to this, Postmodern announced that ruby-versions now support all these three versions.
๐ Jean Boussier about Ruby/Rails:

๐ค Cezar Halmagean is offering all Short Ruby subscribers/readers a 40% discount for his course Learn Hotwire . Use coupon code SHORTRUBY
(valid until Tuesday) at the checkout :
๐ All about Code and Ruby
๐ย Greg Navisย shared a thread about constant autoloading. Read the whole thread about how constant autoloading works:

๐ Chris Oliver asked about deals for Ruby & Rails. Some of them were available for Friday, but I think you should check them out as most of them are still available:

Here is a list of links (that today - Sunday seems still to be valid) from the replies:
Avo - CMS and CRM builder on Ruby on Rails (use code RUBY20BF)
Spektr - vulnerability Scanning for Ruby on rails app - all plans free
StimulusReflex Patterns Premium + Advanced CableReady Bundle by Julian Rubisch
Pragmatic Programmer books are 40% off (code turkeysale2022) - that includes Programming Ruby 3.2 and Modern Front-End Development for Rails by Noel Rappin
Product Focused Ruby by Kasper Timm Hansen
๐ Mehdi Farsi shared a short code explaining the difference between ! and not:

If you want to understand more unary operators (the method ending with @
) here is an example:

๐ James shared a new project he is working on rubymyths.dev and here is the reason why:

If you want to know who was the one that inspired this and what they shared, read here
๐ Joel Drapper asked about why senior/principal engineers are asked basic Rails take-home coding challenges:

The thread also has some ideas about how a conversation about hiring senior developers could be.
๐ย Kelly Sommersย shared a joke that Mastodon seems slow, and it implied this is because of Ruby:


Nate Berkopec pointed out that maybe Ruby is not the issue here:

And also added that the X-runtime header is showing 92 milliseconds runtime:

I am adding something here: Kelly said they shared this as a joke, but this is a joke that is not so obvious and implies that Ruby is slow. Thus please take time to read the thread, as this kind of critique, sometimes thrown in a lightweight way, will influence decisions. It will help you be prepared to have this conversation.
๐ย Jason Swettย shared they are starting Code With Jason Salon. Register here if you want to participate:

๐ Joel Drapper shared a code preview showing conditional tokens support in the next version of Phlex:

๐ Greg Navisย shared a thread about using then
to sequence operations:

๐ Kirill Shevchenkoย shared a code sample about using the ActiveSupport built-in module for configuration:

๐ย Greg Navisย shared a thread about currying in Ruby. There are a lot of code samples there so here are two


๐ Peter Solnica shared a code sample showing how providers work in Hanami:

๐ Greg Molnar asked about Rspec or Minitest:

Here is a summary of reasons for choosing Minitest:
It is simple
It is fully supported by Rails.
It is easier to reason with
It is easy to onboard new developers as there is no new DSL to learn
And here is a summary of reasons for choosing RSpec:
Because a lot of people are using it
needs less code to achieve the same test case as with Minitest
Rspec seems less boring than Minitest
Worth considering listening to this YAGNI episode: RSpec w/ Justin Searls
๐ Joel Drapper started a discussion about method overload in Ruby (please be advised this does not work):

And this got a lot of gems proposing various ways to achieve this:
Jamie Gaskins shared their gem method_pattern:
Brandon Weaver shared their gem taking:
Paweล ลwiฤ tkowski shared their own gem noaidi:
๐ Lucian Ghinda asked about examples of using the endless method:

Here are some responses:
"Using it when the method is exactly one line with no logic (not even ||=)โ (@davetron500@ruby.social)
โsaw someone used it to replace the rails โscopeโ class methodโ (@schneems@ruby.social)
โI often use them for methods that are a single statement (not line, statement)โ (@joeldrapper@ruby.social)
โI use it mostly as a signal that the method is basically a computed attribute -- it's a single statement, and usually takes no arguments.โ (@noelrap@ruby.social)
โI use it with one-liners, mostly like I'm using one-liners in Elixir. Just return data, no mutations or memorizationโ (@katafrakt@ruby.social)
โOnly use Ruby 3.0โs endless method definitions with a single line body. Ideally, such method definitions should be both simple (a single expression) and free of side effects.โ (rubystyle.guide)
There are some code samples shared so you should read the replies.
If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:
๐งฐ Gems, Libraries, and Updates
๐งฐ Avoย shared a new release packed with a lot of goodies:

๐งฐ Joel Drapper shared a RC release for Phlex 1.0. Read the release notes here

๐งฐ Stan Loย shared that IRB v.1.5.0 has been released. He also shared short videos explaining the highlights:
Explaining edit commands and explaining debug commands:

๐งฐ Ruby Lib Huntย shared a ruby gem created by Andrew Kaneย polars-ruby - DataFrames for Ruby

๐งฐ Jean Boussierย sharedย a PR for fixing format_command Fix `format_command`'s terrible performance
๐งฐ Dima Fatkoย sharedย their two PRs that are merged and will be part of Rails 7.1 that will save many queries when updating records:
Avoid validating belongs_to association if it has not changed
Avoid validating a unique field if it has not changed and is backed by a unique index
๐งฐ Stanislav Katkovย sharedย a gem that provides a CLI utility for managing migrations jesseduffield/lazy_migrate: A little terminal UI for managing schema migrations in rails
๐งฐ Takashi Kokubun announced the release of ERB v.4.0.0:
RB::Util.html_escape became 1.77x faster in no-escape cases. From Ruby 3.2 or if you use ERB 4+, it's faster than CGI.escapeHTML
He also shared a PR that is merged to Rails main which will improve ERB speed
๐ค Related (but not Ruby-specific)
๐ค Mario Fusco shared an opinion about the Design Patterns book:

He then followed up with a thread explaining more about why they think the book is outdated and also shared.
๐ค Jason Swettย sharedย about one of the benefits of writing tests first:

๐ค Ryan Batesย shared about writing clever code:

More content: ๐ฅ ๐ง ๐
Newsletter
๐ Greg Molnarย shared a new edition of This Week in Rails:ย Disable enum methods generation, a concurrency fix and more!
๐ Ruby Radar published a new edition: Ruby Radar #78 - RubyConf 2022
๐๏ธ Ruby Weekly published a new edition: OK, this is a big week for Ruby
๐๏ธ Ruby LibHunt published a new edition of the Awesome Ruby Newsletter
Podcasts
๐ง The Ruby on Rails Podcastย published a new episode aboutย Episode 445: The 2022 Holiday Gift Guide Episode
๐ง Ruby For Allย published a new episode aboutย How to Open Source with Richard Schneeman
๐ง Joe Masilottiย published a new edition of Hotwire dev newsletter - November 2022
๐ง Matt Swanson published the last episode of YAGNI: RSpec w/ Justin Searls
๐ง Remote Rubyย published a new episode aboutย Tip Tapping Around & The Rails Foundation
Videos
๐ฅ Avo shared a video showing the last release's changes and how to use the code for the new features: Avo 2.20 - Arguments on filters and actions, keep action modal open, and select field fixes.
๐ฅ Joe Masilottiย published a live video aboutย Building a referral program from scratch for RailsDevs
๐ฅ The London Ruby User Group shared the videos from the November 2022 meeting:
Data Indexing with RGB (Ruby, Graphs and Bitmaps) by Benji Lewis
ruby/debug - The best investment for your productivity by Stan Lo
Keeping developers happy with a fast CI by Christian Bruckmayer
๐ฅ John Hawthorn shared a live stream on Twitch about improving Mastodon and looking at Ruby performance: Watch it here
๐ฅ Collin Donnell did a live streaming on Youtube about the first look at Hanami: Hanami First Look
๐ฅ Dave Kimura published a new episode about Active Storage Variants
Articles
Matt Zagajaย sharedย an article about How to Get Started with Ruby on Rails
Maciej Mensfeld shared an excellent article they wrote about contributing to Ruby on Rails and improving concurrency: Ruby concurrency is hard: how I became a Ruby on Rails contributor
Evil Martiansย shared the slides fromย Bites and bytes founder gathering: dev tools & open source by Evil Martians
Sinan Mujanย sharedย a new article about Stimulus MultiSelect
Yukihiro Matzย shared an article aboutย How I developed a faster Ruby interpreter
Pragmatic Programmers did an excellent interview with David Copeland: Spotlight: David Bryant Copeland (Author) Interview and AMA!
Pushpad Blog published a new article about Multi-Channel Notifications in Ruby on Rails with Noticed gem and Pushpad
Francois shared a great article about Stop lying to yourself โ you will never โfix itย laterโ
AppSignal blog published a new article by Julian Rubisch about System Notifications with Noticed and CableReady in Rails
Short Ruby News - edition #20
I am really enjoying this newsletter. Thanks for finding all of these good, interesting things so I don't have to.