Short Ruby News - Edition #56

Discover the world of Ruby in this comprehensive newsletter covering week 34 and part of week 33 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.

You can jump directly to a section:

šŸ‘ Our Community: šŸš€New Products & šŸ“… Events

Friendly.rb conference is on September 27-28 in Bucharest, Romania. Tickets are already sold out! šŸ‘However, you can still show your support for the conference and market your products to a Ruby audience by becoming a sponsor for just $1250 (and get a conference ticket included).For more information, visit friendlyrb.com/sponsor or write an email to [email protected] Our community would greatly appreciate your support!

šŸ‘ Our Community

šŸš€New Products & šŸ“… Events

šŸ“… Euruko announced the list of spearkers for Euruko 2023, starting with the keynote speaker:

šŸ“… Prathamesh Sonpatki announced that RubyConfIN schedule is public:

šŸ“… Ruby On Rails announced the speakers, starting with Rails World - 2023 ā€” Aaron Patterson

šŸ‘‰ All about Code and Ruby

šŸ‘‰ Maciej Mensfeld shared a code sample showing how to use the latest Karafka release:

šŸ‘‰ Collin shared about starting new IRB sessions from current session:

šŸ‘‰ Josef Strzibny shared a code sample showing how to load overrides:

šŸ‘‰ Greg Molnar asked from a security perspective what could go wrong with executing this code:

He also provided a possible solution:

šŸ‘‰ Matt Swanson shared about organising features by modules in Rails:

He provided a more complete code sample:

šŸ‘‰ Emmanuel Hayford shared a code sample of a feature that will be present in Rails 7.1

If you want you can read the PR here

šŸ‘‰ Matt Swanson shared another code sample about chaining Active Record relations:

šŸ‘‰ Jeremy Smith shared a code sample showing how to Rendering Markdown with Multiple Modes

And if you want to see how this can be used Marco Roth shared a PR for gem.sh where they applied this idea here.

šŸ‘‰ Ruby Cademy shared quick ways to replace a hash key:

šŸ‘‰ Matt Swanson shared about using Association Extensions:

You can read here from the Rails guides about this feature.

Rob Lacey shared another code sample about how they used this:

šŸ‘‰ Prabin Poudel shared a code sample about column_names in Rails:

šŸ‘‰ Matt Swanson shared a code sample showing how to test multi-user flow with Capybara and Rails:

šŸ‘‰AristĆ³teles Coutinho shared two code samples about how to split date:

šŸ‘‰Nate Berkopec shared an advice about background jobs:

šŸ‘‰ Marco Roth shared speed improvements for gem.sh after using YARP (you can read the PR here)

šŸ‘‰ Nate Berkopec shared an advice about setting timeouts:

šŸ‘‰ Donn Felker shared a tip about testing Sidekiq

šŸ‘‰ Harrison Broadbent asked about testing frameworks.

You should read the replies (nitter link) as there are is a healthy debate abour RSpec and Minitest. Here are some of them:

šŸ‘‰ Koichi Sasada shared a performance benchmark for MaNy project (supporting massive number of threads in Ruby):

šŸ‘‰ Matt Swanson shared a code sample about using Hash#fetch:

šŸ‘‰ Nate Berkopec shared about how Active Record is doing many things:

Xavier Noria replied with how to think about Active Record:

šŸ§° Gems, Libraries, Tools and Updates

šŸ§° Ruby on Rails published a new release 7.0.7.2 and 6.1.7.6 that fixed a security issue:

šŸ§° Jeremy Evans announced a new version of Rodauth 2.31.0 Released Ā· jeremyevans rodauth Ā· Discussion #362

šŸ§° Kevin Newton announced a new version of YARP. Read the full changelog here

šŸ§° Vinicius Stock announced a new version for ruby-lsp ā†’ Release v0.8.1 Ā· Shopify/ruby-lsp

Thank you for reading Short Ruby Newsletter. This post is public, so feel free to share it.

šŸ¤ Related (but not Ruby-specific)

šŸ¤ Donn Felker wrote about tests:

šŸ¤ Jason Swett shared about codebase quality:

He also shared about testing and locked in:

šŸ¤ Siqi Chen shared that culture, taste, and craftsmanship are irreplaceable and cannot be compensated for through strategy, process, or quality assurance:

More content: šŸ“š šŸ—ž šŸŽ§ šŸŽ„ āœšŸ¾

šŸ—ž Newsletters

šŸ—ž Wojtek published a new edition of This Week in Rails - August 25

šŸ—ž Awesome Ruby Newsletter published a new edition Issue 379 - Flipper 1.0 - One Point Oh!

šŸ—ž Greg Molnar published a new edition of Rails Tricks Rails upsert - Tricks Issue 16

šŸ—ž Allison Pike published a new edition of Once a Maintainer: Robby Russell

šŸŽ§ Podcasts

