

Discover more from Short Ruby Newsletter
Short Ruby News - Edition #47
Discover the world of Ruby in this comprehensive newsletter covering week 24 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
You can jump directly to a section:
π Our Community
πΒ All about Code and Ruby
π§°Β Gems, Libraries, and Updates
π€Β Related (but not Ruby-specific)
More content: π π π§ π₯ βπΎ (articles, podcasts, videos, newsletters, books and slides)
πΈ For only $1.5 per week (just $6.5 a month), you can become a paid subscriber and contribute to the success of the flourishing Ruby community we all adore while receiving an ad-free version of the newsletter!!
π Our Community
π Friendly.RbΒ announced a new speaker:Β Ayush Newatia - Use Turbo Native to make hybrid apps that donβt suck:

π Last week Stack Overflow survey results were out, creating some discussion in our community. Here is for example, two of the discussions about it:




π Jason SwettΒ announced new speakers forΒ Sin City Ruby - Las Vegas Ruby Conference


π Southeast RubyΒ announced a new Ruby Conference in 2024 Β Subscribe for updates at southeastruby.com

π Ruby ConfΒ announced the tickets are on sale forΒ Rubyconf - get them at rubyconf.org

π Nick SchwadererΒ announced a new Hackathon for scarpe

π Wroclove.RbΒ announced a new speaker:

π Adrien PolyΒ launched a new project calledΒ rubyvideo.dev to βaggregate all Ruby-related videos in one place with searching capabilities to facilitate discovery.β The project is open-source at adrienpoly/rubyvideo

π All about Code and Ruby
πͺ§ Have you considered inviting your company to sponsor this newsletter? If you are using Ruby on Rails, I think your company is a perfect fit :)
You can send the sponsorship packages info to your marketing, HR, or product management teams.
I'm happy to assist you with drafting an email. Send me a message at hello@shortruby.com I'll do my best to draft an email for you to send inside your organization.
πMatt SwansonΒ shared a screenshot from a discussion in Github about Strada where it seems that David Heinemeier Hansson announced that Strada will be launched at Rails World and presented by Jay Ohms:

π Joel DrapperΒ shared a perspective about thinking about types in Ruby:

Noah GibbsΒ replied, but I invite you to read the entire conversation about checking and testing:

π Kuba SuderΒ shared a piece of Ruby metaprogramming for defining a custom Sinatra logger:

π AristΓ³teles CoutinhoΒ shared a code sample showing pattern matching with types in an initializer:

π Nate BerkopecΒ shared that Gusto did not see a performance improvement after upgrade to YJIT:

Jean BoussierΒ shared that they see performance improvements at Shopify:

π Andrew HodsonΒ shared a code sample showing Rails 7.1 Comparison Validator:

π Ruby CademyΒ shared a code sample showing the difference between not
and !@

Drew BraggΒ replied with an explanation about how not
works:

π DavidΒ shared how to configure View Component to raise errors on deprecations in development and test environments, specifically on slot_name syntax:

πCollinΒ sharedΒ a code sample from Forgive Us Our Sends about join that does not need flatten called before:

πMatt SwansonΒ shared a code sample showing how they work with Form Builder in Rails in a discussion about how to make Form Builder more flexible:



Brad GesslerΒ also shared about improving form builders:

π Marc KΓΆhlbruggeΒ shared a code sample showing how to add a validator to Rails and filter disposable emails:


π Marco RothΒ shared a browser console warning with did you mean message:

π Kevin NewtonΒ shared that YARP docs got better and invited people to contribute atΒ ruby.github.io/yarp

π Jason ZimdarsΒ sharedΒ a video (click to see the video embedded in tweet) showing an exploration of using View Transitions API - Web APIs in Hey

π Andrew HodsonΒ shared about the Object#presence added by ActiveSupport in Rails:

π IΒ shared a quote from Sandi Metz about code design:

