- Short Ruby Newsletter
- Posts
- 🤝 Short Ruby - edition #17
🤝 Short Ruby - edition #17
Briefly about everything happening in Ruby world
If you want a short excerpt of this newsletter, I created one here
This edition was created with support from @adrianthedev from Avo for Ruby on Rails (a friendly full-featured Rails admin panel), @jcsrb, and @kpumuk, who sent me recommendations to include in the newsletter.
about the community
Linus Torvalds talks about Git's success in an interview:
I listened to the interview, and I want to make this clear: What Linus is saying is that Git reached success quicker than he expected, thanks to Ruby developers. In this context, “strange” is used somehow, like saying strange people that understood what I created.
Collin Jilbert shared lovely words celebrating his 4th year of writing code:
👉 Kirill Shevchenko shared in a thread multiple examples of using Ruby predefined global variables:
Here is a summary of the code samples shared by Kirill in the thread:
You should read the thread as more people shared how they use these variables. Also, if you are curious about what global variables Ruby has, check out the documentation about Pre-defined global variables.
If you don’t want to work with the $ notation, there is a module (now part of stdlib) called “English” (seems to be since Ruby 3.0):
👉 Adrian Marin shared a thread about how to move from Heroku to Dokku:
👉 David Copeland shared a thread where they build a good DX for running bin/setup:
You can find the scripts for doing this setup on Dave Github. It is worth considering this brief summary of what makes a good bin/setup script:
👉 David Teren shared a code sample showing how to configure Rails 7 (Hotwire) and Devise logout:
👉 Aaron Patterson shared a PR that was merged to Ruby about changing how Classes and Module are storing instance variables:
👉 Greg Navis shared a thread explaining some Active Record methods that can be useful when dealing with persistence:
If any of these methods are interesting, you should read the entire thread, as it has code samples for each method. Here is a summary of them:
previously_new_record? → “Returns true if this object was just created – that is, prior to the last save, the object didn't exist in the database and new_record? would have returned true”
previously_persisted? → “Returns true if this object was previously persisted but now it has been deleted”
destroyed? → “Returns true if this object has been destroyed, otherwise returns false.”
new_record? → “Returns true if this object hasn't been saved yet – that is, a record for the object doesn't exist in the database yet; otherwise, returns false”
persisted? → “Indicates if the model is persisted. Default is false.”
👉 Kevin Newton shared a code sample on Github showing how to evolve the code when using pattern matching and decide what to execute based on object type:
Here is a small sample of the code there, but you should read the entire code as Kevin wrote there a good story about how the code evolved:
👉 Benoit Daloze warned about the grpc Ruby gem:
Aaron Patterson proposed a solution to use the grpc_kit from Cookpad
👉 Dima Fatko shared a new gem sidekiq-iteration that makes long-running Sidekiq jobs interruptible and resumable:
👉 Celso De Sa shared that the Junior Developer Program at Sierra Rails is open:
👉 Ryan Bates shared asked a question about changing directory structure in Rails:
Among the answers:
This good article by Jason Sweet about Organising Rails files by meaning
A video from RailsConf 2022 about Laying the Cultural and Technical Foundation for Big Rails by Alex Evanczuk
This episode from Code With Jason podcast 162 - Large Rails Apps with Alex Evanczuk, Software Engineer at Gusto
Using engines helps with isolating boundaries but has the cons of adding friction to the development process
This suggestion about how to organize could also be worth considering:
👉 Jared White shared that the Rails readme already specifies where to put the business logic:
Here is the relevant quote from Rails docs:
A brief version of this is also present in the official Ruby on Rails guide:
I suggest you read the entire conversation related to Jared's share. It has some great points about how to organize code and also a good debate about naming.
👉 Joel Drapper shared about the future of Phlex and supporting multi-format:
👉 Greg Navis shared a thread about how Active Record id attribute works:
👉 Kirill Shevchenko shared a code sample showing how to store cache and session in Redis using redis-rails gem
👉 Greg Navis shared a thread about how Active Record queries are cached in controller actions. I invite you to read the entire thread where he explores how this works, and it shows code samples from Rails handling the cache:
👉 Matt Swanson shared Ruby English-friendly alternatives to gsub and chomp:
👉 Josh Cheek shared a code sample about various forms of “class method”:
Joel Drapper shared a short explanation:
👉 Greg Navis shared a tip about how to run two branches in the same time with git worktree
👉 Jim Gay shared a code sample about how to define a method that should be implemented in subclasses:
If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:
Related (but not Ruby-specific)
👌 Jason Swett shared advice about not making premature generalization:
He also asked about why duplication is more acceptable in test code than in application code:
👌 Chris Mc Cord shared a quote from the creator of VueJS Evan You:
👌 Tobias Petry.Sql shared an SQL tip about how to place NULL values at the start or end of a query:L
👌 Joel Drapper shared about the problem with sustaining independent open-source projects:
Lucian Ghinda also shared an idea about how to support open source:
👌 Dave Paola shared a good thread about onboarding juniors:
If you are interested in this subject, go ahead and read the entire thread and also you might want to check out these two articles from PlanetArgon:
Articles and Videos
Something to read
Newsletters
🗞️ Women On Rails shared a new edition ✋ Newsletter #38: Me Too
🗞️ Greg Molnar shared a new edition of This Week in Rails: An improved error page, 🗞️ groundwork for composite primary keys and Stimulus 3.1.1
🗞️ Ruby Weekly published a new edition 627: Sidekiq 7.0 – it's now embeddable
🗞️ Ruby LibHunt published a new edition of the Awesome Ruby Newsletter
🗞 Andrew Mason shared a new edition of Ruby Radar 75 - Happy November
✍🏾 Articles
Xavier Noria published a new article A Pattern for STIs in Rails
Eric Berry shared an article written by Joe Wilm (OneSignal CTO) about Lessons Learned From 5 Years of Scaling PostgreSQL
Eric Berry shared an article written by Pasha Gray about Effective Queries with Rails and PostgreSQL
Something to watch 🎥 or listen 🎧
Videos
🎥 Nate Berkopec shared their talk at Kaigi on Rails is now on Youtube: All About Queueing In Rails Applications
🎥 Joel Drapper shared a new pairing session with Kasper Timm Hansen about Mixing HTML attributes in Ruby
🎥 Joel Drapper shared a new episode where he paired with Chris: Coding with Chris - Goblin Grinder part 2
🎥 Drifting Ruby shared the video walkthrough for This Week in Rails - Nov 4th, 2022
🎥 Stan Lo shared their video from RubyKaigi ruby/debug - The best investment for your productivity
Audio & Podcasts
🎧 Drew Bragg published a new episode with Noel Rappin where they discussed the new Pickaxe book for Ruby 3.2: Episode 11 - Noel Rappin
🎧 Matt Swanson published the first episode of the new podcast called YAGNI (You Ain't Gonna Need It). The episode is with Chris Toomey, and it is about Detailed commit messages
🎧 The Ruby on Rails Podcast published a new episode with Dave Paola Sierra Rails (The Apprenticeship Pattern)
🎧 Andrew Mason shared a new episode of Remote Ruby with Kevin Newton about Ruby Parser, SyntaxTree, Prettier Ruby and a sneak peek
🎧 Ruby for All published a new episode Updating The PickAxe Book with Noel Rappin
🎧 The Bike Shed published a new episode 360: ActiveRecord Models
Gems, Libraries, and Updates
🧰 Xavier Noria shared a new release of Zeitwerk 2.6.2. Check the changelog and be mindful not to use any private interface. Xavier is planning to protect the private interfaces:
This release starts a series of gradual patches in which private interface is enforced with stricter formal visibility. (source: https://github.com/fxn/zeitwerk)
🧰 Marco Roth shared that Stimulus released a new version v3.1.1. Read the changelog
🧰 Andrew Culver published a new gem bullet_train-routes. Read the changelog. Here is what it looks like:
Terri O shared a tool to check for vulnerable openssl cve-bin-tool:
🧰 Stefanni Brasil shared that they released faker-ruby/faker v3.0.0
🧰 Nate Hopkins published a new version of TurboReflex v.0.0.13
🧰 Takashi Kokubun shared they merged a new PR to irb about Allow non-identifier aliases like Pry's @ and $
🧰 Mike Perham shared that Sidekiq OSS, Pro and Enterprise v.7.0.1 are released. Read the changelog
Reply