Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Blogs on Noel Rappin Writes Here 

#Better Know A Ruby Thing: Singleton Classes

It is time to Better Know what is perhaps the Ruby-iest of Ruby things, a feature that didn’t even have an official name for several years, despite being critical to Ruby’s Object-Oriented semantics. (It only just now occurs to me that there was no official name in English, I wonder what the Japanese name for it was…).

Yes, it’s the singleton class.

Which isn’t really a singleton. Or really a class. It is the “grape-nuts cereal” of Ruby features.

The singleton class has been known by other unofficial names over the years. It’s been called a “metaclass” although technically it is not a metaclass, it has been called an “eigenclass”, a name I always favored because nobody knows what an…

Short Ruby Newsletter 

Short Ruby Newsletter - edition 119

The one edition where Active Record Search is announced along with Ruby 3.3.7
RichStone Input Output 

Tandem Coding on Your Rails Project

🫵
What do you think about shipping your side project in 3 months by pairing on it with someone on a daily/weekly basis?
Tandem Coding on Your Rails Project

So the rough idea is: One day we pair on your side project, the other day on my side project.

The ideas comes from language exchange "tandems", where both people want to learn the language that the other person is a native in. They speak the different languages in alternation. This is the same, but just in the coding and product space where you synergize to create a software product. (though, I guess it could also work nicely if two coders actually exchanged their programming language experience, like one person knows Python and the other Ruby)

How

  • It's free, apart from the…
Tim Riley 

Hire me!

After 15 years at Buildkite, Culture Amp and Icelab, I’m available for hire!

I’m an effective, versatile and compassionate technical leader, and an accomplished Rubyist. I’m looking for remote Principal Engineer or Staff Engineer roles, at 4 days/week.

Why am I looking now? This year I’m making a big change! I’ll be dedicating a day a week to Hanami development (more on funding this in a future post). I’m looking for a workplace that I can commit to alongside this endeavour. You’ll get the absolute best from me over 4 days/week.

I’m available to join your product or tooling teams and help your business and engineering organisation…

Hotwire Weekly 

Week 03 - Hotwire Webinar, Reflecting on React To Hotwire Migration, and more!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

Welcome to another issue of Hotwire Weekly! Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Webinar: From React To Hotwire - Maciek Korsan from Arkency is hosting a webinar on January 30, 2025, at 5 pm CET (11 am EST). The session will explore transitioning from React to Hotwire in Rails applications, addressing challenges, simplifying frontends with Turbo Frames and Stimulus, and translating React patterns to Hotwire. It will also be live-streamed on YouTube.

Moving on from React, a Year Later - Kelly Sutton of Scholarly reflects on the transition from React to a server-rendered architecture using Rails and Stimulus. He highlights that this shift has led to…

justin․searls․co - Digest 

🎙️ Breaking Change podcast v29 - Super Switch

Direct link to podcast audio file

In this episode: Justin goes to a birthday party, drives a Tesla, and configures your BIOS.

The compliments department is, as always, available at podcast@searls.co.

Have some URLs:

Transcript:

[00:00:29] Well, good morning, everyone. If it's evening, where you are, well, it's not here.…
a-chacon 

Mark Zuckerberg said: It’s time to go back to our roots and use RSS

Just kidding, what he really said is:

It’s time to get back to our roots around free expression.

But, is it really true that he advocates for freedom of expression? I don’t believe it. Here we already have examples that this freedom of expression is not for everyone:

In my opinion, this freedom of expression he talks about will only be used to manipulate users’ biases by spreading fake or altered news with political and economic agendas. We’ve already seen Musk doing his thing with X (formerly Twitter), and now Zuckerberg is starting…

But my post isn’t…

Remote Ruby 

Inside Ruby 3.4

Welcome to the first episode of the new year where Chris and Andrew discuss their holiday activities and recent breaks from work, including travel experiences and Christmas celebrations. They delve into updates on Ruby and Bundler enhancements, and they emphasize the importance of Ruby Central’s role in maintaining Ruby's security. The conversation also touches on various tech and entertainment topics including movie reviews, gaming experiences, and smart home projects with Raspberry Pi. The hosts share insights on JSON gem performance improvements and considerations for Ruby's frozen string literals. The episode concludes with discussions on practical applications for Home Assistant and…

RubyMine : Intelligent Ruby and Rails IDE | The JetBrains Blog 

The RubyMine 2025.1 Early Access Program Is Open!

Hello everyone!

We’re starting this year off with the opening of the RubyMine 2025.1 Early Access Program. In this blog post, you’ll find details about the new features and improvements we’ve been working on.

What’s coming in RubyMine 2025.1?

AI Assistant

The 2024.3 release introduced enhanced cloud-based completion for Ruby code. The upcoming release will expand that support to related technologies like RBS and ERB, offering faster, more context-sensitive completion and enhanced quality, as well as support for multiline completion.

We’re also implementing inline AI prompt functionality for those same technologies. This means you’ll be able to submit natural language…

Ruby on Rails 

Fresh Rails apps Dependabot updates reduced to weekly, and Auth generator gets a safer logout

Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase.

Reduce the frequency of Dependabot updates in new projects.
This changes frequency of Dependabot updates from daily to weekly for freshly generated Rails apps.

Authentication generator’s SessionsController clears browser cache at logout
On logout the SessionsController#destroy action sets a “Clear-Site-Data” header to clear the browser cache. This is in order to prevent possible data leakage after logout via the browser’s “back/forward cache”.

Fix inconsistency between “delete_all” & “update_all” allowed methods
After this change, trying to call update_all with distinct or a CTE (with, with_recursive) is deprecated…

Enable…

Awesome Ruby Newsletter 

💎 Issue 452 - A simple trick to understand Ruby’s lazy enumerator

ruby – Bibliographic Wilderness 

Using CloudFlare Turnstile to protect certain pages on a Rails app

I work at a non-profit academic institution, on a site that manages, searches, and displays digitized historical materials: The Science History Institute Digital Collections.

Much of our stuff is public domain, and regardless we put this stuff on the web to be seen and used and shared. (Within the limits of copyright law and fair use; we are not the copyright holders of most of it). We have no general problem with people scraping our pages.

The problem is that, like many of us, our site is being overwhelmed with poorly behaved bots. Lately one of the biggest problems is with bots clicking on every possible combination of facet limits in our “faceted search” — this is not useful for…

RubyGems Blog 

3.6.3 Released

RubyGems 3.6.3 includes enhancements and bug fixes.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Add credentials file path to gem env. Pull request #8375 by duckinator
  • Update SPDX license list as of 2024-12-30. Pull request #8387 by github-actions[bot]
  • Installs bundler 2.6.3 as a default gem.

## Bug fixes:

  • Fix @licenses array unmarshalling. Pull request #8411 by rykov

SHA256 Checksums:

  • rubygems-3.6.3.tgz
    ed284c404da69a5fdb43c9d37b86e56f3c3f43a7bee85ac47cf2fb3a136f00ea
  • rubygems-3.6.3.zip
    703b862f72ec3728ddaa0cf148fb3c066aa67e510e819d00626b6509223e701d
  • rubygems-update…
Ruby Weekly 

All the language changes in Ruby 3.4

#​734 — January 16, 2025

Read on the Web

Ruby Weekly

Zverok's Guide to Ruby 3.4's Language Changes — Each year, Victor blesses us with a mammoth roundup of changes that arose in the Ruby language in the latest major version. Ruby 3.4 wasn’t one of the largest leaps forward in this sense, but he still has lots of great examples here, making this a must read/skim.

Victor Shepelev

YJIT 3.4: Even Faster and More Memory-Efficient — YJIT (Yet Another Ruby JIT) is an optimizing compiler built into CRuby since Ruby 3.1 and it got even faster in Ruby 3.4 (by 5-7%). Maxime, who started Shopify’s YJIT team,…