π Marc KΓΆhlbruggeΒ shared the list of gems they are using forΒ Room AI

Here is the shared list with Mark notes:
rails - obviously
puma - server of choice
pg - postgres ftw!
turbo-rails - interactive apps without JS
stimulus-rails - if I need to write JS after all
importmap-rails - sane way to deal with JS deps
tailwindcss-rails - sane way to deal with CSS
sidekiq-ent - advanced background processing
http - best gem for making http requests
pay - easy stripe integration
authentication-zero - devise without the headache
heroicon - icons by tailwindcss team
haml-rails - easier to write than HTML
replicate-ruby - run AI models
omniauth - for Google/Apple sign in
dry-initializer - simplify initializers
rqrcode - generate QR codes
strong_migrations - dont mess your DB
notable - track of weird requests
blazer - business analytics
pghero - fix DB performance
lograge - make your logs more useful
neighbor - similarity search w/ pgvector
memoist - easy memoization
pagy β fast pagination
ahoy_matey - self-hosted analytics
ahoy_email - email analytics
bcrypt - secure passwords
active_storage_validations - self-explanatory
premailer-rails β inline your email CSS
bugsnag - bug tracking
skylight - performance monitoring
cloudflare-rails - fix request.remote_ip on cloudflare
letter_opener - preview what emails look like
factory_bot_rails - fixtures but nice
faker - generate fake data for tests
mocha - mocking/stubbing for minitest
hotwire-livereload - reloads browser
cuprite - headless chrome for tests
πRuby CademyΒ shared a code sample showing the difference between safe navigation operator and try:

π Nick SchwadererΒ shared a preview of a new Ruby desktop app:
π Mario SchΓΌttelΒ shared a code sample about building a Boolean Validator in Ruby on Rails:

π€ I imagine that if you have read this so far, you find value in this newsletter.
π§° Gems, Libraries, Tools and Updates
π§° Peter ZhuΒ announced that they open-sourced the Ruby builds they use at Shopify. Read more at Open Sourcing Shopifyβs Ruby Builds and project is at Shopify/ruby-definitions

π§° Rubymine published a new Early Access Preview 2023.2 EAP 4. This release has:

π§° Samuel WilliamsΒ announcedΒ that Rails 7.1 will work with Rack 3 Read the entire PR that groups all work needed for this

π§° Peter Zhu submitted a PR to Ruby about Remove transient heap:
π§° Truffle RubyΒ announced a new release of Truffle Ruby 23.0 and a new distribution called Oracle GraalVM under GraalVM Free Terms and Conditions (GFTC) licenseΒ that seems to be βfree for development and production useβ:

π§° Mike PerhamΒ published a new update for SidekiqΒ version 7.1.2 Read the changelog
π§° Kirill PlatonovΒ announced a new release of polaris_view_components that upgrades Polaris 10 to View Component 3Β Read the release notes
π§° Andrea RoccaΒ shared a gem they were happy discovering called query_diet:
π§° Jeremy EvansΒ announced a new release ofΒ Roda 3.69.0 Released Β· jeremyevans roda Β· Discussion #325
π§° Konnor RogersΒ sharedΒ a gem they discovered called isorun: Run JavaScript applications in your Rails application. Here is the list of features:

π§° Petrik De HeusΒ announced a fork of motion-turbolinks atΒ p8/motion-turbo-ios: Turbo Native iOS for RubyMotion apps

π§° Alex LionΒ announced a new release forΒ alxlion/eyeloupe: The elegant Rails debug assistant - Read changelog for 0.3.0
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody while receiving an ad-free version:
If you consider upgrading and want more information, please read Why to subscribe to paid
π€ Related (but not Ruby-specific)
π€ Jason SwettΒ shared about testing:

π€ Chris WanstrathΒ shared about how Github readme for an empty repo was created:

π€ Alex LionΒ shared about moving out of PaaS to bare metal.