šŸŽ§Drew Bragg published a new episode of Code and the Coding Coders Who Code It: Episode 27 - Andrew Atkinson ā†’ ā€œPostgreSQL wizard Andrew Atkinson joins the show to discuss his new book, "High-Performance PostgreSQL for Rails." Andrew talks about the challenges of writing a database book for Rails developers, refactoring prose, and the importance of maintaining a work-book-life balanceā€

šŸŽ§ Content For :Devs published a new episode about #010 Advanced Ruby with Jeremy Evans - content_for :devs ā†’ ā€œIn this episode, we're digging into the Roda framework, and behind the scenes of maintaining super popular Ruby gems on the professional levelā€

šŸŽ§ Remote Ruby published a new episode about Ain't Your Callback Girl ā†’ ā€œIn this episode, Chris, Jason, and Andrew engage in a discussion revolving around the functionality and nuances of generated columns, callbacks, and coding practices in database and Rails applications. They explore the benefits and challenges of these features, and they dive into the complexities of coding testsā€

šŸŽ§ The Ruby on Rails podcast published a new episode about Level Up in Learning with Ariel Fogel ā†’ ā€œAriel Fogel is a software engineer with an enduring soft spot in his heart for Ruby and Rails. Since graduating from Dev Bootcamp, he has found himself driven by finding ways to improve the quality of education for coders and non-coders alike. Brittany and Ariel discuss how engineers can level up in how they learnā€

šŸŽ§ Jason Swett published a new podcast about 193 - Amanda Perino, Executive Director of The Rails Foundation ā†’ ā€œThis week I'm joined by Amanda Perino, Executive Director of the Rails Foundation. We discuss the upcoming Rails World conference in Amsterdam on October 5th & 6th. We also discuss what makes for a great conference experience, learning new languages and studying abroad, cultural differences between the US and Europe, and what's new at the Rails Foundationā€

šŸ“½ļø šŸŽ„ Videos

šŸ“½ļø Rubber Duck Dev Show published a new episode about Starting a Business With Kota Weaver

Screencasts

šŸŽ„ Kasper Timm Hansen published a new video about Extending Rails (Gently) (Example) | GoRails

šŸŽ„ Yaroslav Shmarov published new videos about:

šŸŽ„ Dean De Hart published new videos about:

āœšŸ¾ Articles

Whatā€™s new

Kevin Murphy published an article about Keeping Up With Ruby News All Week Long ā†’ ā€œI read a lot of Ruby news throughout the week. When someone asks me what they should follow, I first suggest that they not follow exactly the same blogs I doā€

Rafael PeƱa Azar published a new article about Empowering Ruby in the World of Machine Learning ā†’ ā€œthis is a new one in my now called "Ruby is waaaay more than web development" article series, in which I'm trying to raise awareness in the community that the Ruby language covers a lot more ground than just Web Development and its relation to the RubyOnRails framework. In this post we'll talk about Ruby and Machine Learningā€

John Nunemaker published an article about Flipper 1.0 ā†’ ā€œI love Flipper. I want to work on it more ā€“ all the time. So that's why some great friends and I are turning it into a business. We helped build a lot of cool internal dev tools (at GitHub and elsewhere) and we want to unleash them on the world ā€“ starting with Flipperā€

Emmanuel Hayford published an article about Secure Your Ruby App with JSON Web Tokens ā†’ ā€œSecuring a web application can mean several things. In this post, we'll discuss a subset of web security that involves authentication using JSON Web Tokens (JWTs) and the Ruby on Rails web application frameworkā€

Prasanth Chaduvula published an article about Open Ranges Are Now Supported By The Object#in? Method In Rails ā†’ ā€œIn the upcoming version of Rails, it is possible to check if a date is present in an open date range with Object#in?ā€

Alkesh Ghorpade published an article about Rails 7.1 adds support for Array#intersect? to ActiveRecord::Relation ā†’ ā€œRails 7.1 added support for the Array#intersect? method to ActiveRecord::Relation objects. This means that you can now use the intersect? method to check if two ActiveRecord relation objects have any common elementsā€

Matt Brictson published an article about Speed up your default Rake task with the multitask -m option ā†’ ā€œI recently discovered that Rake has the ability to run tasks in parallel. For Rails projects with many test and linting tasks, this can be a huge time-saverā€

Josef Strzibny published an article about Verifying Paddle Billing webhooks with Rails ā†’ ā€œPaddle recently made a major overhaul of its offering and API. If you need to validate the new Paddle Billing webhooks in Rails, hereā€™s how to do itā€

Deep Dives

Mohit Sindhwani published a new article about Ruby Learning by Reversing: Native Gems, Part 5 ā†’ ā€œThe first series of Learning by Reversing examines a Ruby native gem to understand how it works. Part 5 digs looks at the C code needed to interface with the Ruby codeā€

Lucas Barret published an article about ActiveRecord Internals : You are not ready for this ā†’ ā€œThis article will demystify Rails by looking deeper into the Rails active record association internalsā€