Rails Designer 

Introducing Rails Stats

Ever wondered about how big a Rails project or product is? Looking for inspiration for small, but still (financial) successful Rails products? Want to share your Rails project with others? Now you can!

Introducing: railsstats.com

Over the past weeks I spent a bit of time here and there to build the most basic version. The goal with this first version is to collect as many projects as possible. Then later cool features and views can be built on top of them.

bin/rails stats

But first, bin/rails stats? Yes, Rails comes with a feature to view your app’s stats. It includes lines of code, test ratio and so on. You can view them by running bin/rails stats in your app. It will output a…

I…

Notes to self 

Adding button loader to Turbo-powered forms

Turbo is a great way to build user interfaces, but most Turbo forms have to wait for the server response. Here’s how I am adding a small loading spinner to the submit buttons to improve the UX.

Submit feedback

Whenever we submit a Turbo form, we are waiting for a response from the server without any big visual changes. This is especially noticable inside modals and on slow connections.

To improve the situation we’ll create a small Stimulus controller that can be attached to any such form and suggests everything is working despite the wait:

lazyform

Here’s the implementation of our small controller for lazy forms:

import { Controller } from "@hotwired/stimulus";

// Connects to…
Alchemists: Articles 

Git Rebase Pick

Cover
Git Rebase Pick

When using Git Rebase, you’ll be greeted with a list of commits to pick when rebasing changes onto your feature branch. The pick command can seem rudimentary, even boring, but did you know it has superpowers? Well, you can use pick to reorder your commits which allows you to tell a compelling story of how you implemented your work.

Let’s say you are working on the release feature branch and want to rebase as follows:

git rebase --interactive

Let’s also assume the following commits appear in your Git Rebase Editor as shown in the screenshot above but listed here for convenience:

p 85b2df679865 Added project skeleton
p b7a0c4538558 Added method scopes…
Ruby News 

Ruby 3.3.7 Released

Ruby 3.3.7 has been released.

This is a routine update that includes minor bug fixes. Please refer to the release notes on GitHub for further details.

Download

Giant Robots Smashing Into Other Giant Robots 

How to infer the form method for custom objects in Rails

Rails is able to automaticaly infer which HTTP verb to use when generating forms for Active Record models in form_with. How can we get the same for our plain old Ruby objects?

Problem

We want to avoid having to explicitly specify the method when rendering a form for our custom Cat object. Active Record objects don’t have to do this, so why do we?!

<%# don't want this explicit :method %>
<%= form_with model: @cat, method: :post do |f|%>

The persisted? method

The magic is all in the persisted? method. form_with will submit persisted objects via PATCH, while unpersisted objects get submitted via POST. We start by adding the method to our custom Cat object:

class Cat
Giant Robots Smashing Into Other Giant Robots 

Superglue 1.0: React ❤️ Rails. A new era of thoughtfulness

React ❤️ Rails

Integration simply isn’t enough

I’m thrilled to announce the release of Superglue 1.0. First announced a year ago, Superglue is a library designed to make building interactive Rails and React apps as productive as the classic Rails stack. In every client project we’ve used it on, I’m often amazed at how well it preserves the Rails developer experience while leveraging the React ecosystem to help teams move fast. It can be said that Superglue is yet another library that integrates Rails and React, but there is so much more that makes it uniquely effective.

I started Superglue over a decade ago, and I’ve seen many attempts to integrate Rails and React—Hyperstack, ReactOnRails,…

byroot’s blog 

Optimizing Ruby’s JSON, Part 7

In the previous post, we started covering some parser optimizations. There’s just a handful more to cover until we reached what’s the state of the currently released version of ruby/json.

Batch APIs

But as always, let’s start with a flame graph of twitter.json, to see what was left to optimize:

Full profile.

Something that was bothering me in that profile, was the whopping 26.6% of time spent in rb_hash_aset, which is the C API for Hash#[]=.

It wasn’t really surprising to me though. I’m sure you’ve heard about some super fast JSON parsers like simdjson, rapidJSON etc, Some of you may have wondered why I didn’t just do a binding of one of these to make ruby/json faster. Aside from…

Evil Martians 

Devs in mind 2025: how to design interfaces for developer tools

Authors: Anton Lovchikov, Sr. Product Designer, and Travis Turner, Tech EditorTopic: Design

What interface design differences exist between commercial software and, creative, developer tools for pros? Let's analyze and find out how to better design tools!

It’s one thing to design an interface for user-facing software, but when designing interfaces for tools that developers will use, there are certain considerations that should be kept in mind. Read on to compare, find out exactly what those are, and learn to easily and quickly incorporate these practical tips in your work!

justin․searls․co - Digest 

📸 Happy Birthday I Got You an Irrelevant Blog Post

Think of how much they saved by sending me this nonsensical content marketing collateral instead of a coupon.

SINAPTIA 

with_recursive_tree

In our previous post, we mentioned that we’re working on a project whose main entity is organized as a tree. Because of that, we analyzed the three major implementations for tree structures: acts_as_tree, ancestry, and closure_tree, to decide which one was best to use. They’re great solutions but each one of them has different trade-offs: they are either fast for reading or fast for writing.

In our particular case, we had 2 constraints:

  1. We need to insert the nodes in any order, meaning we might not know the parent of a node when we insert it
  2. Each tree could have a large number of nodes, so we need a solution that’s fast for reading

The first constraint practically discards ancestry…

Ruby Central 

Alpha-Omega Supports Ruby Central’s Expansion of Open Source Leadership & Security

Alpha-Omega Supports Ruby Central’s Expansion of Open Source Leadership & Security

Ruby Central is excited to share that with the support of the Alpha-Omega Project, we are accelerating our Open Source Program by adding a full-time role for our Director of Open Source, Marty Haught, and renewing Samuel Giddins’ position as Security Engineer in Residence. This funding will allow them to continue and expand their work on RubyGems, RubyGems.org, Bundler, and the broader Ruby Central Open Source Program.

Marty Haught’s Expanded Leadership Role as Director of Open Source

As our Interim Open Source Lead since August 2024, Marty Haught has been instrumental in guiding our open source efforts. We are thrilled for Marty to transition from a part-time to a full-time role as Director…

justin․searls․co - Digest 

📸 What is up with Apple Music recommendations?

Just me, or has Apple Music started giving top billing to some really weird recommendations? Every day I log in, the top recommendation is an artist I’ve never heard of, with a track or album that sounds like AI generated lofi or stock music. I admit I listen to a fair number of instrumental “Focus” playlists and channels, but I think they’re trying to do something clever with the backend algorithm and they’re failing to grasp that people use “lofi music” and “music music” completely differently.

The Rails Tech Debt Blog 

From Types in Elasticsearch to Type-Less Indices in OpenSearch

In earlier versions of Elasticsearch, types were a convenient way to categorically organize documents within a single index. However, types were eventually deprecated, pushing developers toward a type-less structure in Elasticsearch 7 and later versions. Recently while working on a project to migrate a Rails application from Elasticsearch 2 to OpenSearch 2, we faced the challenge of identifying a way to replicate this behavior in a way that is allowed with OpenSearch. In this blog we will discuss how types were used for document organization and how to achieve the same behavior in OpenSearch.

Understanding Types in Elasticsearch

Before Elasticsearch 7, the availability of types helped…

justin․searls․co - Digest 

📸 How to make a HomeKit scene dim lights without turning them on

Update: and 20 minutes after posting this, it stopped working. HomeKit giveth and HomeKit taketh away.

Out of the box, Apple’s Home app will turn on any lights you add to a scene, even if it’s only to decrease their brightness level. As a result, if your goal is to simply dim the house’s lighting at nighttime, then your scene may have the unintended effect of actually turning on a bunch of lights.