Before making this change I think it will be great if you read also this article 11 years of hosting a SaaS by Alex Ghiculescu.
More content: π π π§ π₯ βπΎ
π Books
π Jason SwettΒ shared a small introduction for his new book about ChatGPT:

π Newsletters
π Sara Jackson published a new edition of This Week in Open Source (June 16, 2023) - βIn the past week we saw updates to Art Vandelay, Administrate, Shoulda Matchers, and our dotfiles.β
π Ruby WeeklyΒ published a new edition about Exciting developments in Ruby parsing
π Allison Pike published a new edition of Once a Maintainer: Josh Branham - βcontributor to the popularΒ attr_encrypted gem and the person who made it compatible with Rails 7β
πAny CableΒ published a new edition of Any Cables Monthly #10
π Greg MolnarΒ published a new edition ofΒ Active Record Transactions - Rails Tricks Issue 10
π ZzakΒ published a new edition ofΒ This Week in Rails - June 16, 2023 - βTighter security with SSL enabled as a default in production, expanded PostgreSQL enum support, and moreβ
π Ruby Radar published a new edition Father's Day 2023 Edition
π§ Podcasts
π§ Jason SwettΒ published a new episode of The Code With Jason Podcast aboutΒ 185 - Test Suite Performance with Vladimir Dementyev
π§ The Ruby On Rails PodcastΒ published a new episode aboutΒ Episode 474: Ship to Learn (Github and AI) with Kyle Daigle
π½οΈ π₯ Videos
Talks
π½οΈ FastRuby published a video and the slides for the workshop Fortify Rails - Defending Your Ruby on Rails Applications from Bad Actors
π½οΈ Creston JamisonΒ published a new episode of Rubber Duck Dev Show aboutΒ Palantir & Testing in Dragon Ruby with Kevin Fischer
π½οΈ Nick SchwadererΒ published a video where Noah Gibbs does a Walkthrough of the Scarpe framework code
π½οΈ Samuel WilliamsΒ shared they updated their YouTube playlist aboutΒ Ruby Async Presentations
Screencasts
π₯Β Β Yaroslav ShmarovΒ publishedΒ a new video aboutΒ Rails 7Β #135Β Export videos from ANY Youtube channel using Youtube API
π₯Β Β Dean De HartΒ published a series of videos:
Thredded Gem for Forums (Reddit Clone) | Ruby on Rails 7 Tutorial
Private Gem Repositories in your Gemfiles | Ruby on Rails 7 Tutorial
π₯ GoRails published a new video about Adding a Highlight Button to Trix
π₯ Hanami MasteryΒ published a new video aboutΒ Send emails with hanami-mailer
π₯ Pete HawkinsΒ published a small video on Twitter about using Modules
π₯ Dr Nic WilliamsΒ published a video aboutΒ 80% users want Dark Mode - How to add to Jumpstart Pro
βπΎ Articles
Whatβs new
Nate Berkopec published an article about How We Made Gusto Page Loads 40% Faster: βFor businesses with 25 or more employees, pages load 1.4 times faster. After loading gusto.com for the first time, navigations in Gusto are 2 times faster. For smaller businesses, page loads are 1.2 times faster, and all navigations after the first are now 1.8 times faster. Gustoβs internal customer support tools are faster, too: 30% faster than a year agoβ
Nicholas Van Doorn published an article about Reducing Solidus Memory Usage with jemalloc βThis post aims to discover if improving performance is possible without changing any code or adding extra costs to our production infrastructure. We will test the jemalloc project on a production Solidus store to see if we can improve some memory usage issues without negatively impacting response timeβ
Kevin MenardΒ published an article announcing thatΒ TruffleRuby in Shopify CI βIβm happy to say our internal CI system recently added support for TruffleRuby in both release and snapshot builds. We utilizeΒ ruby-buildΒ to handle the installation, enabling us to use TruffleRubyβs published snapshot builds instead of waiting for the interpreter to be compiled from sourceβ
Alessandro RodiΒ published a new article aboutΒ Rubyday 2023 - A great come back!
How-Tos
Hanami Mastery published an article about WIP: Unofficial guide for upgrading Hanami 1.x -> Hanami 2.x βThis is an unofficial, community-maintained guide to help upgrading projects that are built on Hanami 1.x to Hanami 2.xβ
Matt Brictson published an article about Applying a Rate Limit inΒ Sidekiq βI discovered an easy way to implement job throttling using the ruby-limiter gem and the new βcapsulesβ feature of SidekiqΒ 7β
Akshay KhotΒ published a new article about Practical Stimulus: How to Toggle CSS Classes βThis second article in the 'Stimulus in Practice' series shows how you can work with HTML classes using Stimulus. Specifically, we'll learn how to toggle classes on an element. This is useful when you want to show or hide certain elements or update the design in response to user interactionβ
Benito SernaΒ published a new article aboutΒ A form with two buttons with formation and formmethod βImagine that you are building a custom CMS. Within the form to edit anΒ Article
, you need to have two buttons: a normal βSaveβ button and a new βSave and publishβ button. And maybe, additionally, you will need a third button to delete the articleβ
Greg MolnarΒ published an article aboutΒ Deploying a Rails app with MRSK βIn this tutorial, I will show you how to: deploy a Rails app to a VPS, run Caddy in front of the docker container to handle SSL, use a hosted database server, run Redis on the same droplet, run a worker to process background jobsβ
Julian RubischΒ published a new article aboutΒ Setting Up Business Logic with DCI in Rails βwe will introduce another alternative that more naturally fits the mental models we apply when reasoning about the behavior of our applications: DCI (Data, Context, Interaction) for Railsβ
MafulΒ publishedΒ a new article aboutΒ How I use Nano ID in Rails βNano ID is a tiny, URL-friendly, and unique string ID generator. Nano ID is a library for generating random IDs that still have probability of duplicate IDs. However, this probability is extremely small and it is based on the rules you definedβ
Deep Dives
Akshay KhotΒ published an article about Blocks, Procs, and Lambdas: A Beginner's Guide to Closures and Anonymous Functions in Ruby βClosures and anonymous functions are very useful concepts, especially in functional programming. Ruby makes working with them a pleasure via its flavors like blocks, procs, and lambdas. This post provides an in-depth tutorial and shows the subtle differences between themβ
Kevin NewtonΒ published an article aboutΒ Rewriting the Ruby parser βAs of the date of this post, YARP can parse a semantically equivalent syntax tree to Ruby 3.3 on every Ruby file in Shopifyβs main codebase, GitHubβs main codebase, CRuby, and the 100 most popular gems downloaded fromΒ rubygems.org. We recently got approval to merge this work into CRuby, and are very excited to share our work with the community. This post will take you through the motivations behind this work, the way it was developed, and the path forwardβ
JuliΓ‘n PinzΓ³nΒ published a new series of articles aboutΒ Unlocking the power of forms in Rails, Diving Deep: Action View Form Helpers, The Potential birth of AttributeBuilders
Related
I published two new articles: Why write technical content on a blog and not only on social media and A simple idea of how to grow the Ruby community
Richard Schneeman published an article about What is github.com/zombocom and why most of my Ruby libraries there? βThe other day I got another question about the zombocom org on GitHub that prompted me to write this post. This org, github.com/zombocom, holds most all of my popular libraries). Why put them in a custom GitHub org, and why name it zombocom? Letβs find out.β
Jorge ManrubiaΒ published an article aboutΒ Remote struggles βThe failed experiment wasn't remote work but rewiring your company from the ground up. That makes for a less clickable headline, though, and is probably a harder pill to swallow for the people running the showβ
Vadim Demedes published an article aboutΒ Generating income from open source
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). 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.