Ivo Anjo published an their presentation and associated slides about about understanding the ruby global vm lock by observing it ā†’ ā€œThe GVL is an extremely important implementation detail, as it can have a big impact on the performance and responsiveness of any Ruby application that uses more than a single thread to do its workā€

Steve Polito published an article about A pragmatic guide to building a Rack application from scratch ā†’ ā€œUntil recently, I didnā€™t really understand what Rack did. I knew it had something to do with Rails, but I was never in a situation where I needed to use it directly. Not only that, but I realized that I didnā€™t actually know how to make a server-side web application from scratch because I had become so dependent on Railsā€

Brad Gessler published an article about Organic Test Driven Development ā†’ ā€œTest-driven development sounds like a really ā€œheavyā€, dogmatic way of building applications, but it can be surprisingly organic and lightweight starting with ā€œdoes it run?ā€ as the first test, followed by more formal unit test verificationā€

Jeremy Friesen published an article about Testing a Method Outside of the Application Test Suite to Speed Up Iterations ā†’ ā€œSeveral of those code repositories are applications that run in Docker containers. Their test suite is written in RSpec. That pernicious auto-require of rails_helper means that all invocations of RSpec will boot the entire Ruby on Rails application. Which does not create conditions for fast iterationā€

How-Tos

Harrison Broadbent published two articles about A simple Stimulus Tabs Controller ā†’ ā€œIf you're after a simple Stimulus controller to handle tabs in your Ruby on Rails app, look no further. This controller handles toggling between multiple tabs, choosing a default tab, and adding CSS classes to the corresponding buttonā€ and Add a favicon to your Rails app in 2 minutes

Mario Alberto ChĆ”vez CĆ”rdenas published an article about Working with Rails Engines, Importmap and TailwindCSS for assets ā†’ ā€œRails 7 introduced CSS and JS bundling, along with the Propshaft gem to manage and serve assets. Also, introduced Importmaps and TailwindCSS as options for not having Node as a dependency, but in both cases without any official word on how to make these work with enginesā€

Akshay Khot published an article about Practical Stimulus: Building a Counter Component ā†’ ā€œIn this article, we will build a counter component using the Stimulus JavaScript library. This simple example will demonstrate a bunch of useful features of Stimulus such as managing state, handling events, and targeting DOM elementsā€

Ben Sheldon published an article about How to isolate I18n configuration in a Rails Engine ā†’ ā€œInternationalizing GoodJob has been a fun creative adventure. I hope that by writing this that other Rails Engine developers prioritize internationalization a little higher and have an easier time walking in these footsteps. And maybe weā€™ll make the ergonomics of it a little easier upstream tooā€

Ryan Bigg published two articles about Alpine Linux, Selenium Manager, Chrome and ChromeDriver and Ubuntu, Ruby, Selenium Manager, Chrome and ChromeDriver ā†’ ā€œSelenium, and by extension the selenium-webdriver gem, after version 4.11 come with a new feature called Selenium Manager. This CLI tool will automatically install whatever browser and driver you need to run your Selenium testsā€

Josef Strzibny published an article about Overriding Rails engines models and controllers ā†’ ā€œIf youā€™ve ever worked with a Rails engine, you might have come to a moment you needed to quickly override something. But do you know how to override the engine application files from within your Rails application?ā€

Sid Krishnan published an article about How to use React just on one page in a Rails app ā†’ ā€œHaving had experience with React, you wonder if it is possible to use React just where it is needed, for your new feature, and continue to use plain old ERB and JS (Stimulus) everywhere elseā€

Related

Jon Sully published an article about How to Fix Heroku's Noisy Neighbors ā†’ ā€œIf you've had any kind of production-tier application running on Heroku with a moderate (or higher) level of traffic for the last several years, you've probably experienced Heroku's noisy neighbors issuesā€David Bryant Copeland published an article about Getting 'Save to Home Screen' to Kinda Work on iOS ā†’ ā€œiOS has a feature on any website called ā€œSave to Home Screenā€, which creates an icon that then goes to that site. If you craft your website a certain way, this will launch the site in an app-like mode that is often referred to as a ā€œProgressive Web Appā€ or PWA. This post will document exactly what you need to do, because itā€™s not documented very wellā€

Jim Nielsen published an article about Reloading a Document (and Preserving Query String Parameters) Using Only HTML ā†’ ā€œThe other day I was trying to write some HTML to give the user the ability to reload the document in its exact state by clicking on a link (same functionality as if they hit CMD + R on their keyboard, or clicked ā€œreloadā€ in the browser UI)ā€

Victor Bogo published a new article about Prometheus metrics at 37signals ā†’ ā€œIn this blog post, I will share more about how we use Prometheus to properly ingest, store, and alert based on metrics in a way we can confidently migrate and manage infrastructure and applications on-premā€

Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month) and you will receive an ad-free version. 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.

Reply

or to participate.