- Short Ruby Newsletter
- Posts
- Edition #14 - 10-16 October 2022
Edition #14 - 10-16 October 2022
The one with the map of Ruby books
If you want a short excerpt of this newsletter containing only some of the images with code, I created one here. But I invite you to read the entire newsletter as it has excellent content 😊.
This edition was created with support from @adrianthedev from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and from @jcsrb, who sent me recommendations to include in the newsletter.
👉 Krzysztof Witczak shared on Reddit a map of books for learning Ruby:
👉 Thiago Massa shared an interesting idiom to build DSLs in Ruby:
👉 Greg Navis shared a code sample showing how to use where.not and where.missing
👉 Alexandre Ruban shared about extending a module:
Joel Drapper shared an example where he uses this on Phlex and Josh Cheek shared an article explaining how to use extend while implementing decorator pattern.
👉 Kirill Shevchenko shared a code sample about how to use catch/throw in Ruby:
👉 Greg Navis shared code sample about combining Active Record conditions with OR:
👉 Joel Drapper shared an update about Phlex that will support content for and thus be able to work with existing ERB layout templates:
👉 Konnor Rogers shared a small piece of knowledge about how Trix works with attachments:
He also shared the line of code from Rails that handles this. If you are interested in customizing ActiveText, maybe you want to follow the Konnor series of articles on dev.to about Action Text.
👉 Peter Solnica shared about where to place POROs continuing to answer a question that Jacob Daddario asked one week before.
Here is a summary, but please read the entire thread (nitter link or Thereaderapp ) from Peter as he shares there also the why and more wisdom about how to think about organizing Rails code:
👉 Lewis Youl shared a code sample about how to access the record that caused an error from ActiveRecord::RecordInvalid error:
👉 Lucian Ghinda shared a code sample showing the ignore_columns property of Active Record:
👉 Greg Navis shared advice to use symbol-based error codes instead of string literals:
👉 Akshay shared a thread explaining howt &:method work in Ruby. Here is one of the tweets in the threadL
👉 Nate Berkopec shared a performance tip for web apps with DB backends:
👉 Kasper Timm Hansen shared they wrote a helper to explore and work with Rails routes in console:
👉 Thiago Massa shared a code sample about using prepend in Ruby:
In case you are looking for an explanation about the difference between prepend and include Paweł Dąbrowski replied with the following explanation:
Prepend is like include, it adds the method as the instance method, but while prepend places the module at the beginning of the ancestors' chain, including places it after the class in which it was included.
Pawel wrote a detailed article about this: Extending Ruby Classes
There is also a shorter explanation of what prepend does, replied by Karl Oscar Weber:
So prepend is like, reopening the class and redefining methods, but only you can still call the methods that you redefine, by using Super.
👉 Emmanuel Hayford shared a code sample for seeing the location of a method in Ruby with source.display provided by the method_source gem (included by default in Rails):
👉 David Copeland shared a thread with a critique of the static typing people say about dynamic typing:
Here is a summary of some of the replies in that thread:
It is also worth reading the tweet from Xavier Noria:
👉 Kirill Shevchenko shared a code sample about how to run a system command:
Kirill also shared three more ways for more complex manipulations:
IO.popen
Open3
PTY
It is also worth considering this reply from Josh Cheek with an example of how to use Open3 in Ruby:
👉 Nate Berkopec shared a tip about how to make the test suite run faster:
👉 Greg Navis shared about less known Rails settings:
👉 Joe Masilotti shared a quote from someone wondering if they should learn Ruby and Rails:
This seems to be a problem in Ruby/Rails world, as there are very few jobs for juniors. Thus, this does not attract so many people. I think you should read all the replies. It is hard to summarise them here.
It is also worth reading this thread from Nate Hopkins quoting Joe and adding some context:
And this reply from Morgan VanDerLeest:
👉 Lucian Ghinda shared a thread about alternative ways to freeze strings in Ruby, showing the String#-@ method:
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)
🧐 Óscar M. Lage Guitián shared a tip about formatting JSON with jq in Vim:
🧐 Brandon Weaver shared a nice quote about calm and living life:
Here is a summary of the replies comparing `git rebase main` with `git merge main`:
🧐 Brandon Weaver shared a thread (nitter link) about engineering leadership:
Here are two more tips shared in the replies to this tweet:
github[.]com/[username].png (@liran_tal)
gitlab[.]com/[username].keys (@solidnerd)
🧐 Dare Obasanjo shared a take on the source of large-scale product problems:
Articles and Videos
Courses
Peter Solnica launched their new course about Data Oriented Web Development with Ruby:
Something to read
🗞 Newsletters
🗞 Greg Molnar shared a new edition of This Week in Rails: Read Column information in ERB template exceptions, migration option validation and more!
🗞 RubyWeekly published the 624 Edition of Ruby Weekly
🗞 Ruby Libhunt published the 334 edition of the Awesome Ruby Newsletter
✍🏾 Articles
Eric Berry shared an article written by Julian Rubisch about deploying a Reactive Rails application to @flydotio
Akshay shared an article they wrote The Definitive Guide to Rack for Rails Developers
Eric Berry shared a very detailed article about The Rails SaaS Conference
Noah Gibbs shared a great article about How Do You Run a Coding Workshop?
Andrea Fomera shared two articles about implementing mentions with Action Text. Read Combined Mentions with ActionText (Part 1) and Combined Mentions with ActionText (Part 2)
Janko Marohnić shared an article they wrote about What It Took to Build a Rails Integration for Rodauth
Noah Gibbs shared an article they wrote about What Things Should You Break Out Into Services?
Vladimir Dementyev shared a new article they wrote about using View Components: Building modern Rails frontends
Lucian Ghinda published a new article about Alternative Ways to freeze strings in Ruby
Something to watch 🎥 or listen 🎧
🎥 Videos
🎥 Yaroslav Shmarov shared a new video about Setting up Github Actions CI (run Tests, Rubocop, Erblint)
🎥 Drifting Ruby shared the video version of This Week in Rails Oct 14th, 2022
🎥 Adrian Marin shared the presentation done by Yaroslav Shmarov at @wrocloverb about 18 months of using hotwire and viewcomponent in production. Yaroslav shared the slides used in that presentation here
Ruby Learning Center shared a new episode from Rebuilding Rails Chapter 3
🎧 Audio & Podcasts
🎧 The Ruby on Rails Podcast shared a new episode with Andy Croll. Listen Episode 439: One More Podcast Pitch with Andy Croll
🎧 Ruby For All shared a new episode about imposter syndrome. Listen Episode 12: Imposter Syndrome is Among Us
🎧 Remote Ruby shared a new episode with Collin Jilbert. Listen Behind The Scenes at GoRails with Collin Jilbert
🎧 Joel Quenneville shared a new episode of The Bike Shed with Amanda Beiner. Listen 357: Notetaking For Developers
🧰 Gems, Libraries, and Updates
🧰 Bridgetown shared the latest release of Bridgetown version 1.2: Bridgetown 1.2 “Bonny Slope” Takes Your Applications to the Next Level
🧰 Avo shared a new release with a resource sidebar, native field components, custom polities and a lot of bug fixes. Read the changelog or watch the video.
🧰 Josef Strzibny shared a tool for encrypting JSON, YAML values, and not key: See mozilla/sops
🧰 Vinicius Stock shared an update for the Ruby LSP server gem and for the VSCode plugin. Read the changelog for Ruby LSP Server and the one for the VSCode Plugin. It is also worth taking a look at the documentation.
🧰 Nate Berkopec shared announced the release of Puma 6.0 named Sunflower. Read the changelog
🧰 PostgreSQL announced the release of PostgreSQL v15
🧰 Yuri Sidorov shared a new gem called jbuilder-schema that will:
It automatically generates JSON-Schema from #jbuilder templates, which is useful to auto-generate OpenAPI documentation of your existing APIs.
🧰 Chris Oliver shared the Github ci.yml they use for Noticed that will run Github Actions on PG, MySQL, and SQLite.
🧰 Nejdet Kadir shared an extension for Phlex to use heroicons as SVG: phlex-heroicons:
🧰 Xavier Noria shared they are working on adding constant_path_at, namespace_at and eager load a directory to Zeitwerk
🧰 Peter Solnica announced they added Zeitwerk to almost all dry-rb gems inviting people to test and report if there are any issues.
🧰 Joel Drapper sharing a discussion where he explains how to create a Phlex view that behaves similarly to how ViewComponent works with slots.
🎵 Music for coding
A random selection of coding music:
Reply