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:

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 [email protected]. 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:

A code sample showing how to use Dry::Monads and Date.define to return status from a HTTP client

👉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.

🧰 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?

🗞️ Ruby Weekly published a new edition: Incredibly fast Ruby formatting

🗞️ Ruby LibHunt published a new edition of the Awesome Ruby Newsletter

Podcasts

Videos

Talks

📽️ Dave Kimura published the video walkthrough of This Week in Rails

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:

🎥 Yaroslav Shmarov published a couple of new videos showing:

🎥 Pete Hawkins shared a short Ruby video Tip about using Struct

Articles

What’s new

How-Tos

Deep Dives

More general

Related

🤗 Founding Members supporting ShortRuby

Read more about what is a Founding Member or about Why pay for ShortRuby newsletter

Reply

or to participate.