#754 — June 12, 2025 |
💡 I saw an interesting Ruby bug/problem on Reddit earlier today and have written up a useful tip at the end of this issue, in case you need to debug a similar issue. Make sure to scroll down to the end and check it out :-) |
|
Ruby Weekly |
![]() |
Inside Ruby Debuggers: TracePoint, Instruction Sequence, and CRuby API — Debugging is a fundamental development process, and Ruby’s TracePoint and Instruction Sequence (iseq) APIs make runtime-event and bytecode instrumentation trivial. If you need more power, the CRuby C-API unlocks more, if you’re ready to shoulder the extra work. Dmitry Pogrebnoy (RubyMine) |
![]() Memetria K/V: Efficient Redis & Valkey Hosting — Memetria K/V hosts Redis OSS and Valkey for Ruby apps, featuring large key tracking and detailed analytics to manage and optimize application data effectively. Memetria sponsor |
Active Job Continuations Merged into Rails — Continuations are coming to Active Job, allowing properly configured jobs to be interrupted and resumed. The design, detailed in this PR, introduces a DSL that defines steps to track job progress, cursors to track step progress, and checkpoints to denote where a job can be interrupted. Donal McBreen |
IN BRIEF:
|
Build a Minimal Decorator with Ruby in 30 Minutes — A quick walk through the process of creating a decorator in a slightly long-winded way before falling back on the simplicity of Remi Mercier |
AI Meets Ruby: How FastRuby Created an LLM-Based Marketing Assistant — 🤖 Explore the tools we used to help our marketing team automate content curation tasks. What can AI solve for you? FastRuby.io | Custom Solutions sponsor |
📄 Putting Your Rails App on a SQL Query Diet – The more SQL queries you have, the slower things run. Andrew Atkinson 📄 Ruby Gem Naming: The Art of Delightful Obscurity Steven G. Harms 📄 Prevent Logging Sensitive Information in Rails, and Beyond Steve Polito (Thoughtbot) 📄 Can AI Rebuild a Rails Page in Next.js? We Tried It.. Jimmy Thigpen (Thoughtbot) |
🛠 Code & Tools |
📊 rack-mini-profiler 4.0: A Profiler for Rack Apps — A popular piece of middleware that adds a ‘speed badge’ to pages in your app (whether in dev or production) to show off database, call-stack and memory profiling data, including optional flamegraphs. Sam Saffron, Nate Berkopec et al. |
Smart Init: A Way to Eliminate Initializer Boilerplate Code — Provides a DSL to help you get rid of repetitive boilerplate code in your Paweł Urbanek |
Autoscaling Amazon ECS Doesn’t Have to Be Painful — Judoscale brings the Heroku dev experience to AWS autoscaling. It just works. Judoscale sponsor |
Naturally: A Natural Sorting Algorithm — For sorting things like file names, legal document numbers, and college course codes. Robb Shecter |
Closure Tree 8.0: Make Active Record Models Support Tree Hierarchies — Think things like tags, threaded comments, page graphs in CMSes, or tracking user referrals. Matthew McEachen |
|
💡 A Ruby parsing tip.. |
Over on Reddit, user Aspie_Astrologer encountered an odd issue with whitespace affecting an expression:
Experiment with this before reading on, if you wish, but the short version is that in the first line, the *1.0 is treated as a splat and the expression essentially turns into The more interesting part is how you can figure this out with a level of certainty, and in Ruby 3.3+ you can do this with the built-in
Here are the results: |
![]() |
Prism's output is quite dense and tricky to read at first, but if you peck through it, you can get a sense of what Ruby's parser is 'seeing' in the code you provide it. If you use Prism on two similar pieces of code, you can look through the subtle changes between both to see what's going on. In the example above, you can see that *1.0 is treated as a Just a quick parsing tip for your Ruby toolbox.. |
|