Short Ruby News - edition #24
Briefly about everything happening in Ruby world
This edition covers 19 December 2022 - 8 January 2023, when I was on holiday. I was not very active on the channels I usually follow, but I tried my best to read them all retrospectively, so if I need to include something that is not here, please let me know at firstname.lastname@example.org.
This was not sent via email as it is too long and covers a different period than last week.
This edition was created with the help of Adrian Marin from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and Jakob Cosoroabă.
You can jump directly to one of the following sections if you like:
🧰 Gems, Libraries, and Updates
🤝 Related (but not Ruby-specific)
More content: 🎥 🎧 🗞 (articles, podcasts, videos, slides, and newsletters)
👐 Our Community
👐 The main event of this period is the release of Ruby 3.2
Read the full announcement on ruby-lang.org
👐 Ian Moss launched a community project where he invites Ruby developers across the world to contribute:
Link to the Gitlab project. Read more here and here.
👐 Noah Gibbs shared that call for papers is open for Ruby Kaigi 2023:
👐 Brandon Weaver shared that Ruby Learning Center will start two classes:
👐 Yukihiro Matz shared a link to Ruby 30th Anniversary Event happening in 2023:
👐 The Rubber Duck Dev Show shared they new Discord Server
👐 Kirill Shevchenko shared a list of good resources to get Ruby content in their thread:
👐 Julian Rubisch asked about what people want to learn about Ruby and Rails in 2023:
Here are some answers from the replies:
“Turbo Native for Android and iOS”
“PWAs for Rails”
“How to properly organize mid-sized apps so you can keep making changes and additions easily without fear”
“Rails internals and how everything works together, like the initialization process, how railties works ..”
“Game programming in Ruby”
👉 All about Code and Ruby
👉 Joel Drapper shared a piece of code explaining how new works in Ruby and that an object can be initialized with
allocated instead of
Abdullah Alattas shared code sample showing alternate quoting mechanisms in Ruby:
👉 James Mead shared a better name for reverse_merge for Hashes that exists in Active Record - with_defaults
👉 Paul Mucur wrote about two important discussions happening in Ruby:
Read about Project-scoped refinements and about Proposal: Import Modules
👉 Dave Copeland shared a code sample showing that `to_hash` is callend when using
double-splat ** operator (check the gist on Github)
You should read the entire conversation it has good explanations. Here are two replies that adds some interesting context:
In case you want to play with this Noel Rappin shared a piece of code that you can use in this gist.
👉 Dave Copeland shared that ENV (documentation link) is a special case and should be used as such:
Peter Solnica shared that using ENV should be a anti-pattern:
Then Dave shared a piece of code showing how to implement your settings class. It will help if you read the entire conversation as there are good reasons for not directly referencing ENV in your code (like hard to know without grepping what ENV vars are used, your code relying on an environment you cannot control and more).
👉 Nicolas Cavigneaux shared exciting news about Ruby 3.2:
Another way to enable YJIT is:
👉Collin Jillbert shared a short code sample showing how to use Ruby in command line:
👉Kevin Newton shared a code sample about the loop index field in Ruby:
👉 пан Zverok shared a code sample showing how to use pattern matching in Ruby:
👉 Kyle Keesling shared a piece of code showing a feature that will come in Rails 7.1 (read the merged PR here)
👉Tobi Lutke shared that Shopify is running Ruby 3.2 with YJIT enabled:
If you want to read a summary of improvements in Ruby 3.2 you might also want top read this thread from Ufuk Kayserilioglu:
👉Emmanuel Hayford shared a piece of code showing a new feature of Rails 7.1 → Rails.env.local?
👉Lázaro Nixon shared their contribution to Rails to change what is happening when replacing has_one association using the create_association method:
👉 Stanislav Katkov shared a command line that helps checking syntax in a Ruby file:
👉 みょうが shared that development for Ruby 3.3 has started:
👉 Takashi Kokubun shared a benchmark for Ruby 3.2 YJIT:
Here is how the results looks like:
Another bookmark was shared Rafael Silva about using Ruby 3.2 at Discourse:
And more benchmarks are shared here
👉Nate Berkopec shared why is good to decompose pages with Turbo Frames:
👉Nate Hopkins shared that all Turbo enhancing libraries now live under TurboBoost umbrella:
👉Collin shared about how to use Ruby debugger to know what assertions are available in a test:
👉Greg Molnar shared that in Ruby 3.2 ERB::Util.html_escape is faster than CGI.escapeHTML:
👉 Lucian Ghinda shared a code sample explaining a simple refactoring guideline:
👉Kirill Shevchenko recapped their best Ruby tweets in 2022:
Read them all in the thread he shared.
👉 Sebastian Wilgosz shared a Ruby tip about using :space instead of \s in regexp:
👉Jason Swett shared most common reasons for flaky tests:
Here are some other replies:
“db record ordering”
“tests that depend on relative time”
“Mutable global state”
“timezones / UTC to local time conversions”
“not accounting for daylight savings”
There are a lot more replies to Jason's question that present some more examples of the 4 categories he shared.
👉Adrian Oprea asked about what to use for recurring jobs in Rails:
Among the recommendations:
Sidekiq with sidekiq-cron or with sidekiq_scheduler gem
CloudTask via Cloudtasker gem and Cloud Run Google Serverless service
Schedule the jobs with Whenever
Amazon SES via shoryuken gem
👉Timnan shared a code sample showing how to use next on Ruby for alphanumeric incrementing:
👉Greg Navis shared a big thread with code samples describing the new features in Ruby 3.2:
He will show code samples for:
New Hook method
New core class: Data
Rest and keyword rest arguments can be forwarded anonymously
Ruby pattern matching - find pattern
Error reporting improvements
Procs taking one positional parameter + keyword parameters behave in less surprising way
Left-to-right constant assignment on explicit objects
Refinements and meta-programming
MatchData can return a byte range
String got three byte-level methods
But you can find more news in the thread
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 two releases :
2.23 with Timezone callable and few bugfixes. Read the release notes or read the announcement thread
2.22 with Dashboards authorization, buf fixes and maintenance tasks. Read the release notes or read the announcement thread
🧰 DHH shared a new PR that will Add default Dockerfiles. You might also want to check this discussion on Fly.io forum about the Dockerfile or directly read the merged PR proposed by Sam Ruby matches node version to dev environment.
🧰 Peter Solnica shared a PR that seems to fix the issues with RSpec Mocks and Ruby 3.2
🧰 Camilo Payan shared a new release of Standard version 1.21 that comes with patches for rubocop and rubocop performance. See the changelog here
🧰 Nick Janetakis announced that the official Docker image for Ruby 3.2 was published. Check the images here
🧰 Mike Dalessio announced the release of sqlite3 v1.6.0.rc1 which ships native (pre-compiled) packages for Ruby 3.2
🧰 Two releases of Rubocop happened in the last two weeks: RuboCop 1.42 and RuboCop 1.41. Among the most interesting things that are part of Ruby 3.2 it is worth reading this commit that will allow excluding keyword arguments from the total count of Metrics/ParameterList to allow
Date.define to set defaults.
🧰 Postmodern announced the release of spidr v 0.7.0. Read the changelog
Spidr is a versatile Ruby web spidering library that can spider a site, multiple domains, certain links or infinitely. Spidr is designed to be fast and easy to use.
🧰 Kevin Newton published their new Ruby parser as open source repository Yet Another Ruby Parser with the target to facilitate the following use-cases:
Anything that needs a syntax tree. This includes compilers, linters, formatters, or pretty much anything else that needs to reflect on code (source)
🧰 Ruby Lib Hunt shared a new version of HexaPDF - HexaPDF 0.28.0 making use of great performance from Ruby 3.2
🧰 Ryan Davis shared that a minitest version 5.17.0 has been released!
🧰 Jeremy Evans shared a new release of Sequel 5.64.0 Released
🧰 Hongli Lai shared that Fullstaq Ruby now provides Ruby 3.2 support, with YJIT
🧰 Hanami announced the release of Hanami v.2.0.2 with official support for Ruby 3.2 - Read the changelog
🧰 Stanislav Katkov shared a plugin he created for running on danger the ruby -c command to check file syntax: danger-rubyc
🤝 Related (but not Ruby-specific)
Tim Zoller shared a take about Scaled Agile/SAFe:
You might also consider reading this website safedelusion.com and the replies to Tim
🤝 Doc Norton shared a take about agile process:
🤝 Jason Swett shared a thread about why refactoring is important for good design:
🤝 Nate Berkopec shared about building abstractions:
🤝 Tobias Petry.Sql shared an SQL tip about Function-Based Indexes:
🤝Nate Berkopec shared a take about the purpose of code reviews:
🤝 Jason Swett asked a question about how to decide whether to clean up a piece of code or leave it alone:
And here are some replies:
🤝 Luca Guidi shared a beautiful thread about lessons learned in 20 years of professional programming:
Here are the 10 things shared by Luca:
1. Be kind.
2. Collective intelligence is better than your ego.
3. Have good health patterns: work/life balance, sleep, exercise, stay hydrated, and non-tech hobbies.
4. Be organized. Timebox.
5. Communication, transparency, and work ethic are essential with your team and non-technical stakeholders.
6. Practice deliberately.
7. Constantly acquire and share knowledge.
8. Ask for help. No one knows everything, and it's okay to admit when you don't know something.
9. Be open to feedback and willing to improve. We all make mistakes, and it's fundamental to learn from them.
10. Write clean (not smart) code. It may take more time upfront, but it will save time in the long run.
More content: 🎥 🎧 🗞
🗞 Joe Masilotti shared a new edition of Hotwire Dev Newsletter
🗞This Week in Rails published a couple of editions:
🗞 Ruby Radar published a couple of editions:
🗞 Ruby Weekly published a couple of editions:
🗞️ Ruby LibHunt published a couple of editions:
Issue 345 - Year in Review 2022: Tenderlove's Ruby and Rails Reflections and Predictions
🎧 Drew Bragg published two episodes of Code and the Coding Coders who Code it:
🎧 Content For Devs published their first 2 episodes:
The importance of Naming things | About the podcast, Q&A and random rumbling around our stories.
🎧 Ruby For All published a couple of episodes:
🎧 Jason Swett published a couple of episodes:
🎧 The Ruby on Rails Podcast published a couple of episodes:
Episode 450: Bootstrapping SaaS on Rails + Finding Community with Adam Pallozzi
Episode 449: New OSS Maintainers with Stefanni Brasil and Thiago Araujo
🎥 Scott Johnson shared a video created by Nick Janetakis about A Guide for Running Rails in Docker
🎥 Hanami Mastery published a new episode: Scale your app with slices!
🎥 Deanin published a couples of videos:
🎥 Alex Bacardit shared a video about RailsConf 2022 - A Rails Performance Guidebook: from 0 to 1B requests/day by Cristian Planas
🎥 Drifting Ruby published their video version of This Week in Rails - Dec 23rd, 2022
🎥 Jason Swett published the two episodes from Code With Jason Meetup:
🎥 Nate Berkopec shared their talk at RubyConfTH 2022 - Keynote: A Beginner's Guide to Puma Internals by Nate Berkopec
🎥 Tom Stuart published a new videos about Making a WebAssembly interpreter in Ruby, part 25
🎥 Sebastian Wilgosz shared a video presented by Tim Riley at RubyConfTh: RubyConfTH 2022 - Hanami 2: New Framework, New You by Tim Riley
Emmanuel Hayford shared a new article they wrote about This Week In Rails Wrapped: An Overview Of Rails 7.1 Features. Part I.
Jorge Manrubia shared a new article they wrote about Active Record, nice and blended
Denis Defreyne shared an article about Avoiding bugs in Ruby code using the state pattern
Abdullah Alattas published an article about The new built-in class: Set
Scott Johnson shared a blog post written by Nick Janetakis about A Guide for Running Rails in Docker
Adrian Marin shared an article about Rails console command made easier
Victor Shepelev published a new article about What not to forget when implementing a pattern-matching in Ruby for custom objects
Thoughtbot shared an article about How to validate the presence of a boolean field in a Rails model
Kevin Newton finished their series with an article about instructions that are optionally compiled in Advent of YARV: Part 24
Ruby Lib Hunt shared an article about Optimizing Ruby’s Memory Layout: Variable Width Allocation
Yukihiro Matz shared a link about What I'm doing personally to improve the quality of Ruby interpreters
Ahmad Khattab published a new article about Representing boolean conditions as domain concepts
Kevin Newton shared their 2023 Resolutions
Ruby Lib Hunt shared an article written by Dinesh Gowda about Materialized View: SQL Queries on Steroids
Emmanuel Hayford published their first article about This Week In Rails Wrapped: An Overview Of Rails 7.1 Features. Part II
Nick Janetakis published an article about A Guide for Running Rails in Docker
Alessandro Rodi published a new article about Preloading associations on an Array of Objects
Eric Berry shared an article about Using Named Scopes Across Models with ActiveRecord#Merge
Hanami Mastery published an article about Hanami Mastery 2022 - Year Summary and next plans.
Thanks for reading Short Ruby Newsletter! If you enjoyed this and want to receive the newsletter weekly in your inbox, consider subscribing: