- Short Ruby Newsletter
- Posts
- Short Ruby News - edition #24
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 [email protected].
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:
π Our Community
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 ..β
βHotwireβ
β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 new
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:
π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:
π 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
π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: π₯ π§ π
Newsletter
π 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:
Podcasts
π§ Drew Bragg published two episodes of Code and the Coding Coders who Code it:
π§ Content For Devs published their first 2 episodes:
π§ 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:
Videos
π₯ 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!
π₯ 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
Articles
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
Kevin Newton finished their series with an article about instructions that are optionally compiled in Advent of YARV: Part 24
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
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.
Reply