While not the best-looking app in the world, third party apps can separate a light's power state from its brightness level in a HomeKit scene, and Eve is a free one that lets you configure this.

  1. First, make your HomeKit scene how you want it in the Home app, because that UI is nicer
  2. In Eve,…
Shopify Engineering - Shopify Engineering 

Five years of React Native at Shopify

Planet Argon Blog 

Disaster-Proof Your Application: How to Build a Reliable Backup Strategy

Disaster-Proof Your Application: How to Build a Reliable Backup Strategy

When your app goes down, it's better to be prepared! Learn how to create a reliable, maintainable database backup strategy and tips for application maintenance.

Continue Reading

Saeloun Blog 

Rails 8 Now Uses ISO 8601 Style Time For TimeWithZone#inspect.

The TimeWithZone is a Time-like class that can represent a time in any time zone. It is necessary because standard Ruby Time instances are limited to UTC and the system’s ENV['TZ'] zone.

TimeWithZone instances implement the same API as Ruby Time instances, so that Time and TimeWithZone instances are interchangeable.

TimeWithZone#inspect Returns a string of the object’s date, time, zone, and offset from UTC.

Before

TimeWithZone#inspect used an RFC822-inspired format for displaying timestamps. For instance:

Time.zone.now.inspect

#=> "Mon, 30 Sep 2024 05:04:48.516544000 UTC +00:00"

This format is readable but lacks consistency with Ruby’s internal Time#inspect, which follows the ISO…

byroot’s blog 

Optimizing Ruby’s JSON, Part 6

After wrapping up about the encoder optimizations in the previous post, we can now start talking about the parser side.

It certainly won’t be as long, because the parser didn’t need as much work, but also because some optimizations, particularly around setup costs were the same as the one applied to the encoder, so I will simply reference them quickly.

Efficient Hash Operations

When I took over the gem, there was a pull request by Luke Gruber that had been sitting there for almost a year, with multiple parser initialization speedups.

I mentioned the first one in part two, the parser’s #initialize method was doing hash lookups in a very inefficient way by using rb_funcall to check if…

#define option_given_p(opts,…
Hotwire Weekly 

Week 02 - Hotwire Native book, Skeleton Frames, and more!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

Welcome to another issue of Hotwire Weekly! Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Auto-saving Rails forms with Turbo Streams - Josef Strzibny demonstrates how to implement an autosave feature for inline input fields using Turbo and Stimulus.

A Simple Fix for Dynamicly Added External Widgets in Turbo-Enabled Sites - Maciej Litwiniuk addresses the issue of external widgets, such as Chatwoot, disappearing or reloading during page transitions in Turbo Drive-enabled sites.

Image Uploads with Uppy & ActiveStorage in Rails - Ken Greeff integrates the Uppy package with ActiveStorage in a Rails application to add image upload functionality for listings and…

justin․searls․co - Digest 

📄 A real-world example of a Mocktail test

A few years ago, I wrote this test double library for Ruby called Mocktail. Its README provides a choose-your-own-adventure interface as well as full API documentation, but it doesn't really offer a way to see a test at a glance—and certainly not a realistic one.

Since I just wrote my first test with Mocktail in a while, I figured I'd share it here for anyone who might have bounced off Mocktail's overly cute README or would otherwise be interested in seeing what an isolated unit test with Mocktail looks like.

The goal

Today I'm writing a class that fetches an Atom feed. It has three jobs:

  1. Respect caching and bail out if the feed hasn't been updated
  2. Parse the feed
  3. Persist the feed…

There is an unspoken fourth job here:…

Julia Evans 

What's involved in getting a "modern" terminal setup?

Hello! Recently I ran a terminal survey and I asked people what frustrated them. One person commented:

There are so many pieces to having a modern terminal experience. I wish it all came out of the box.

My immediate reaction was “oh, getting a modern terminal experience isn’t that hard, you just need to….”, but the more I thought about it, the longer the “you just need to…” list got, and I kept thinking about more and more caveats.

So I thought I would write down some notes about what it means to me personally to have a “modern” terminal experience and what I think can make it hard for people to get there.

what is a “modern terminal experience”?

Here are a few things that are important to…

Posts on Kevin Murphy 

What Is It (in Ruby 3.4)?

This post may appear to be about new functionality in Ruby. However, it may instead be an attempt to write an article with the worst possible SEO.

Anyway, hit it.

What Is It? 🔗

As of Ruby 3.4, it is another way to refer to the first parameter in a block. This may be more obvious by way of an example.

["What is it?"].map { it + " It's it" } * 4=>[  "What is it? It's it",  "What is it? It's it",  "What is it? It's it",  "What is it? It's it",]

The block we pass to map does not define a name for the parameter to represent the variable we’re manipulating in each iteration. Instead, Ruby knows it refers to that variable.

Starting in Ruby 2.7, we had access to numbered parameters in a block with an…

justin․searls․co - Digest 

📸 A fine vintage

Can you catch COVID from 2020 wine?

Ruby on Rails 

Sorted Columns in Schema Dumper, Deprecations, and lots of fixes!

Hey everyone, Happy Friday!

Vipul here with the latest updates for This Week in Rails.

Before we start, a small update - I am happy to share that my team at Saeloun is joining the Rails Foundation as a contributing member. Read more about the reasons why we decided to join here, and why you should too!

Colorize console prompt on non standard environments
Currently, the Rails console prompt is colored according to the following rules: blue for dev and test, red of prod. On non-standard environments (like staging), the prompt is not colored. With this change, it will now be set to Magenta, for these environments.

Fix running individual app:update commands
This change fixes a regression,…

Ruby on Rails 

Saeloun joins the Rails Foundation as a Contributing member

Happy new year everyone! The Rails Foundation is kicking off the year with great news: Saeloun has joined the Rails Foundation as its newest Contributing member!

Saeloun is a Ruby on Rails consulting agency, based out of Boston, MA, and Pune, India. The team helps lead and grow startups and large corporations such as HaulHub and Methodology, helping with full stack Rails development, Rails upgrades, maintenance, scaling and performance, and helping companies implement AI solutions with their Rails apps.

Saeloun is joining the Rails Foundation after years of actively making contributions to both the framework and the community.

In fact, you might recognize two Saeloun names - CEO Vipul…

Rails at Scale 

YJIT 3.4: Even Faster and More Memory-Efficient

It’s 2025, and this year again, the YJIT team brings you a new version of YJIT that is even faster, more stable, and more memory-efficient.

A new baseline

Last year’s YJIT release delivered an impressive performance boost which earned us multiple shoutouts on social media. I was pleasantly surprised to hear that many large businesses running Rails in production had upgraded to the latest version of Ruby, in part because they were excited to get better performance. I distinctly remember, when I started at Shopify, before YJIT was a thing, that most Ruby deployments were several versions behind. Seeing many people deploying the latest Ruby with YJIT enabled left me with a warm fuzzy feeling…

Ruby Rogues 

Rules of OOP in Pictures with Ivan Nemytchenko - RUBY 668

Ivan Nemytchenko is a freelancer. He's a speaker and conference organizer. Ivan spoke at RailsConf about abstract object-oriented programming ideas and how they can be expressed with pictures. The discussion goes into learning processes and how to create visual representations that help people understand Ruby, Rails, or other concepts.


Links

Picks
Nithin Bekal 

Favorite books of 2024

47 books. 21,000 pages. That’s 17 more than my target this year. One big factor that caused this is that I’ve been listening to audiobooks far more than reading books (40 out of the 47 were audiobooks), so it was easier to get through more books.

Non fiction

Guns, Germs and Steel (Jared Diamond)

