

Discover more from Short Ruby Newsletter
Short Ruby News - Edition #31
Briefly about everything happening in Ruby world - week 8 of 2023 (web version)
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, and newsletters)
๐ค Founding Members supporting this newsletter
You can subscribe for free
Or you can consider upgrading to paid
Investing in the Ruby Weekly Newsletter as a paid subscriber is a valuable way to support the community around you. For ~1.5$/week (6.5$ per month), you can support its growth and ensure that high-quality information about the latest developments in Ruby continues to be available to everyone, both paying and non-paying subscribers alike.
If you consider upgrading and want more information, please read Why to subscribe to paid
๐ Our Community
๐ We are celebrating Ruby's 30th birthday. There are so many great tweets about Ruby that for me was very hard to choose something to put here and putting them all would have made this newsletter almost infinite.
You can read them all on Twitter or on Mastodon
Here is a short history piece about naming the language:
Matz added:
๐ Adrian Marin announced a new international Ruby conference happening in Europe Friendly.rb. I am part of the organising team :)

๐ Please be aware that Ruby 2.7 will reach EOL at the end of March 2023:
๐ If you are a junior Ruby developer there is a conversation on Reddit where you can find more people to connect to:

๐ Evil Martians announced they are launching a series of online round table discussions Join Ep. 1 โย Building communities around products, Thu, Mar 2, 2023, 11:00 (PT)

๐The Rubber Duck Dev Show shared I think one of the common things we all feel about our Ruby community:

๐ Eric Berry announced that RubyMine provided him with a discount code of 20% off for Monthly and yearly plans with JetBrains Toolbox

๐ Avi.Nyc shared about how Ruby on Rails with the latest addons helps create rich web apps:

๐ All about Code and Ruby
๐๐ I'm very excited to announce Friendly.rb, a new Ruby conference I'm organizing in Bucharest, Romania on 27-28 September 2023.
With a focus on community, Friendly.rb is keeping it cozy with 100-ish attendees and some of the best European speakers. Our CFP is open until April 1st. As a speaker at Friendly.rb, you'll have the opportunity to connect with like-minded developers, share your expertise with a curious audience, gain valuable exposure in the Ruby community, and some perks from us.
PS: We also have limited sponsorship spots. If you think your company might benefit by sponsoring, let's get in touch. Send us a message at sponsorship@friendlyrb.com. We can help you write an email to pitch it to your technical leadership
๐ Nate Berkopec shared a tip about how to manage jobs:

๐ Postmodern shared the difference between URI.regexp
and URI.parse

๐James asked a question about ways of handling error responses from a third-party API:

Here are some of the responses:



๐Paweล ลwiฤ tkowski shared their findings about what slows down testing Hanami apps:

An issue was reported out of this to faker: Speedup require and first call #2719 and it seems that the most time is consumed in parsing fakers translations.
Another proposed solution was to use transactions for cleaning. See example of how to do this in the decafsucks/decafsucks repository.
๐Postmodern shared a microbenchmarking about testing value != nil
vs value.nil?

The possible explanation for this seems to be (rb_true and rb_obj_not_equal from Ruby source code)

It also seems that nil != value
is almost close to value.nil?

๐Noel Rappin shared a TIL about string unary operations -
and +

For more details Ryan Big shared the commit where these methods were implemented and Patrick de Heus confirmed that unary minus is aliased as dedu.
You can read about the proposal of aliasing it by reading the Alias String#-@ as String#dedup on Ruby issue tracker.
๐Dave Copeland started a discussion about what is missing from Rails:

Here are some other proposals from the discussion, but it is worth reading them all:


๐Paweล ลwiฤ tkowski shared a code sample about an Entity Component System used to model business logic:

๐ Olivier Lacan shared they are working to update their Ruby on Rails: The Big Picture course:

๐ /u/schneems published an interesting vision about formatting and linters in Ruby. You should read the entire comment here, as I am including only a part of it:

๐Emmanuel Hayford shared a code sample showing how to organised jobs in bulk in Rails 7.1

๐Luca Guidi shared a thread showing how to setup Hanami with Sidekiq. Here is one of the steps showing how to configure a sidekiq provider:

๐ Andrea Rocca shared a series of thread about Hotwire:
๐Nate Berkopec shared that configuring too many threads in Puma might increase average latency:

๐Greg Navis shared a thread about how to make a method recognise when it was called with no arguments vs when it was called with arguments set to nil (when arguments are passed vs when they are not passed):

๐Matt Swanson shared a code sample showing how to use validation scopes in Rails:

๐Stanislav (Stas) Katkov shared a thread about doing performance optimisation for Rails test suits:

It is worth looking at the code Stanislav shared on Github
๐Jeremy Smith shared a take about using Rails controller as service objects:

