- Short Ruby Newsletter
- Posts
- Short Ruby News - Edition #54
Short Ruby News - Edition #54
Discover the world of Ruby in this comprehensive newsletter covering week 30 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
You can jump directly to a section:
š Our Community
š Projects launched
More content: š š š§ š„ āš¾ (articles, podcasts, videos, newsletters)
[Sponsorā¬]
Find, hire, and manage world-class remote developers in US time zones, pre-vetted for technical and soft skills.Visit Revelo.com to find out more.
š Our Community
š Friendly.Rb announced that tickets are sold-out:
There are still a few spots available if you want to sponsor this conference:
š Avo announced the date for the open beta:
š Rubyconftw announced CFP are open for RubyConf Taiwan 2023
š Ruby On Rails shared Rails World - 2023 ā Agenda
š Chris Oliver announced in a thread (read it on nitter) winners for RailsHackathon:
š Projects
š Avi Flombaum launched rails-starter.avi.nyc - Avi's Rails Template
š Modern Rails shared hottakes.tech
https://hottakes.tech
š Phillip Musiime announced railsinit.org - ails Initializer - Rails app generator to jumpstart your development
š Donn Felker launched listomo.com - Grow and Manage Multiple Email Lists at a Fraction of the Cost with Listomo
š Harrison Broadbent launched railsnotesui.xyz - Prebuilt ActionMailer components for Ruby on Rails
š All about Code and Ruby
š Ajaya Agrawalla shared a summary of a discussion from Webdrivers trying to load a Chrome version that doesn't exist Ā· Issue #247 Ā· titusfortner/webdrivers
šPlentiful Panda shared two recommendation for a Vim extension zbirenbaum/copilot.lua and zbirenbaum/copilot-cmp:
[Promo Contentā¬]
š£ Revelo.com has you covered: Whether you want to build a team from scratch, fill a skill or capability gap, or augment your team.
š Vidar Hokstad shared a screenshot of their editor build with Ruby using ruby-x11:
šTakashi Kokubun shared a code sample found at ruby/bootstraptest/test_proc.rb at dc54574adefe798702cc93457655da40f4939669 Ā· ruby/ruby
šStephann V. shared that destroy_all and delete_all can have different behaviors when they are called on a model or on a collection (see ActiveRecord::Associations::CollectionProxy)
šJason Garber shared lessons learned about headless Chrome and Docker:
š PaweÅ ÅwiÄ tkowski asked about recommendations of gems with YARD docs:
Here are some recommedations:
š Brad Gessler shared their config to make Phlex.fun TailwindCSS autocomplete work in Sublime Text 4 (see the config gist here):
š Avi Flombaum shared about the frontend problem in Rails:
š Brad Gessler shared they migrated fly.io documentation to Sitepress.cc
[job ad from this edition partner Revelo.com]š [Remote][Latin America] Get a full-time, long-term remote job and a dollar salary in amazing US tech companies.Apply at careers.revelo.com
š Jeremy Smith shared a thread about the Ruby Comparable mixin:
You should read the entire thread (read on nitter) where Jeremy describes the test, what failed, and how they found the cause.
š It's A&L shared a code sample showing a Rails route globbing example:
š Marco Roth shared how a memoization can speed up a lot Ruby code:
š Ruby Cademy shared a code sample about falsehoods Rubyists believe:
š Phil Smy shared a tip about optimising DB queries:
Stanislav (Stas) Katkov added:
š John Nunemaker shared a tip about using feature flags:
š Robert Pankowecki shared a code sample about monkey patching a library and adding a detection for when to re-verify the patch:
š Avi Flombaum shared a code sample about:
š Matt Swanson shared about using code comments:
There is a good conversation about adding code comments in Ruby. Here are just a few of them:
š Avi Flombaum shared a Rails code sample about how to display breakpoint when on Tailwind:
š Kevin Newton shared a code sample that uses numbered params :)
š Takashi Kokubun shared a quiz (If you plan to think about this donāt click yet to open the quiz on Twitter or Nitter as you will see the result there):
š Radoslav Stankov shared a code sample showing how to use `class` as keyword param:
š Rob Zolkos shared a tip about making systems test instead of controller tests:
He also shared a Rails repo for anyone that wants to see how this works at GitHub - robzolkos/testperformance
š Nick Bradley shared #diff method for Ruby Data classes
š Marco Roth asked about naming a variable that holds a module object:
There are some interesting proposals there. I only picked a couple of them:
š§° Gems, Libraries, Tools and Updates
š§° Masafumi Okura announced the release of version 2.4 of Alba gem - a JSON serializer for Ruby, JRuby, and TruffleRuby.
š§° Avi Flombaum announced they started to port hyperui to rails-components.com:
š§° RubyGems announced the release of version 3.4.18 of RubyGems:
š§° Piotr Murach announced the release of slideck - Present Markdown-powered slide decks in the terminal
š§° Keshav Biswa published a new gem called Seedie - a Ruby gem designed to streamline the seeding of your database. Utilizing the Faker library, Seedie generates realistic data for ActiveRecord models (check out this video for a walkthrough)
š§°Mostafa Ahangarha Dev announce a new gem bidify-rb: Add bidi support to HTML, helping to show RTL and LTR text in the correct direction regardless of the overall direction of the page
š§° Borja Garcia De Vinuesa OrdovĆ”s announced a new gem called slack_layouts - A ruby gem that introduces an easy pattern to build Slack's BlockKit layouts with ease. You can read an article about how to use it A Ruby gem to simplify using Slack Block Kit
š§° Nate Hopkins announced the release of version 0.0.12 for TurboBoost Commands
š§° Carter Bryden shared a code repo that shows how to implement custom domains for users in Rails: rails-custom-domains-example: An example repo for how to implement custom domains as a feature in a Ruby on Rails app
š§° Jeremy Evans announced a new version for Sequel 5.71.0 Released Ā· jeremyevans sequel Ā· Discussion #2067
š§° Andrea Fomera announced a new version 0.7.0 for RicherText.js
š§° Chris Oliver announced a new release for GitHub - excid3/tailwindcss-stimulus-components: A set of StimulusJS components for TailwindCSS apps similar to Bootstrap JS components.
š§° Evgeniy Demin announced a new faster version for n1_loader: Loader to solve N+1 issues for good. Highly recommended for GraphQL API.
š§° Peter Zhu announced a new version for ruby-memcheck - Use Valgrind memcheck on your native gem without going crazy
More library updates:
š§° Hexa PDF - Versatile PDF creation and manipulation library - announced the release of version 0.33.0
š§°Sinjo shared Release v4.2.1 Ā· prometheus/client_ruby
š§° Maciej Mensfeld announced a new release of karafka - version 2.1.9
Thank you for reading Short Ruby Newsletter. This post is public, so feel free to share it.
š¤ Related (but not Ruby-specific)
š¤ Adrian Oprea shared tips for improving LCP:
š¤ Jason Swett shared about planning for change:
š¤ Chris Wanstrath shared about hiring based on Github activity graph:
More content: š š š§ š„ āš¾
š Vladimir Dementyev shared a book update about Layered Design for Ruby on Rails Applications: Discover practical design patterns for maintainable web applications
š Newsletters
š Harrison Broadbent published a new edition of RailsNotes Newsletter Issue 5
š This Week in Rails published a new edition Omit webdrivers gem from new apps Gemfile, support for filtering tests by line range and more!
š Ruby LibHunt published a new edition of the š Issue 376 - Enter AnyCable v1.4: reliable real-time features for apps of any size
š Ruby Weekly published a new edition about Using Ruby in Jupyter Notebook
šļø Allison Pike published a new edition of Once a Maintainer with Julik Tarkhanov
š§ Podcasts
š§ Rooftop Ruby Podcast published a new episode As Not Miserable as You Can Be with Dave Copeland ā āDave Copeland joins to discuss writing, background jobs, service objects, and moreā
š§ Rubber Duck Dev Show published a new episode about Evaluating Tech Tools with Kora Weaver ā āIn this episode of the Rubber Duck Dev Show, we discuss some ways you can evaluate your tech stack with Kota Weaver.ā
š§ Drew Bragg published a new episode of Code and the Coding Coders Who Code It about Episode 26 - Thomas Carr ā āThis episode I'm joined by Thomas Carr. Thomas is a Consultant & Software Developer for Emerging Technologies at CGI Federal. Which is a fancy way of saying he gets to play around with all the new tech out there and see what might have real world applicationā
š§ The Rails Changelog published a new podcast about 010: Improved Active Storage docs, a new has_secure_token callback with Dave Kimura ā āDave Kimura of Drifting Ruby fame joins me to discuss the importance of Ruby on Rails documents. We talk specifically about improved documentation around Active Storage and Active Record encryption, then dive into the new callback for when has_secure_token is triggeredā
š§ Ruby Rogues published a new episode about Can you do AI /Machine Learning in Ruby? ā āLandon Gray is a Compassionate Consultant, an AI/ML Enthusiast, and a conference speaker. He joins the show to further talk about his conference topic, "AI in Ruby". He begins by explaining how he landed with the idea of using AI or ML in the native Ruby. Additionally, they dive into other Ruby projects that used AI or MLā
š§ The Ruby on Rails Podcast published a new episode about Episode 481: Advice on Sunsetting a Rails Application with Robby Russell ā āRobby Russell, CEO of Planet Argon, joins the show to guide Brittany on the steps to take to decommission a Ruby on Rails application. The pair also touch on the idea of how small dev teams would benefit from periodically bringing in "guests" to their codebaseā
š½ļø š„ Videos
Screencasts
š„ Jason Swett published a new video about Building a GPT plugin for Vim (with tests)
š„ Dean De Hart published new videos about:
š„ Drifting Ruby published a new video about Episode 412 - Intervals and Timeouts | Drifting Ruby
š„ Ruby Cademy published new videos about These 2 Techniques will CHANGE your "Blocks" Game FOREVER! and SOLID Principles in Ruby by Jim Weirich -- [RESTORED QUALITY]
š„ Tim Morgan published a new video about COMPILER FUN, DAY 12: LLVM JIT
āš¾ Articles
Whatās new
Harrison Broadbent published an article about Skipping the console with Rails Runner ā āif you're getting RSI from typing rails console all day, I've got something to show you ā rails runner. The rails runner command is a handy Rails command which lets us run commands inside our Rails console, directly from our terminalā
Avi Flombaum published a series of articles about rails-component.com They are a great exploration of what Avi is trying to solve: Rails-Components.com: What is it?, Why Ruby on Rails Needs Components, Rails Components: More Installer Over Library.
James Adam published an article about Turbo Stream and personalised content ā āEver wanted to render different content for the current user vs other users in partials being handled by Turbo? I frequently do, but I was surprised to find basically nothing online about how to do it, nothing in the official documentation and no blog posts describing it. Hereās one approach that works pretty well.ā
Jorge Manrubia published a new article about Globals, callbacks and other sacrileges ā āMaximalist positions are a thing in our industry. Take a technique, outline its drawbacks, extrapolate you canāt use it under any circumstance, and ban it forever. We are lucky that Rails embraces exactly the opposite mindset as one of its pillarsā
Jenny Shen published an article about Level up your RubyGems Account Security with Security Devices ā āWe are excited to announce that WebAuthn is fully integrated and is recognized to be the preferred choice for multi-factor authentication (MFA). When users register a security device, they will now be provided with recovery codes and be able to configure their multi-factor authentication level without needing to enable time-based one time password (OTP) MFAā
Arjit Jaiswal published an article about I like my code DAMP ā āThe problem of over-abstraction is well-documented. But thereās another problem tooā it enforces our human intuition that redundancy == verbosity == waste. And unfortunately, it leaks into both our subconscious and our linters. So, I propose a new way of thinking: DAMPā
Alkesh Ghorpade published an article about Rails 7.1 enhances PostgreSQL enum functionality ā āRails 7.1 adds enum rename, add value and rename value methods to extend its support for PostgreSQL enum typesā
I published an article about Projects ideas for learning Ruby or any Ruby web framework ā āProjects to tackle as you learn a new programming languageā
Amanda Perino published an article about Introducing the team behind the Rails World website ā āWe would like to introduce you to the team that brought the Rails World website to life. Back in April we put out a call for junior developers to create the Rails World website under the mentorship of a senior developerā
Lucas Barret published a new article about Playing with Redis and Rails ā āI will share my thoughts and idea, playing along with Redis and Ruby, Like I said less structured and maybe comments or deep dive, but I had a lot of fun writing and playing with thisā
Deep Dives
Kevin Newton published a new article about ActiveRecord::UnionRelation ā āI wrote a gem back in 2020 called active_record-union_relation, and Iām finally writing a blog post describing it. This is a very small gem that provides the ability to define Active Record relations from UNION queriesā
Akshay Khot published an article about Content Security Policy (CSP): What Every Web Developer Must Know ā āThis is a comprehensive guide to Content Security Policy (CSP). If you build websites for a living, CSP is an important concept to know, understand, and implement to protect your users from Cross-Site Scripting (XSS) Injection attacks. This post covers (almost) everything you need to know about CSPā
Aestimo Kirina published an article about Advanced Usages of Devise for Rails ā āIn this part, we'll explore more advanced usages of Devise, specifically the use of OmniAuth, API authentication, and Authtrailā
Jared Norman published a new article about Service Objects ā āI've compiled everything you need to know about when to use service objects and documented all the common variations of the pattern so that you can choose the right conventions for your projectā. He followed up with What if service objects were just Procs?
How-Tos
Harrison Broadbent published an article about Split your database seeds.rb by Rails environment ā āThe seeds.rb file makes it easy to pre-populate your database with data for development or production. Unfortunately though, since each Ruby on Rails app only has a single seeds.rb file, it can quickly get cluttered. Plus, there's bound to be data you want to seed in production, but not development (or vice-versa)ā
Nithin Bekal published an article about Ruby and Jupyter Notebooks ā āDoes Ruby have something similar to Jupyter notebooks? Turns out that you can just use Jupyter notebooks with Ruby if you setup the iruby kernelā
Matt Brictson published an article about Automate Rails deployments with GitHub Actions ā āI deploy all my Rails apps using Tomo, a Ruby command-line tool I developed. Like MRSK, Capistrano, Mina and other similar gems, Tomo orchestrates deployments by executing scripts over SSHā
Alkesh Ghorpade published an article about Normalize Data with Rails 7.1 ā āRails 7.1 adds normalizes method to ActiveRecord::Base, which can be used to declare normalization for attribute values. The method can be used to sanitize user inputs, enforce consistent formatting and clean up data from external sourcesā
BiggerPockets published a new article about Finding unused Rails view partials with DataDog and Github Actions ā āAs a Rails application matures, views gets moved around and sometimes rewritten. This opens up the possibility of dead view partials lying around: partials that are no longer rendered by any views. These unused view partials clutter up our workspace and impose a small maintenance burden. At BiggerPockets, we use DataDog and Github Actions to identify these unused partials so that they can be manually cleaned upā
Brooke Kuhlmann published a new article about Ruby Object Inspection ā This article will take a closer look at Ruby object inspection
Mike Coutermarsh published an article about How to make a Fly API call from Ruby ā āFly has a graphql API available. You can find ways to use it by looking through their CLI's source code. I recently wanted to automate a Fly API call from a ruby script. And I was not in an environment where I wanted to install the fly CLIā
Povilas JurÄys published an article about Many ways to write RSpec custom matchers ā āWhen it comes to creating custom matchers in RSpec, developers have two powerful approaches at their disposal. Each method offers distinct advantages, giving you the flexibility to tailor your matchers to your specific testing needs. In this article, we will delve into both of these approaches to equip you with the knowledge to write expressive and adaptable testsā
Mika Henriksson published a new article about Client side rate limiter ā āLong-running jobs are bad, like terrible, and should be avoided at almost all costs. Splitting the work into multiple background jobs using batches is a great idea. Now as the work ran in parallel, it finished fast! Unfortunately, it bombarded the external API with too many concurrent requests, and their API returned many rate limit errorsā
Max Normand published a new article about The Builder Design Pattern in Ruby ā āThe builder pattern, is part of the Ā«creational design patternsĀ». In summary it simplifies the processes of creating complex objects. We create a builder class that should have everything we need to help ease the complexities around creating our objectsā
Kaka Ruto published a new article about Uploading Files to CloudFlare R2 Using Rails ActiveStorage ā āR2 is a new object storage system by Cloudflare. It is comparable and compatible with Amazon S3, except much simpler and cheaper, and with a very generous free plan. You can read more about it here. Let us see how to set it up with Rails so we can upload files for this articleā
Julian Rubisch published a new article about Understanding Rails Apps Through Powerful Visualizations ā āWhen it comes to reviewing a Rails app, two essential factors stand out: discoverability and good visualization of the code structure. Being able to comprehend the core elements and potential threats of a Rails app is crucial for developers and stakeholders alikeā
William Kennedy published a new article about Tidy Up Your Views with Request Variants ā āWhen I gave my recent Turbo Native talk for Ruby Ireland, one of the questions that came up repeatedly was about duplicating views for both native and Rails. I got many questions asking if I have āif-elseā logic in my views to accommodate mobileā
Brandon Keepers published an article about Switch ActiveJob backends without disruption ā āEarlier this year, we helped a customer migrate their Rails application to a new ActiveJob backend. As with most applications, their background jobs performed critical workloads, like emailing users, communicating with external services, and keeping things tidy. Even a momentary blip in background job processing can quickly become a user-facing issueā
Related
Birgitta Bƶckeler published a new article about Exploring Generative AI ā āGenerative AI and particularly LLMs (Large Language Models) have exploded into the public consciousness. Like many software developers I am intrigued by the possibilities, but unsure what exactly it will mean for our profession in the long run. I'll be posting various memos here to describe what my colleagues and I are learning and thinkingā
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