Brilliant exploration of why different societies developed at different rates, and the geographical and environmental factors that affected them. If you liked books like Sapiens or The Ascent of Man, you’ll like this one.

The Innovators (Walter Isaacson)

Isaacson traces the evolution of computing technology from the days of Babbage and Lovelace, all the way to the likes of Jobs, Torvalds, and…

RichStone Input Output 

New Knowledge Hoarder content adventures - unsubscribe while you still can!

New Knowledge Hoarder content adventures - unsubscribe while you still can!

Hey all,

As the recent pattern has established itself: It's been a while! But here we are, knee-deep into 2025, and we have almost made it through the incredible first halves of the 2020s.

On a fun note, I was commanded to share more again! I've been cheap recently, keeping all the good insight and experience nuggets for myself, like the little Gollum. I figured, before I disappeared into the dark caves below the Misty Mountains, I better get to what I've always enjoyed: Delivering value in writing, drawing and speaking to my fellow devs.

And while this post won't be a value bomb, it will give you an overview of my current doings and give you a chance to unsubscribe while you still can, before…

John Nunemaker 

Episode #4

It's out and it's stout. Actually, I don't know if it's stout or not. I just like to rhyme (all the time).

My 3 Fav Quotes

“What if instead of discounts, we focused on lowering the risk for customers to try podcasting?” – Garrett

“You don't have to go crazy and work a ton. You can you can achieve great success by turning a few levers. But sometimes it just takes a lot of work to figure out what those levers are.” – John

"I'm just thinking about swag, but that's a discussion from another day." – Kris

Black Friday Reflections and New Year Opportunities
I was hoping to get this out last year, but holidays got in the way of that (in a good way). So here is the last episode recorded in 2024, fresh for…
Awesome Ruby Newsletter 

💎 Issue 451 - Useful things you can do with Rails console

kukicola.io - Writing about ruby, rails and other web technologies 

AWS NAT Gateway cost is killing you? Enable IPv6 and Egress-only Internet Gateway!

Sometimes I feel that AWS is the master of unexpected costs. I was recently surprised by the cost of the NAT gateway - $0.045 per GB?! on top of $0.045/h? Obviously you’ll need it if you want instances on private subnets to access the Internet. For network-intensive applications such as web crawlers, a NAT gateway can be more expensive than instances. Fortunately, there is a simple way to reduce the cost - enable IPv6 and use an Egress-only Internet gateway.

Egress-only Internet Gateway vs NAT Gateway

NAT Gateway allows instances on private subnets to access the Internet over IPv4. Located on a public subnet, it connects instances to the Internet Gateway.

Nat Gateway

Source -…

Ruby Central 

A Community-Driven Solution to Ruby’s Issue With Mutable Objects

A Community-Driven Solution to Ruby’s Issue With Mutable Objects

RubyConf 2024 will be remembered not just for its amazing talks and social events but for a moment when the community came together to resolve an issue that has frustrated Ruby developers for years. 

This issue was raised by Nadia Odunayo (CEO and developer of The StoryGraph) in her closing keynote and centers around Ruby’s handling of new hashes. Thanks to Nadia’s talk and the efforts of the Ruby community, a solution has emerged that both solves the problem and demonstrates the power of open source collaboration.

Nadia’s Keynote

In her keynote, Nadia revisited her alter ego, Dee Bug — a Ruby private investigator. As Dee Bug, she dug into this issue. She explained that Ruby’s default argument…

Ruby Weekly 

Surprisingly useful Rails console tips

#​733 — January 9, 2025

Read on the Web

Hi folks – we're back from our extended holiday break and will now be with you till at least April ;-) I have a lot of email to get through from the break, but if you have anything to submit, hit reply and let me know.
__
Peter Cooper

Ruby Weekly

Ruby 3.4's Modular Garbage Collection and MMTk — Ruby’s garbage collector has been the subject of numerous tweaks and improvements over the years, but in Ruby 3.4 you can replace it with an alternative implementation at runtime. It’s a cutting edge, experimental idea, but will allow implementers to improve things and try out new…

Matthew Valentine-House

Tim Riley 

Auto-generating frozen_string_literal comments with RuboCop

So here I am, commencing the year 2025 in the Common Era, and almost too late, but I was finally bothered enough by typing # frozen_string_literal: true that I figured out how to make RuboCop autocorrect this straight in my editor.

You see, RuboCop won’t do this by default, because it considers its Style/FrozenStringLiteralComment cop to be unsafe:

This cop’s autocorrection is unsafe since any strings mutations will change from being accepted to raising FrozenError, as all strings will become frozen by default, and will need to be manually refactored.