The entire conversation is good to read exploring various ways to organise code in Rails controllers. Here are some of replies:


๐Xavier Noria started a conversation about using constants vs global variables usage

Here are some ideas from the conversation:


๐Nate Berkopec shared about Rails memory usage:

Sam Saffron added:

๐Lucas The Dev reminded us about with_options feature of ActiveSupport:

๐Nate Hopkins reminded that there are a lot of advantages to invest time in proper designing ActiveRecord model layer:

You should read the thread as there are many good responses. Here are some of them:



๐Brad Gessler shared a code sample showing how to use Module.prepand for Middleware in a their rowdy web routing project:

๐Kirill Shevchenko shared a code sample about Template Method pattern:

๐Stephen Swann shared a code sample showing how to use find_in_batches to query an API that has a limit:

And if you are curious about the implementation of perform_with_jitter:

๐Moses Gathuku shared a code sample showing how to use turbo_stream to update templates:

๐Matt Swanson shared a code sample showing how they used nested concerns:

๐Kevin Newton shared how they created a Ruby parser that is faker than json/pure. Check it out at Faster JSON parser in Ruby

๐Stephen Swann shared a warning about prepend_view_path
that can have memory issues:

Vladimir also added:

๐Kevin Newton shared that Syntax Tree playground now has support for mermaid diagrams:

๐Yusuke Endoh shared a quine that works on all Ruby versions. Check it out here Rubyใฎๅ จใใผใธใงใณใงๅใQuine - ใพใใใ

๐Prabin Poudel shared a code sample about difference between using {โฆ} and (โฆ) in RSpec:

You can subscribe for free if you like this kind of content
Or you can consider upgrading to paid
Investing in the Ruby Weekly Newsletter as a paid subscriber is a valuable way to support the community around you. For ~1.5$/week (6.5$ per month), you can support its growth and ensure that high-quality information about the latest developments in Ruby continues to be available to everyone, both paying and non-paying subscribers alike.
If you consider upgrading and want more information, please read Why to subscribe to paid
๐งฐ Gems, Libraries, and Updates
๐งฐ Adrian Marin shared an update the next version of Avo Admin for Rails:

๐งฐ Jean Boussier shared the pid_cache gem that caches calls to Process.pid to avoid useless system calls on modern Linux:

๐งฐ Jared White announced the release of Ruby2JS 5.1. Read the changelog here:
Ruby2JS is an extensible Ruby to modern JavaScript transpiler you can use in production today.
๐งฐ Bart De Water shared a gem that helps set better security headers for Rails github/secure_headers: Manages application of security headers with many safe defaults
๐งฐ Soutaro Matsumoto shared that RBS 3.0 is released Read the release notes
๐งฐ Joel Drapper shared their new testing library called green_dots. Here is a code sample using green_dots to test itself:
๐งฐ Felipe Vogel shared a library called sconover/wrong:

๐งฐ Joel Drapper shared they released version 0.7.1 of phlex-rails. Read the changelog
๐งฐ Postmodern announced their new gem called rubocop-ronin:
๐งฐ Adam Doppelt published an extension for VScode called Ruby Open Gem that helps with opening gem sources from VScode.
๐งฐ Okura Masafumi shared a repository showing "30 ways for hello world in Ruby okuramasafumi/Ruby30Event
๐งฐ Samuel Williams shared an update of sus-vscode extension that now supports running tests interactively:

๐งฐ Stimulus Reflex announced the release of stimulus reflex v.3.5.0.pre10. Read the changelog:
๐งฐ Bram Jetten announced a new release of SpinaCMS: Release v2.14.0 ยท SpinaCMS/Spina. This includes search in the media library, new PageLink part and collapsable nested pages
๐งฐ Vinicius Stock announced a new release of ruby-lsp. Read about this at Release v0.4.1 ยท Shopify/ruby-lsp:

๐งฐ Rodrigo Serradura shared a repository they created to show 7 different ways to organise Rails code base Rails (API) app that shows different kinds of architecture (one per commit)
๐งฐ Koichi Ito announced a new release of Rubocop Rails. Read the changelog here
๐งฐJanko Marohniฤ announced a new release of rodauth-rails Read the full changelog here
๐ค Related (but not Ruby-specific)
๐คNoel Rappin shared a take about complexity while using SPAs:

๐คIrina Nazarova shared about how dev tools products are switching to 3-month launch week:

