- Short Ruby Newsletter
- Posts
- Issue #6 - 15-21 August 2022
Issue #6 - 15-21 August 2022
The one with deep conversations
Hello,
I’m Lucian (find me on Twitter @lucianghinda), and I am the curator of this newsletter. Thank you for subscribing to this newsletter.
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.
Andy Leverenz shared a nice and simple piece of wisdom:
Cezar Halmagean shared some topics that a junior developer should focus on along learning the language or framework:
Among other points that people shared in the conversation were:
“Radical candor, and graciously accepting feedback. That goes for seniors too!” (source) by inkyvoxel
“Rubocop, Hotwire, Refactoring, design patterns and how to avoid shitty jobs” (source) by Benjamín Silva H.
“Accessibility” (source) by Konnor Rogers
“controllers, views, and forms do not need to reflect a single underlying model. - you could have two different controllers changing the same model based on usage - one controller / view form may update multiple models” (source) by Rose W
And there are many more concrete examples of things to learn for juniors in that thread.
Nick Schwaderer shared an example about undefining all instance variables but keeping a secret reference:
Here is what that class looks like from the example on Github:
Joel Drapper asked about how to simply serve static files on Ruby:
And received a lot of good suggestions (not only from Ruby):
ruby -run -e httpd . -p 8000 were the most common answer and the simplest one in ruby
Also, Olle Jonsson shared a link to a piece of code defined in Ruby that allows running multiple interesting small utilities:
Ruby Gems Status shared that they started to require MFA for the popular gems:
Joe Masilotti asked about how to send a notification when subscription status changes:
He also shared a piece of code about what he tries to do and received a nice reply from Vladimir Dementyev about how to use pattern matching (see full gist here):
Paolo Perrotta asked for resources to catch up with Ruby:
There are so many exciting replies that I don’t know what to pick. Here is one that I did not know so far https://discord.gg/stimulus-reflex Discord channel.
Joe Masilotti asked for advice on how abstract styles when working on Tailwind. It seems the main recommendation is to not use apply and use components.
Jared White shared that he is working on a new project. More details are on The Spicy Web Discord server link to join
Emmanuel Hayford shared about Enumerable having first but not last:
Jean Boussier asked about GitHub Actions to trigger build when you push to a branch without opening a PR, but not to build twice:
There were suggested a couple of solutions:
This commit from Shopify/identity-cache
This line from test.yml from yabeda-sidekiq
The main.yml from rubyapi
Colby Swandale shared that he is working on a list of Ruby engines.
Alef Oliveira shared a piece of code adding methods on top of the Hash:
Joel Drapper shared some code samples from gems he is maintaining:
Emmanuel Hayford shared a sample of using the Ruby … syntax:
Benito Serna shared a sample code about using self for chaining methods:
Hiroshi Shibata shared they merged syntax_suggets is now part of Ruby standard library:
Read more about the discussion about merging this to Ruby here and link to the Github PR here.
Facundo Espinosa asked about how to build a design library:
Some interesting suggestions:
We have a separate gem and yes there is a prefix with the design system name (oh so fancy it has a name) - Josef Strzibny
I’m liking the idea of putting them all in a module, e.g. Components::Button because then you can use relative references for other component constants. - Joel Drapper
We use UI module for generic things UI::Modal UI::Tab and then app specific modules for things like Tasks::ListItem - Matt Swanson
Joel Drapper shared a new update for the performance improvements in Phlex:
Joe Masilotti shared a sample code with View Components + class_names + polymorphic slots:
Joël Quenneville shared how cycle from Ruby works similarly with Haskell cycle:
Colleen Schnettler shared that there might be a market for Rails themes:
On the same topic Joel Drapper shared:
Based on the replies from both these conversations there seems to be a desire for more UI libraries/projects in the Ruby/Rails world.
Adrian Marin from www.avo.cool asked a question about pains when creating UIs in Rails.
Among the mentioned pain points:
Missing UI libraries compatible with Rails
Finding talented UI developers
Working with ERB and partials
Thiago Massa created a poll about which debugger you use the most often in Ruby:
It is worth reading the discussion this poll generated and also the following discussions from what Thiago shared after the poll closed: one discussion here about preference for debugging in REPL and one here where he asked how devs are using debuggers.
Kevin Kuchta shared a funny take about the Ruby community:
Read the replies as there are interesting code examples offered there
If you read so far and you like the content, maybe you take into consideration sharing this and subscribe:
Related (but not Ruby specific)
Adrien Poly asked about recommendations on how to create a memo about what happened during the week:
He received two interesting replies:
Andrea Fomera shared a good zsh function that uses github cli to pull merged PRs
Matt Swanson suggested using “saved view in Linear that shows items assigned to me that were updated in the past 7 days...that is usually the bulk of things I've done.”
Greg Molnar shared a good picture of the advantages of automated tests:
Daniel Vassallo shared a view about skipping unit tests that triggered a lot of discussions about coding without tests:
Here is one exciting reply among many others from Cody Norman:
Postmodern shared an excellent way to think about TDD/BDD that could help define when to stop:
Edward J. Stembler shared a little code in Crystal about a Blacklist Handler that I think with just some small changes could be copied to Ruby:
Yehonathan Sharvit asked a question about accepting extra fields in request payload that triggered a wide range of replies:
Brandon Weaver shared why he thinks juniors are a critical path to healthy growth in engineering teams. Read the entire thread it is super good.
Articles and Videos
Communities
Stephan Hagemann shared a new Slack channel “ where folks are chatting about Ruby and Rails Modularity”. Join here
Hanami Mastery shared there is a Twitter community for Dry-Rb. You can join it here
Courses
Jason Swett launched his The Complete Guide to Rails Testing - Code with Jason that can come together with Video Course: Ruby DSLs Demystified.
Ruby Companion shared a new course they added to the learning topics: Rails API. See the image that explains the course topics here.
Jason Charnes shared that he is working on a new course named “Next Level Active Record”. Subscribe to get updates here.
Something to read
Newsletters
Rubyland shared that @rubylibhunt published a new Awesome Ruby Newsletter - Issue 326
Ruby On Rails shared that a new issue of This Week in Rails was published by Emmanuel Hayford → Logging, raising, and rescuing errors and a fix for a query method.
Articles
Michael Ovies shared an article about Discovering the Computer Science Behind Postgres Indexes - Pat Shaughnessy
Yukihiro Matz shared a good technical article about how YJIT works written by yTo_9 Read it here: Ruby が YJIT でなんで速くなるのか? Lazy Basic Block Versioning をサクッと理解してみた - estie inside blog (or click here for the english version link translated by Google)
Facundo Espinosa shared a new blog post written by him about Reduce ViewComponents complexity using helpers
Gomez shared an article written by them on the PlanetScale blog about How to disable Sidekiq jobs in production
Felipe Vogel shared 2 reading recommendations:
An article Sandi Metz's "four rules for developers"
A book “Five Lines of Code” by Christian Clausen
Matt Swanson shared an article they wrote about Thinking in Hotwire: Progressive Enhancement
Charles Lambdin shared a new article they wrote about Estimating Cost of Delay
Samuel Williams shared a great discussion on the Falcon Github that helps understand more about how Rails/Active Record works and their limitations Read the discussion here.
Malibu It Labs shared an article written by Benito Serna about Fetching the top n per group with a lateral join with rails
Rails Links shared an excellent article about Ruby gem installations can expose you to lockfile injection attacks | Snyk
Andrew Culver shared an old article about implementing Rails Routing Examples for Every* Crazy Combination of Nested Resource Namespacing
Something to watch or listen
Videos
Go Rails shared a new episode where Collin is doing an SQL Introduction with PostgreSQL: See it here → SQL Introduction with PostgreSQL
Timnan shared an episode about creating a chat in Rails 7: See it here → Episode 23 Turbo Powered Chat Application in Rails 7.
Cecil L. Phillip shared they released a new episode of DevChats where Chris Oliver was invited. See it here → Dev Chats - Extending Rails with Engines
Ian shared a link to a video about building your own spec: See it here → RSpec Tutorial: Build Your Own RSpec
Ernesto shared that he was a quest on the @duckiedevshow. See the episode here → Code Quality, RubyCritic & Skunk with special guest Ernesto
Drifting Ruby shared a new video walkthrough for This Week in Rails. See it here → This Week in Rails Aug 19th, 2022
Avo shared a video walkthrough of features they released in their latest release. See it here → Customizable controls on the show page, scoped search for has_many and more
Audio
Creston Jamison published a new episode of Rubber Duck Dev Show Episode 54 → Listen to it here: Open Source Experiences And The Pay Gem With Chris Oliver
Felipe Vogel shared an old podcast episode of Ruby Rogues where Sandi Metz talks about the four rules for developers: Listen to it here → Practical Object-Oriented Design in Ruby with Sandi Metz
Stephan Hagemann shared a recording from the Twitter Space about “discussion about packwerk, stimpack, code ownership, what apps we should use these tools on, and how teams can get started”. Listen to it here → Ruby@Scale. Packwerk. Gradual Modularization. How are things going?
The Ruby on Rails Podcast shared a new episode with Mina Slater. Listen to it here → Episode 431: For the Love of Consulting and the Cloud with Mina Slater
Joe Masilotti shared that he is starting to do monthly office hours. Listen here to the recording of the first session: Monthly office hours - bring your questions!
Remote Ruby shared they published a new episode where the quest was Sebastian Wilgosz. Listen to it here → Hanami Mastery with Sebastian Wilgosz
Ruby for All released a new episode about getting unblocked. Listen to it here → Getting Unblocked
New libraries and updates
Avo released a new version, 2.13.10. Read the changelog here.
Josef Strzibny shared a gem that can auto-generate models, views, controllers and routes based on Database structure: brick
Stephan Hagemann shared Gusto’s attempt at collecting a set of tools to help scale Ruby (and Rails) engineering organizations. You can find them all in Github at rubyatscale. Among the gems here (there are many):
stimpack establishes and implements a set of conventions for splitting up large monoliths built on top of packwerk.
CodeOwnership helps engineering teams declare ownership of code.
danger-packwerk integrates packwerk with danger to provide inline comments in PRs related to boundaries in a Rails application.
Nils shared about a new gem called “acts_as_nosql” - a gem to manage JSON fields as proper database fields:
Samuel Williams shared that they released GitHub - socketry/protocol-rack:
Hanami shared they release version 2.0.0.beta2: Announcing Hanami v2.0.0.beta2:
This release includes slice and action generators, middleware inspection, and conditional slice loading.
Chris Oliver shared they will be the new maintainer for sequenced gem sequenced - Generate scoped sequential IDs for ActiveRecord models:
Stephen Margheim shared they released version 0.8.0 of AcidicJob:
The focus was to bring the awaits feature to the heart of the gem and ensure it was robust.
I can honestly say that asynchronous but blocking jobs have completely changed the way I think about and architect my apps. I lean on background jobs immensely, and I orchestrate quite complex workflows with ease. But the throughput remains high. It is truly awesome.
Gomez shared the release of a new gem FastPage. You should read the article about this gem: Introducing FastPage: Faster offset pagination for Rails apps
Jeremy Evans shared the release o sequel_pg version 1.16.0. See changelog here
Jean Boussier shared that redis-rb 5.0.0 first beta is finally out. See the changelog here.
Joel Drapper shared a list of gems he is maintaining:
action_state - see code sample in this tweet
K0kubun shared a new beta release of Haml: Release 6.0.0.beta.1 · haml/haml
This was a long issue as there was a lot of great content that I discovered in Ruby community.
Please consider sharing this on social media or with your colleagues. I hope I added content for a wide range of developers (beginners to experts)
Reply