When you have your editor configured to autocorrect with RuboCop, it will only apply autocorrections it deems safe (i.e. rubocop -a, not r…

Bu…

Notes to self 

Auto-saving Rails forms with Turbo Streams

Here’s how to implement autosaving for inline input fields the Hotwire way.

Autosaved forms

What’s autosave? Autosaving is saving a user input automatically on changes, lost focus or after an interval of no interactivity without any specific user action. Typically in inline forms.

To make things straigtforward let’s say we want to save a post’s title while reusing an existing update action that can save the title or perhaps all the post’s attributes.

They are couple options to go around it, but here’s how I do it. You just need Turbo and Stimulus installed.

Stimulus autosave

Since we’ll remove the usual ‘Save’ button from the form, we’ll need an auto-submission done in a different…

Rails Designer 

Use cases for Turbo’s Custom Events

Turbo emits various Custom events before, during and after certain actions. Knowing this helps you write cleaner and more maintainable code, without reinventing the wheel.

I want to give a few ideas and suggestions on how you could use them. Let me know if you have other suggestions I should add. ✌️

Loading state on frame load

When the content to be loaded in a frame takes some time, you can show some loading state, eg. a spinner.

You can add some loading state or Skeleton UI for the first load by simply adding it within the turbo-frame, but if you are reloading that frame, this won’t work.

But using the events turbo:before-frame-render and turbo:frame-render->frames it’s pretty doable!

justin․searls․co - Digest 

🔗 I want to send you a Beckygram

We shipped a fun feature at Better with Becky industries last week that offers a new way to follow Becky's work: getting each Beckygram delivered via e-mail!

From Becky's announcement:

That's why we built Beckygram—a space outside the noise of social media, where I can share real fitness insights, mindset shifts, and everyday wins without the distractions of ads, comparison traps, or influencer gimmicks. Frankly, I know that if I mentally benefit from being off the app, others will too!

You can sign up by clicking the Follow button on her Beckygram bio and entering your e-mail address at the bottom of any page. I hope you'll consider it, because Instagram does indeed suck.

So that brings…

code.dblock.org | tech blog 

Meeting Open Source Users Where They Are

Most paying customers expect a certain level of (paid) support. One opens a ticket, gets a response, and any issue can be resolved.

How does “support” work in open-source? My rule of thumb is to meet users where they are.

GitHub projects have issues, but opening an issue to ask a question is generally frowned upon. Therefore, in JNA, we have a mailing list, and in OpenSearch, we have a forum and Slack. StackOverflow is quite popular, too.

For a small project I choose GitHub issues as the preferred and only channel. It keeps things well organized and is the least amount of overhead for both users and maintainers. Most questions can be turned into either an issue (e.g. “I have tried this,…

Rails at Scale 

New for Ruby 3.4: Modular Garbage Collection and MMTk

Introduction

Ruby garbage collection has always been a frequently discussed topic in the community. With recommendations on tuning strategies for better performance, and even entire sets of patches designed to optimize it, going back at least as far as 2008 and Ruby 1.8.

I spoke at RubyKaigi in 2023 about the history of the Ruby garbage collector, and its evolution since the origins of the language. In that talk I mentioned some of the changes that we were working on at Shopify, to make the Ruby GC easier to modify, and ensure that we’re able to evolve it to more closely follow the cutting edge of memory management research.

I’m pleased to say that we’ve made significant progress on…

Joy of Rails 

A simple trick to understand Ruby’s lazy enumerator

In this article, we'll explore a simple visual trick to help understand how lazy enumeration works in Ruby.

Lazy enumeration may seem like an abstract concept at first. It might be difficult to conceptualize. But taking a moment to get familiar with the lazy enumerator pays dividends. Enumerator::Lazy is extremely useful in scenarios where you want to build complex pipelines of data transformations or when working with large datasets.

Let’s see how.

Enumerable is eager by default

Consider an Enumerable method chain.

7.times.map { |n| n + 1 }.select(&:even?).take(3)
# => [2, 4, 6]

At each step of the chain, method calls are evaluated eagerly. Each element from the previous step must be…

Island94.org 

How I'm thinking about AI (LLMs)

With AI, in my context we’re talking about LLMs (Large Language Models), which I simplify down to “text generator”: they take text as input, and they output text.

I wrote this to share with some folks I’m collaborating with on building AI-augmented workflows. I’ve struggled to find something that is both condensed and whose opinionations match my own. So I wrote it myself.

The following explanation is intended to be accurate, but not particularly precise. For example, there is ChatGPT the product, there is an LLM at the bottom, and then in the middle there are other functions and capabilities. Or Claude or AWS Nova or Llama. These things are more than *just* LLMs,…

Island94.org 

Living Parklife with Rails, coming from Jekyll

I recently migrated this blog from Jekyll to Ben Pickles’s Parklife and Ruby on Rails, still hosted as a static website on GitHub Pages. I’m pretty happy with the experience.

I’m writing this not because I feel any sense of advocacy (do what you want!) but to write down the reasons for myself. Maybe they’ll rhyme for you.

Here’s this blog’s repo if you want to see: https://github.com/bensheldon/island94.org

Background

I’ve been blogging here for 20 years and this blog has been through it all: Drupal, Wordpress, Middleman, Jekyll, and now Parklife+Rails.

For the past decade the blog has largely been in markdown files, which I don’t intend to change. Over the past 2…

Evil Martians 

The 16 most active developer tool investors and VCs going into 2025

Authors: Irina Nazarova, CEO, and Travis Turner, Tech EditorTopic: Business

Building a developer-facing product and eyeing a fundraise in 2025? Here are the current active investors and VCs. We analyze the top 16, who might be the best fit for your product, and how to effectively make connections with them.

Building a developer-facing product and eyeing a fundraise in 2025? Then, straight to the point: let's share what you need to know about the active investors in this space as we review our research in this space and turn the page on 2024.

justin․searls․co - Digest 

📺 The Punsort Algorithm

It was probably easy to miss this one, but v27 of my Breaking Change podcast was a holiday special that featured our friend Aaron "tenderlove" Patterson and which we released as a video on YouTube.

In this video, we sweat the small stuff to review this year in puns, re-ranking all 26 that he'd written this year for the show and ultimately arriving at something of a Grand Unifying Theory of what makes for a good pun.

(One programming note that's kind of interesting: while we recorded locally, we conducted the actual session via a FaceTime Video call and… I'll be damned if it doesn't seem extremely low latency compared to most remote-cohost podcasts and videos you see out there. We were able…

Everyday Rails 

Notes on pair programming with Aider when Python isn't readily available

Here's how I'm using Aider as an AI pair programming buddy in dev containers, without dealing with Python
Josh Software 

The Beginner’s Guide to Go Memory Allocation: Stack, Heap, and Escape Analysis

When programming in Go, understanding how variables are allocated in memory is crucial for writing efficient and performant code. In this article, we’ll delve into the concepts of stack, heap, and escape analysis, ensuring even beginners can grasp these fundamental topics. Stack & Heap : In Go, variables are allocated in two primary memory locations: the stack and the heap. Let’s … Continue reading The Beginner’s Guide to Go Memory Allocation: Stack, Heap, and Escape Analysis
zverok's space 

The short outburst of activity during Ruby Changelog preparation—2025 edition

On making the Ruby Changes, and some consequences of this work

Every year since 2013, on December 25, a new Ruby version is released. (Before that, the version schedule was much unpredictable.)

Every year since 2018 (Ruby 2.6), I spend several weeks in December working on updating my Ruby Changes site to prepare an annotated changelog of the language, focused on changes in syntax, semantics, and core APIs. You can see the 2024 installment, dedicated to Ruby 3.4, here: 7k words, 30+ sections, and some ~60 hours of work.

I have already written a series of articles about how and why I am doing it in 2022 (1, 2, 3), along with some philosophical and personal implications of this work. Last…

Rails Designer 

How to order attributes on HTML elements

The order of attributes on HTML elements may seem like a thing you have never thought or cared about. But having a guideline helps keep your code consistent and have yet one other thing you don’t have to think about.

Below is the order I am using. Share it with your team and use it as a guideline. I won’t say this is the only right way, but it’s the one I’ve been using successfully with numerous projects over the last decade (👨‍🦳).

I use the following grouping order:

  1. identifier
  2. functional
  3. styles

In terms of the actual attributes per group:

Identifier

This is only the id-attribute. I always put it first. By definition it has to be unique, making it important enough. Using Turbo…

Posts on Kevin Murphy 

Frequently Played Jan 2025

Frequently Played 🔗

I tend to listen to the same songs or albums on repeat that are evocative of how I’m feeling or what’s going on with me. Here is what I’m currently listening to over, and over, and over, and over, again.

Zero 🔗

These riffs are super fun to play. My maybe toxic 90’s music take is that Jimmy Chamberlin is the best drummer of the bunch. Sorry Danny Carey, Josh Freese, and others.

Full Lyrics

I never let on
That I was on a sinkin’ ship
I never let on that I was down
You blame yourself
For what you can’t ignore
You blame yourself for wanting more

We’re In This Together 🔗

Rather than the original, I’ve specifically been listening to the version from Allie Goertz’s Peeled Back album of…

Drifting Ruby Screencasts 

Skeleton Frames

In this episode, we look at implementing a temporary loader for turbo frame tags to give a visual of data that is loading.
Island94.org 

Living Parklife with Rails, coming from Jekyll

I recently migrated this blog from Jekyll to Ben Pickles’s Parklife and Ruby on Rails, still hosted as a static website on GitHub Pages. I’m pretty happy with the experience.

I’m writing this not because I feel any sense of advocacy (do what you want!) but to write down the reasons for myself. Maybe they’ll rhyme for you.

Here’s this blog’s repo if you want to see: https://github.com/bensheldon/island94.org

Background

I’ve been blogging here for 20 years and this blog has been through it all: Drupal, Wordpress, Middleman, Jekyll, and now Parklife+Rails.

For the past decade the blog has largely been in markdown files, which I don’t intend to change. Over the past 2…

Island94.org 

How I'm thinking about AI (LLMs)

With AI, in my context we’re talking about LLMs (Large Language Models), which I simplify down to “text generator”: they take text as input, and they output text.

I wrote this to share with some folks I’m collaborating with on building AI-augmented workflows. I’ve struggled to find something that is both condensed and whose opinionations match my own. So I wrote it myself.

The following explanation is intended to be accurate, but not particularly precise. For example, there is ChatGPT the product, there is an LLM at the bottom, and then in the middle there are other functions and capabilities. Or Claude or AWS Nova or Llama. These things are more than *just* LLMs,…

Hotwire Weekly 

Week 01 - Happy 2025!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

Happy New Year, and welcome to the first edition of Hotwire Weekly for 2025! 🎉

We’re excited to kick off another year of sharing the best articles, tutorials, and updates from the Hotwire and Rails community. Wishing you a successful and inspiring year ahead. Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Up and Running with Hotwire Native Android Part 2 - Path Configuration - William Kennedy explains how to configure paths in Hotwire Native Android to enable features like modals, session resets, and native navigation. The guide provides a straightforward setup process to enhance the native feel of your Hotwire apps.

Drifting Ruby Episode #489 - Hotwire…

dagi3d 

Ruby Git Server

I’ve been toying with a side project's POC and for one the moving pieces, I needed a Git server I could self-host.

One option I considered was using something like Gitea, but I eventually preferred something that was easier to customize and maintain by myself, so I needed a lighter solution. It turns out that Git itself already includes git-http-backend, a CGI program that allows to interact with a Git repository through the http[s] protocol.

danielabaron.me RSS Feed 

Datadog APM for Rails on Heroku

Learn how to set up Datadog APM for a Rails application on Heroku, including installation, configuration, and tips for optimizing performance monitoring.
Dhaval Singh's Blog 

Order of fields in Structured output can hurt LLMs output

We at Seezo deal with structured output(SO) a lot, and hence I have a lot of interest in understanding whats the best way to prompt LLMs, esp when constraining their output to JSON and how can it affects result.

Recently, I came across Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Models and a rebuttal blog Say What You Mean: A Response to 'Let Me Speak Freely' and another blog Structured outputs can hurt the performance of LLMs addressing the approach and questioning few things from both the paper and blog. These papers and blogs sparked a lot of discussions across the board and I found quite a bit of insightful comments on how folks deal…

While it does seem logically obvious, that if you allow the LLMs to reason before they…

Closer to Code 

The Silent Guardian: Why Bundler Checksums Are a Game-Changer for Your Applications

Introduction: A Fragile Trust

The Ruby ecosystem relies heavily on RubyGems.org as the central platform for distributing and managing gems. We all depend on it to provide reliable, untampered gems that are the foundation for our projects. This trust in the system is a cornerstone of Ruby and Rails software development and undoubtedly part of what makes it so successful.

In 2022, two critical incidents involving RubyGems' backend highlighted cracks in this trust. Although no damage occurred, the event raised concerns about the potential for malicious actors to replace widely used gems, like Rails, with compromised versions.

These incidents once again emphasized the need for additional…

Andy Croll 

Year in Review 2024

Over-active side-projects.

January—March

Welcomed Ella to the team at CoverageBook, another Le Wagon graduate who moved to Brighton and emailed me for a coffee in late 2023. Initially joining for a short paid contract to give her some experience and us some extra bugsmashing firepower… come the end of the year Ella was still with us, still shipping and an asset to the team.

We also launched CoverageImpact, a fun little tool to encourage marketing and PR folks to look at the realistic results of their work. It’s been a good project for us to talk about trying to move the industry’s conversation about value rather than shrug and make spurious, unexamined , claims about “reach”.

At its…

justin․searls․co - Digest 

🎙️ Breaking Change podcast v28 - Do you regret it yet?

Direct link to podcast audio file

I don't normally do this, but content warning, this episode talks at length about death and funerals and, while I continue to approach everything with an inappropriate degree of levity, if that's something you're not game to listen to right now, go ahead and skip the first hour of this one.

Recommend me your favorite show or video game at podcast@searls.co and I will either play/watch it or lie and say I did. Thanks!

Now: links and transcript:

byroot’s blog 

Optimizing Ruby’s JSON, Part 5

In the previous post, we showed how we eliminated two malloc/free pairs of calls when generating small JSON documents, and how that put us ahead of Oj when reusing the JSON::State object.

But that API isn’t the one people use, so if we wanted to come out ahead in the micro-benchmarks users might perform themselves, we had to find a way to get rid of that JSON::State allocation too, or to somehow make it faster.

Typed Data

Because that JSON::State allocation, isn’t just about any allocation. In Ruby, everything is an object, but not all objects are created equal. In previous parts I touched on how some objects aren’t actually allocated, and called “immediates”, I also touched on how core…

Ruby Rogues 

Rails at Super Scale with Kyle d'Oliveira - RUBY 667

Kyle d'Oliveira (Clio) shares his survival tips for dealing with tens of thousands of commits, massive migrations and the very limits of databases. We discuss the lessons learned from Rails megaprojects and how to use these tips in your own projects to reduce technical debt and tools to keep your monolith majestic when the code won't stop coming.

Links

Picks


Become a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.
justin․searls․co - Digest 

🔗 Overcoming Resistance to Extreme Programming

The year is 2025 and, astoundingly, a blog post is advocating for the lost art of Extreme Programming ("XP"). From Benji Weber:

In my experience teams following Extreme Programming (XP) values and practices have had some of the most joy in their work: fulfilment from meaningful results, continually discovering better ways of working, and having fun while doing so. As a manager, I wish everyone could experience joy in their work.

I've had the privilege to work in, build, and support many teams; some have used XP from the get go, some have re-discovered XP from first principles, and some have been wholly opposed to XP practices.

XP Teams are not only fun, they take control of how they work,…

For what it's worth, I wrote about my favorite experience on a team striving to practice (and even iterate on) Extreme Programming in the August edition of Searls of Wisdom, for anyone wanting my take on it.

Tejas' Blog 

Writing elegant custom matchers in RSpec

RSpec brings Ruby's readability to testing. Custom matchers take it to the next level 🚀.

Ruby on Rails 

Schema dumper versions formatter and more

Hi, Wojtek here. Let’s explore the first changes of the new year in the Rails codebase.

Introduce versions formatter for the schema dumper
It is now possible to override how schema dumper formats versions information inside the structure.sql file. Currently, the versions are simply sorted in the decreasing order. Within large teams, this can potentially cause many merge conflicts near the top of the list.

Now, the custom formatter can be provided with a custom sorting logic (e.g. by hash values of the versions), which can greatly reduce the number of conflicts.

Replace SyntaxTree with Prism in rail_inspector
Now that Prism has been stable for a while and is the default parser in Ruby…

Handle path_params…

Awesome Ruby Newsletter 

💎 Issue 450 - Ruby 3.4 Highlights

37signals Dev 

Monitoring 10 Petabytes of data in Pure Storage

As the final part of our move out of the cloud, we are working on moving 10 petabytes of data out of AWS Simple Storage Service (S3). After exploring different alternatives, we decided to go with Pure Storage FlashBlade solution.

Pure Storage Hardware

We store different kinds of information on S3, from the attachments customers upload to Basecamp to the Prometheus long-term metrics. On top of that, Pure’s system also provides filesystem-based capabilities, enabling other relevant usages, such as database backup storage. This makes the system a top priority for observability.

Although the system has great reliability, out-of-the-box internal…

Josh Software 

Leveraging the Power of Swift Extensions – A Guide for Senior iOS Developers

As a senior iOS developer, you’ve likely encountered various scenarios where you needed to enhance or modify existing types without altering their original source code. Swift, the programming language for iOS development, offers a powerful feature for such situations: Extensions. In this blog post, we’ll delve into the benefits and best practices of using Swift … Continue reading Leveraging the Power of Swift Extensions – A Guide for Senior iOS Developers
Alchemists: Articles 

Advanced Ruby

Cover
Advanced Ruby

Roughly ten years ago, Dry RB hit the Ruby scene by ushering in an new way of thinking by fully embracing the more functional aspects of the language. Granted, Ruby has always supported both Object Oriented and Functional Programming but most Ruby engineers don’t venture far beyond the basics of Object Oriented design and, even then, these objects tend to be overly complicated and not broken down into smaller, reusable, building blocks for assembling more sophisticated architectures. The blending of both object oriented and functional design is where true power lies.

I’ve started to call this kind of architecture "Advanced Ruby" and/or "Ruby Fusion". This is where you…

Ruby on Occasionally consistent 

A basic terminal text editor, in Ruby

A basic terminal text editor, in Ruby, inspired by Antirez’s kilo text editor, written in C.
John Nunemaker 

Episode #3

For those that haven't subscribed to the fireside blog or the podcast, I figured I'd update here as well. We released episode #3 on Mastering Prioritization in SaaS last week. Give it a listen and subscribe in your favorite podcast app. At some point I'll get too lazy to post here too. 😄

One of my favorite parts was the segment on time tracking, something that I've found useful of late.

justin․searls․co - Digest 

🎙️ Breaking Change podcast v27 - The Punsort Algorithm

Direct link to podcast audio file

HEADS UP: This one has a video version in case you'd prefer to watch that!

HEADS UP SEVEN UP: Here's a spoiler-free link to this year's puns as they existed prior to this recording.

Welcome to a very special Holiday Edition of Breaking Change: our first annual Breaking Change Punsort! Today, we're joined by a surprise guest! Want to know who it is? You'll just have to listen and find out. Yes, it's Aaron.

As always, you can e-mail the show at podcast@searls.co. If you enjoyed this episode and want to see a second annual edition next year, let me know! If you don't write in, I'll stop—because editing multiple speakers plus video is a massive pain in…

No links…

RubySec 

CVE-2024-56733 (pwpush): Password Pusher Allows Session Token Interception Leading to Potential Hijacking

### Impact A vulnerability has been reported in Password Pusher where an attacker can copy the session cookie before a user logs out, potentially allowing session hijacking. Although the session token is replaced and invalidated upon logout, if an attacker manages to capture the session cookie before this process, they can use the token to gain unauthorized access to the user's session until the token expires or is manually cleared. This vulnerability hinges on the attacker's ability to access the session cookie during an active session, either through a man-in-the-middle attack, by exploiting another vulnerability like XSS, or via direct access to the victim's device. ###…
Greg Molnar 

What changed in Rails this year?

2024 was an amazing year for the Rails community and I’d like to share a summary of what changed in the framework. As a TLDR, there were more than 4000 commits from 562 contributors and 55 releases, including Rails 8!

The Bike Shed 

453: The Bike Shed Wrapped 2024

Happy New Year from The Bike Shed!

Tune in to the one wrapped edition that really matters this holiday season, The Bike Shed Wrapped! Recap the year with Joël and Stephanie as they reminisce over their favourite moments of 2024.

The pair discuss ways they’ve stepped outside their comfort zone to gain a different perspective on their work, the growth they’ve each achieved as a result, and their ambitions for 2025 and beyond.

Discover Joël and Stephanie’s favourite episodes from the year as well as Joël’s favourite blog post of 2024.

Re-listen to Joël and Stephanie’s top four episodes of 2024
432: The Semantics and Meaning of Nil
435: Cohesive Code with Jared Norman
421: The…

code.dblock.org | tech blog 

Adding a Spell Checker to a Jekyll Blog

I found it annoyingly non-trivial to add a spell checker to this blog.

For now, I settled on GitHub Spellcheck Action that uses PySpelling on files changed in the commit or pull request as described in this blog post.

name: Check Spelling
on: [push, pull_request]
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: tj-actions/changed-files@v45
        id: changed_files
        with:
          files: |
            **/**.md
            **/**.markdown
      - name: Check Spelling
        uses: rojopolis/spellcheck-github-actions@0.45.0
        with:
          task_name: Markdown
          config_path: .pyspelling.yml
          source_files: ${{…

To run PySpelling locally ensure you have a working version of Python, install PySpelling with pip install pyspelling, and aspell with brew install aspell on a Mac. In my configuration I also use pymdownx from pymdown-extensions which is installed with pip install…

You need a .pyspelling.yml and you can run it as follows.

pyspelling …
Evil Martians 

Don't just slap on a chatbot: building AI that works before you ask

Authors: Arthur Objartel, Product Designer, and Travis Turner, Tech EditorTopics: Design, LLMs, Machine Learning, Deep Learning, Neural Networks

Too many are racing to integrate AI the same way: bolting on a chat and calling it a day. We partner with founders to go beyond these conventional implementations. In this post, principles and lessons about a better approach to integrate proactive AI.

Going into 2025, too many products are racing to integrate AI the same way: slapping on a chat interface and calling it a day. At Evil Martians, we partner with founders to go beyond these conventional implementations and find ways to make AI truly enhance user workflows. In this post, I'll focus on a…

Notes to self 

Business Class 2.0 with Rails 8, Pay 8, Solid, Kamal 2, and fancy generator

The Ruby on Rails template Business Class gets a whole new edition. Rails 8, new licencing, and improved CRUD generator.

Business Class 2.0

The new Business Class is built on top of Rails 8, Pay 8, Solid Trifecta libraries, and Kamal 2. Solid Trifecta is now the default and Redis dependency was removed, simplifyng everything. Also, Action Policy got added to finally refactor authorization. An overall update of dependencies but that’s not all!

CRUD Generator

The CRUD generator got much better. It will now give you bulk actions both for team views (as grid) and admin views (as table). All destructive actions load a confirmation HTML dialog view with Hotwire.

I was also able to fix the…

Ruby Rogues 

Evaluating Software Frameworks: Insights with Uncle Bob Martin - RUBY 666

In this episode, Charles and Valentino dive into the complexities of software design decisions with the esteemed guest, Uncle Bob Martin. They explore the pivotal question: How do you evaluate frameworks and dependencies in your projects? Uncle Bob shares his seasoned perspective on choosing frameworks based on an application's long-term goals and complexity, emphasizing the importance of thoughtful decision-making over defaulting to popular solutions. Together, they delve into the nuances of evaluating framework capabilities, testing with small demo applications, and considering AI's potential in refining design decisions.
You'll hear gripping anecdotes from Uncle Bob's vast experience,…
Everyday Rails 

Testing with RSpec book updates for December 2024

All-new coverage of system specs
byroot’s blog 

Optimizing Ruby’s JSON, Part 4

In the previous post, we established that as long as ruby/json wasn’t competitive on micro-benchmarks, public perception wouldn’t change. Since what made ruby/json appear so bad on micro-benchmarks was its setup cost, we had to find ways to reduce it further.

Spot the Seven Differences

So I decided to file this performance discrepancy as a bug, and investigate it as such and started profiling Stephen’s micro-benchmark with both ruby/json and oj:

benchmark_encoding "small mixed", [1, "string", { a: 1, b: 2 }, [3, 4, 5]]

As mentioned in previous parts, I expected the extra allocation would be the main issue, and that re-using the JSON::State object would put us on par with Oj, but it’s…

Hotwire Weekly 

Week 52 - Wishing You a Smooth Start to 2025!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

We hope you had a wonderful holiday season and are looking forward to a successful and exciting New Year in 2025! 🎉

As we wrap up the year, it’s been a quieter week in the Hotwire world, but we still wanted to bring you this edition to wrap up the year and keep you connected with the latest updates. Wishing you all the best for the year ahead. Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Remote Ruby: Christmas Eve X7 And Hotwire Spark - In this episode of Remote Ruby, Jason Charnes, Chris Oliver, and Andrew Mason discuss the latest developments in Hotwire, focusing on "Hotwire Spark". They explore how Spark introduces live reloading capabilities to Rails…

byroot’s blog 

Optimizing Ruby’s JSON, Part 3

In the previous post, I covered how I reimplemented JSON::Generator::State#configure in Ruby and some other changes. Unfortunately, it didn’t go as well as I initially thought.

Mistakes Were Made

The default gems that ship with Ruby are automatically copied inside ruby/ruby’s repo. In short, there’s a bot aptly named matzbot, that replicates all the commits from the various ruby/* gems, inside ruby/ruby, and that’s what it did with my State#configure patch.

The reason is that Ruby runs on many different platforms and its CI tests many different compilers, in different versions, and also test builds with various compilation flags enabled to hopefully catch some subtle bugs, these gems…

Ruby Weekly 

Ruby 3.4, and some sad news

#​732 — December 28, 2024

Read on the Web

🎄 Hi folks. We're not back properly till January 9, 2025, but with Ruby getting its traditional big Christmas Day release, I wanted to drop in and say hi. Sadly, there's also some tragic news I need to share at the end of the issue (consider this a content warning if you need to).
__
Peter Cooper and the Cooperpress team

Ruby Weekly

Ruby 3.4 Released — It wouldn’t be Christmas without a major Ruby release and this year delivers Ruby 3.4 complete with a variety of improvements and updates:

  • You can now use it to refer to an unnamed block parameter (a la _1).
  • Prism has…
Tim Riley 

2024 in review

Another year in the books! Here are a few of my 2024 highlights.

Hanami

It was a very big year for my open source work:

  • In February, we released Hanami 2.1, introducing our view layer and frontend assets support.

  • In April, we announced Luca’s retirement from open source, and I took on leadership of the Hanami project.

  • In November, we released Hanami 2.2, introducing our database layer as well as operations, and completing our refreshed vision for full stack Hanami apps!

  • In December, we announced Peter’s retirement from the core teams behind Hanami, dry-rb and ROM.

And that’s just scratching the surface. It was a very big year indeed. Big enough that I even wrote a special State of…

Notes to self 

Extending Rails authentication generator with registration flow

Rails 8 comes with a built-in authentication generator. However, it doesn’t yet come with registrations. Here’s how to add them.

Rails auth generator

To generate authentication scaffold, run:

$ rails generate authentication

This will create User and Session models as well as sign-in forms. But there is little to do without registrations.

Registrations

To add registrations, we’ll add a new RegistrationsController, route, and view.

The registration controller can look like this:

# app/controllers/registrations_controller.rb
class RegistrationsController < ApplicationController
  # Include Authentication module unless it's already in ApplicationController
  include Authentication
  al…
Ruby on Rails 

This year in Rails

This is Greg, Vipul, Wojciech, and Zzak, bringing you the summary of what happened with Rails in the past year. It was a busy year with close to 4000 commits from 555 contributors and 50 releases, including Rails 8!

For this year end issue, as a team we each hand-picked some of our favorite pull requests from the year.

2024 Wrap Up from the Rails Foundation
Amanda wrote a summary of what the Rails Foundation has been up to this year and what she is plannning for next year.

Add default PWA manifest and service worker file
Progressive Web Apps got a lot of support in Rails this year starting with freshly generated Rails apps now include a manifest and service worker file to become…

Add…

Remote Ruby 

Christmas Eve X7 And Hotwire Spark

In this episode, Jason, Chris, and Andrew discuss a variety of topics leading up to
Christmas. They talk about the number of ‘Eves’ until Christmas, share opinions about Jason’s dog named after a Pokémon, and delve into several technical discussions. These include new Rails Guide updates, Ruby&#39;s latest release notes, and the pros and cons of various tech gadgets like the Samsung 32 inch Odyssey Neo G8 monitor and the HP Thunderbolt monitors. They also discuss new features in Hotwire, including the "Spark" update, and reminisce about older technologies such as jQuery UI. The conversation also touches on the challenges of monitor setups and docking solutions for MacBooks. Hit download now!

byroot’s blog 

Optimizing Ruby’s JSON, Part 3

In the previous post, I covered how I reimplemented JSON::Generator::State#configure in Ruby and some other changes. Unfortunately, it didn’t go as well as I initially thought.

Mistakes Were Made

The default gems that ship with Ruby are automatically copied inside ruby/ruby’s repo. In short, there’s a bot aptly named matzbot, that replicates all the commits from the various ruby/* gems, inside ruby/ruby, and that’s what it did with my State#configure patch.

The reason is that Ruby runs on many different platforms and its CI tests many different compilers, in different versions, and also test builds with various compilation flags enabled to hopefully catch some subtle bugs, these gems…

DEV Community: Brandon Weaver 

Noah Gibbs: Mentor, Friend, Ally

Content Warning: Death of a Ruby community member

I woke up this morning to receive the news, among others, that Noah Gibbs had passed away. It was a sudden and unexpected loss, and one that I feel deeply. Let me tell you about the man who was Noah Gibbs, and what he meant not only to me, but to an entire generation of Ruby developers.

You Are Welcome Here

I grew up in a world where I was often told to be quiet, to keep to myself, to not bother others and to just be normal. I lived a life of silence and isolation that took years to escape from, even with the help of several friends I met in the Ruby community.

I was alone.

When I was first invited to speak at Southeast Ruby I…

justin․searls․co - Digest 

📄 Review of the Bullstrap Leather NavSafe Wallet

A few years ago, I bought a leather Apple MagSafe Wallet with its hobbled Find My integration (wherein your phone merely tracks the location at which it was last disconnected from the wallet, as opposed to tracking the wallet itself). And that was a couple years before they made the product even worse by switching to the vegan FineWoven MagSafe Wallet.

Well, this wallet I never really liked is falling apart, and so I went searching for something better. All I want is a leather wallet that has a strong magnet and can reliably fit 3 or 4 cards without eventually stretching to the point that a mild shake will cause your cards to slide out.

After hearing the hosts of ATP talk up the company Bu…

Awesome Ruby Newsletter 

💎 Issue 449 - JRuby with JBang

Rails Designer 

The Best of 2024 from Rails Designer (number 1 won’t surprise you 🤪)

In less than a week it’s a new year. 2024 was the year I launched Rails Designer. I helped many teams improve their existing Rails UI (four teams I’ve been pushing pixels for, for over six months! ❤️) and kickstarted a SaaS for three people! 🚀🌕

Oh, and I also published some OSS work (and more coming!). 🧑‍💻

But besides a really successful Rails UI Components Library with a few dozen developers/teams getting access every(!) week, it also became a pretty successful resource for Rails product engineers (or any Rails developer who wanted to improve their product/front-end skills) reaching monthly visitors in the 5 digits.

Graph showing an upward trend of Rails Designer's website traffic

So today I wanted to look at what articles drew the most visitors.…

justin․searls․co - Digest 

📸 I love eggs but I'm lactose intolerant

Becky and I circled the Costco three fucking times looking for eggs before independently realizing that OF COURSE they're in the room labeled "Dairy".

Why, American people?

a-chacon 

Chaski: A Feed Reader for 2025

Some time ago, I discovered how RSS works. I regret not discovering it sooner, and since then, I added it to my blog. Later, I looked for ways to follow different sources, and that’s when the idea of creating my own application came to me. Before even asking myself, “What technology should I use?” I already had the answer: Tauri.

I discovered Tauri through GitHub when I started getting interested in Rust and exploring projects written in this language. There was already talk about version two allowing a single application to be compiled for both desktop and mobile, so the time was right. Four months ago, I started the project.

RSS

Before continuing, I’d like to dedicate some space to…

Alchemists: Articles 

Ruby 3.4.0

Cover
Ruby 3.4.0

Happy Holidays. ❄️ I hope you are enjoying the new Ruby 3.4.0 release! 🎄

Once again — as is tradition every year — a new release of Ruby has arrived along with a few enhancements over last year’s Ruby 3.3.0 release. The following is a capture of highlights but definitely dig into the release notes for complete details. Enjoy!

Syntax

  • Use of the frozen_string_literal pragma is finally going to be removed with the goal of making all strings frozen by default in Ruby 3.4.0. You still need to use the pragma in your existing code, though. Check out Xavier Noria’s gist or my Pragmater gem for…