π» Short Ruby News - The Code Edition #39
Briefly about everything happening in Ruby world - week 16 of 2023
You can jump directly to a section:
πΒ All about Code and Ruby
π§°Β Gems, Libraries, and Updates
π€Β Related (but not Ruby-specific)
The content section that includes videos, talks, screencasts, podcasts, newsletters, and articles can now be found in The Content Edition (and sent in a separate email).
For just a small amount of $1.5 per week (only $6.5 a month), you can become a valued paid subscriber and actively support the thriving Ruby community we all love!
By contributing, you'll be playing a pivotal role in fostering growth and maintaining the high standards of ShortRuby for everyone to enjoy.
π All about Code and Ruby
πNate Hopkins shared a sample code and a gist about ActiveJob as Service Worker
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d4003a-409c-4fda-b584-4cd6d64f68f3_1348x1364.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec7896ec-1161-45a7-b20e-8933d9a88f9c_1384x666.png)
There is a good discussion in the replies to Nate proposal. I picked here a couple of the replies:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6bf72f1-1dcd-4b5a-94bc-6521bd495e4a_1230x450.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f30d45-fe83-4db9-8d23-3e0dafc66886_1220x440.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F448e761f-d94b-4a47-b9e5-b1218b48ddf0_1388x570.png)
π Ingemar shared how to run your gem documentation server:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F200e4096-dc14-4447-a269-3a10c5b02ee2_1306x692.png)
π Okura Masafumi shared a gist about Tell me if this module is included by the same class more than once
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac328b1c-ca38-4bb9-9372-58f3d18b808f_1314x404.png)
π Greg Navis shared a thread about Enumerable#all? Here is one of the posts shared:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa526f2a4-a8f7-469e-bdad-2b3514748302_1436x1210.png)
πNate Berkopec shared a tip about using preload and eager_load
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85dab11d-e2f2-46d3-a11b-2b3d85730b67_1282x458.png)
πPostmodern asked about suggestions to split a hash into a value for a key and the rest of the hash:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d4217a8-e70f-415b-abfa-b91576eef786_1298x432.png)
There are some good replies there, here are three of the proposed solutions:
Jesse Cooke proposed the following solution based on the article Everything You Need to Know About Destructuring in Ruby 3 suggested by Rachael Ludwick
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F565ca819-c68a-4539-b396-ede6a0441d40_1304x406.png)
Stephann V proposed the following direct solution:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa361569f-b4e4-4c8c-91c5-73af6d515bb3_1336x1048.png)
πDr Nic Williams asked for recommendations for building an admin section:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69287541-6a6a-421d-b641-8250e972cad4_1382x394.png)
Here are some recommendations:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1946975c-347b-4607-ac1f-690ed635b098_1378x330.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7d2337e-23ec-4970-870e-d97809c63a27_1226x654.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9df7196-cd03-4deb-b00a-a8c1bbd7a9b2_1372x480.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe12c71f7-475a-4f1c-8869-adfe8d25d559_1226x866.png)
π Greg Navis shared a thread about counting objects with Enumerable. Here is one of the tips shared in Greg thread:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd53299a1-6705-413a-b9c3-44fa2826582b_1430x1016.png)
πBrad Gessler shared an excellent comparison of components and partials in a thread where he presented an article about Component driven development on Rails with Phlex
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc36c44a-4e53-44cb-a29d-a11bcf521371_1412x590.png)
π u/A_little_rose/ presented a dilemma about how to work with class instance variables
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede2dfb0-32f1-41e1-9549-6d1e3db291b6_1618x446.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46d439-c8d0-485c-a77d-35268d07cf1d_1674x844.png)
You should read the proposed solution and the discussions on /r/ruby about this. Here is one of the answers:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbde1f2fc-655b-4b28-b424-faaaaf4a38d5_1698x638.png)
π Greg Navis shared a thread about extracting file name, directory name and extension from a file path:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc37e5b02-97c3-4ad0-829c-e54781fbf798_1392x1192.png)
πAndrew Mason asked about recommended gems of all time:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65098036-3f68-4ef1-bad4-5d3f272901eb_1384x646.png)
Andrew announced they would write an article and share it on RubyForAll thus, I will not compile here the list of recommended gems from the replies.
πMaciej Mensfeld announced support for iterating through Kafka topics with Iterator API - Karafka framework documentation
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04ddad3c-0c88-4d59-a399-0e67099b9a72_1402x1730.png)
πVincent Rolea shared a short thread about how simple it is to discard a modal with Turbo:
πAndrew Mason asked a question about productivity hacks:
Here are some suggestions:
Listening to music (genre suggested rap, dubstep
Using an app like Centerer app
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd898ef58-c531-4e3c-8435-03df20ae9f36_1372x472.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cf24580-e82e-46a5-87d7-0206d9940598_1374x338.png)
πMatt Swanson shared a piece of code showing how to use the ~* postgres operator:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0b65d52-c193-4805-a72c-51784457b97c_1416x1098.png)
πRobby Russell asked about recommendations for site generators that build pages for a collection of records from RESTful API:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08577bd4-359d-4808-a7af-02ffd9f6f6ac_1304x664.png)
Here are some recommendations:
sitepress.cc - that can be embedded in Rails
bridgetownrb.com - that has this page about HTTP Requests and the Resource Builder
there is an entire list of Static Site Generators at Awesome Ruby repo
π u/Plastic_Magician_420 shared the following answer to a question if Ruby is slow:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77b2b670-a223-458f-ae15-cb6fff816d38_1612x652.png)
π€ I imagine that if you have read so far, you find value in this newsletter.
π§° Gems, Libraries, and Updates
π§° Avo announced a new release v2.30.2 Read the changelog
π§° Joel Drapper announced they released version 1.0 of phlex-rails. Read the changelog
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d01849-db6d-470e-b13f-ccb4f47bf250_1332x420.png)
π§°Karl Oscar Weber announced the release of version 3.0 (and small updates v.3.0.1 and v.3.0.2) for Camping. Read the release notes for v3.0
π§° Xavier Noria announced a new release of zeitwerk: Efficient and thread-safe code loader for Ruby. Read the commit here
π§° Justin Searls announced the release of version 1.28.0 of standardrb/standard gem:
π§° Marco Roth announced a new releasee of phlexing: Release v0.5.0 Β· marcoroth/phlexing
π§° Koichi Ito announced the release of v0.6.0 for tmm1/test-queue (a parallel test runner specifically optimized for CI environments)
π§° Ronin Rb announced the plan for Phase 2 | Ronin
π§° Rails Links shared a repo from thoughbot containing thoughtbot/hotwire-example-template: A collection of branches that transmit HTML over the wire
π§° Ruby On Mac shared that their software can now help to install Ruby < 2.5.9 on Apple Silicon
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9332888d-45c2-4d89-bb93-fded1757a802_1390x596.png)
π§° Eric Berry shared a new gem they discovered called Boxcars AI:
π§°Nejdet Kadir announced a new gem nejdetkadir/safe_poller: SafePoller is a Ruby gem that provides a safe and reliable way to perform periodic polling operations in multi-threaded environments
π§° Igor Kasyanchuk published a new gem called lazy_value about:
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:
If you consider upgrading and want more information, please read Why to subscribe to paid
π€ Related (but not Ruby-specific)
π€Kevin Murphy shared a new feature of headless chrome Read more here
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5be5ec-82dd-4aeb-827a-6696c49e2445_1324x552.png)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa6b9526-83ac-4038-9460-af8634166db1_1578x1034.png)
π€Kent Beck shared about AI:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bef154e-cbdc-4ff8-b607-d6cdf5f265a6_1370x532.png)
You might want to consider reading the two articles Kent wrote as a follow-up to this tweet: 90% of My Skills Are Now Worth $0 and More What, Less How
π€ Tobias Petry.Sql shared a gist with over 1000+ PostgreSQL EXTENSIONs
π€Paul shared a piece of knowledge from Uncle Bob about naming:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd595ae4-3f96-495d-9c77-444897e0a916_1396x886.png)
π€Gustavo Valenzuela shared a bash code for opening a remote repo with branch param from terminal:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b33acc-819b-4b2f-9360-cf29c5459425_1382x1022.png)
You can read The Content Edition if you want to discover the content created in Ruby World in week 16 of 2023:
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:
If you consider upgrading and want more information, please read Why to subscribe to paid