More content: ๐ฅ ๐ง ๐
๐ Books
Roman Pushkin updated the latest edition of Ruby is For Fun book
๐ Newsletters
๐Nate Berkopec published a new edition of their Ruby/Rails performance newsletter: In benchmarking, more is always better, right?
๐Joe Masilotti published a new edition of Hotwire Dev Newsletter: February 2023
๐Greg Molnar announced a new This Week in Rails newsletter about The Rails Foundation update, perform_all_later in AJ and more
๐๏ธย Ruby Weeklyย published a new edition:ย Incredibly fast Ruby formatting
๐ Ruby Radar published a new edition Ruby Radar #91 - Rubyโs 30th Birthday
๐๏ธย Ruby LibHuntย published a new edition of theย Awesome Ruby Newsletter
Podcasts
๐งContent For :Devs published a new episode with Ayush Newatia about his book The Rails and Hotwire Codex
๐งIndie Rails published a new episode with Listen to Joe Masilotti
๐ง Code And The Coding Coders Who Code It published a new episode about Episode 17 - Joe Masilotti
๐ง The Ruby on Rails Podcast published a new episode about Episode 458: LEARN Academy with Adam Cuppy, Sarah Proctor and Chelsea Kaufman
๐งJason Swett published a new episode about 174 - Freelancing with Jeremy Smith
๐งHanami Mastery announced a new episode about Live stream Magic with Chris Booth!
๐ง Ruby For All published a new episode about Favorite Ruby Methods: Part 4 - Enumerables + Bonus Methods
Videos
Talks
๐ฝ๏ธ Dave Kimura published the video walkthrough of This Week in Rails
๐ฝ๏ธ Hanami Mastery published a episode about 1 year in Ruby then 1 book done! Ayush Newatia
๐ฝ๏ธThe Rubber Duck Dev Show published a new episode about Ruby IDE Showdown With Adrian Marin, CJ Avilla & Eric Berry
Screencasts
๐ฅ Justin Searls announced the beginning of a new screencast series called Searls After Dark where he will build a Ruby on Rails app on camera.
๐ฅ RubyCademy published a short video about Be careful when using the shorthand for one-line methods
๐ฅ Hanami Mastery published a new video about Deploying Hanami Apps to Render
๐ฅ Deanin published a couple of videos showing:
๐ฅ Brighton Ruby published their videos from Brighton Ruby 2022
๐ฅ Yaroslav Shmarov published a couple of new videos showing:
๐ฅ Pete Hawkins shared a short Ruby video Tip about using Struct
Articles
Whatโs new
Ruby On Rails announced that Amanda Perino is our new executive director for The Rails Foundation
Johan Halse published an article about What to expect from your framework
Julian Rubisch published Storing Ephemeral UI State with Kredis for Rails | AppSignal Blog
Ruby Gems Status announced about Dependency API Deprecation - RubyGems Blog
Andrew Atkinson published an article exploring various gems for partitioning tables Rails: Postgres Native Partitioning
How-Tos
Andrei Kaleshka published an article about Unlocking the Power of ChatGPT with Ruby
Team Qameta published an article about How to migrate from Webpacker to jsbundling-rails in Ruby on Rails
Sam Ruby published a new article about how to do Health Checks in Rails 7.1 with Fly.io
Yaroslav Shmarov published an article about Send SMS with Twilio in Rails
Maciej Mensfeld shared an article written by Michael Krisher about Using Avro in Ruby
Sulman Baig published Clean Code Tip: Create a Service Object and Improve Your GraphQL Mutations in Rails
Kane Hooper published Creating an Intelligent Knowledge Base Q&A App with GPT-3 and Ruby
Lucas Barret published How I Turned My Coffee Addiction into a Ruby and Postgres Adventure
Neal Chambers published Basic Troubleshooting with Docker and Ruby on Rails
Deep Dives
Mohit Sindhwani shared the 3rd part of Ruby Learning by Reversing: Native Gems, Part 3
Dmitry Tsepelev published a deep dive about How to find a memory bloat in your Rails app before it happens
Evgeniy Demin published an article about Ruby Numbers and the Memory: how I got confused
Eileen M. Uchitelle published an article going into a deep dive about The Case Against Monkey Patching, From a Rails Core Team Member
Vinicius Stock published an article explaining why the Ruby LSP was created Improving the Developer Experience with the Ruby LSP
More general
Related
Jason Yip published an article about The age of cargo cult Agile must end
๐ค Founding Members supporting ShortRuby
Drew Bragg, host of Code and the Coding Coders who Code it
Avi Flombaum, the founder of Flatiron School, is a product engineer interested in full-time/contract work.
Adrian Marin, creator of Avo - a Ruby on Rails application building framework
Adam McCrea, creator of Judoscale (formerly Rails Autoscale)โtheย dead-simple autoscalerย for Rails, Sidekiq, etc.
Stephen Ierodiaconou from www.diaconou.com
Harry Lascelles
Jason Charnesย from Remote Ruby
Andy Croll fromย One Ruby Thingย and FirstRubyFriend
Read more about what is a Founding Member or about Why pay for ShortRuby newsletter