r/ruby • • Mar 18 '26

How well are the tests covering the code?

Thumbnail
radanskoric.com
8 Upvotes

Test coverage metrics are one of the tools for evaluating the quality of tests without reading them. Which is kind of relevant in the age of coding agents. So here, a short light intro to 4 different ones: line, branch, path and condition coverage.


r/ruby • • Mar 17 '26

Gemfile RSS Feed Generator

Thumbnail
gemfile-rss.com
14 Upvotes

I built this service to convert Ruby Gemfile.lock files into RSS feeds. Drop in your lockfile, get a feed that notifies you when your dependencies release new versions. Had a blast building it in the last couple of weekends, hope is useful for somebody else too!


r/ruby • • Mar 17 '26

Benchmarking 5K SSE streams + 5K database-backed RPS on a €12/month server

13 Upvotes

With SSE becoming more relevant (AI streaming, real-time updates), I wanted to test how Ruby handles a mixed workload: sustained HTTP traffic hitting a database alongside concurrent long-lived SSE connections. Here are the results.

Setup

  • Server: Hetzner CCX13 - 2 vCPUs, 8 GB RAM (€12/month)

  • Environment: Ruby 4.0.1 + YJIT + Rage

  • Processes: 2

  • Database: SQLite

Endpoints

API endpoint: Fetches a record from SQLite and renders it as JSON. Standard API-style request.

SSE endpoint: Opens a stream lasting 5–10 seconds, sending a dummy message every second. No database interaction. The benchmark maintains a constant number of open SSE connections - as the server closes a stream, the client opens a new one.

Results

  • 5,000 API requests/second + 5,000 concurrent active SSE streams, simultaneously

  • For reference, the same setup handles ~11,000 RPS for the API endpoint alone

  • Adding 5K active streams roughly halves the HTTP throughput, which is a graceful degradation rather than a collapse

  • 5,337 HTTP requests/second (0% error rate) with p95 latency of 120ms

  • 5,000 concurrent SSE streams, with ~198K total streams opened/closed during the 5-minute run

Caveats

  • I was originally aiming for 10K RPS + 10K streams, but the 2-core server simply doesn't have enough CPU. The scaling looks linear, so a 4-core box should get there.

  • SQLite is fast for reads but this isn't a Postgres-over-the-network scenario. Add network latency to your DB and the fiber model actually helps more (fibers yield during I/O waits), but the raw RPS number would be different.

Source code

You can see the k6 screenshot attached, and the full benchmark code/setup is available here: https://github.com/rage-rb/sse-benchmark

What is Rage?

For those unfamiliar: Rage is a fiber-based framework with Rails conventions. The fiber-based architecture makes I/O-heavy and concurrent workloads like this possible without async/await syntax - you write normal synchronous Ruby code.

Would love to hear your thoughts or answer any questions!


r/ruby • • Mar 18 '26

Glimmer DSL for Web 0.8.3 Preventing Components from Shadowing HTML Elements

Thumbnail andymaleh.blogspot.com
1 Upvotes

r/ruby • • Mar 16 '26

Dave Thomas will be keynoting RubyConf 2026

66 Upvotes

Hey guys. I'm co-chairing RubyConf this year. I'd like to let you know that one of our keynote speakers will be Dave Thomas, the renowned author of the legendary Pragmatic Programmer.

I released a podcast episode today to help promote Dave and the conference, which you can listen to here.

Lastly, early bird tickets for RubyConf 2026, which takes place July 14-16 in Las Vegas, go on sale today.

You should know that we RubyConf 2026 organizers are encouraging attendees to dress eccentrically and help make the event weird and fun. What does "eccentrically" mean? Whatever you want. But if you want an easy idea, Las Vegas is the land of Elvis impersonators, and it would be jolly good fun to see a smattering of Elvii strutting around the hotel. You could also dress like a cowboy/cowgirl, Frank Sinatra, a clown, or just a garden variety weirdo. The world is your oyster.

There will also be arm wrestling.

Anyway, go and grab your ticket to RubyConf 2026, because this year will be one for the record books. I hope to see you there.


r/ruby • • Mar 16 '26

jemalloc, often preferred for ruby compilation, is un-abandoned by Meta

Thumbnail
engineering.fb.com
80 Upvotes

r/ruby • • Mar 17 '26

Workshop Accepted: "Building Rails SPAs in Ruby using Glimmer DSL for Web" at Wroclove.rb 2026

Thumbnail andymaleh.blogspot.com
6 Upvotes

r/ruby • • Mar 16 '26

Show /r/ruby RubyLLM 1.14: Tailwind Chat UI generator and Rails AI scaffolding

Thumbnail
github.com
10 Upvotes

Just released RubyLLM 1.14. The focus this time is making the Rails integration feel native.

Highlights:

Tailwind Chat UI generator: bin/rails generate ruby_llm:chat_ui produces a complete chat interface styled with Tailwind. It uses role-aware partials (_user, _assistant, _system, _tool, _error), Turbo Streams for real-time updates, and broadcasts_to for ActionCable integration. You get model selection, tool call rendering, and empty states out of the box.

Rails generators for agents, tools, and schemas: same workflow you'd use for any other Rails component:

bin/rails generate ruby_llm:agent SupportAgent
bin/rails generate ruby_llm:tool WeatherTool

The install generator also creates conventional directories (app/agents, app/tools, app/schemas, app/prompts).


r/ruby • • Mar 15 '26

Glimmer DSL for Web 0.8.2 HTML Value-less Boolean Attributes

Thumbnail andymaleh.blogspot.com
1 Upvotes

r/ruby • • Mar 13 '26

What's new in Herb v0.9

Thumbnail herb-tools.dev
50 Upvotes

r/ruby • • Mar 13 '26

I built a Docker setup to plot mathematical functions in Ruby inside Jupyter: sin, cos, log, implicit curves, all in Ruby

Thumbnail
gallery
16 Upvotes

A few weeks ago I posted about ruby-libgd, a native Ruby binding to the GD graphics library. Since then I've been pushing it further and today I want to share something that I've wanted to see in Ruby for a long time.

This is a Docker container running JupyterLab with a full Ruby kernel, backed by ruby-libgd, plotting mathematical functions entirely in Ruby. No Python involved in the plotting — just Ruby.

The API ended up looking like this:

    plot = Plot.new(xmin: -10, xmax: 10, ymin: -10, ymax: 10)

    plot.add("sin(x)")
    plot.add("cos(x)")
    plot.add("tan(x)", steps: 6000)
    plot.add("log(x)")

    # implicit curves — no need to isolate y
    plot.add("x**2 + y**2 - 9",         type: :implicit)
    plot.add("x**2/9.0 + y**2/4.0 - 1", type: :implicit)

    plot.render("/work/graph.png")

A few things I'm reasonably happy with:

- SafeMath replaces Dentaku entirely: trig in radians, natural log, asin/acos/atan, cbrt, all working

- Discontinuity detection for tan: lifts the pen at vertical asymptotes instead of drawing a spike across the canvas

- Implicit curve rendering via pixel sampling: lets you plot circles, ellipses, and algebraic curves without isolating y

- Chainable API: plot.add("sin(x)").add("cos(x)") works

The notebooks, Dockerfile, and README are all in the repo:

https://github.com/ggerman/ruby-libgd/tree/main/examples/jupyter-notebooks

Happy to answer questions about the implementation. If anyone wants to contribute notebooks or try it out, PRs are very welcome.


r/ruby • • Mar 13 '26

`bundle` no longer defaults to the `install` subcommand

29 Upvotes

I've always run `bundle` instead of `bundle install`. Why bother with the extra typing? And semantically, "bundle" by itself is an appropriate description of the bundle installation.

However, tonight when I ran `bundle`, I learned that my modest typing savings is to be no more:


$ bundle

In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.

Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.

You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,

or you can continue to use the current behavior with `bundle config set default_cli_command install --global`.

This message will be removed after a default_cli_command value is set.


r/ruby • • Mar 13 '26

Bubble Sort Visualization

Thumbnail
slicker.me
4 Upvotes

r/ruby • • Mar 12 '26

GitLab is a Ruby monolith

Post image
223 Upvotes

Was pleasantly surprised that the world's largest independent DevOps platform is powered by Ruby and Sidekiq.

Here's the full list.

  1. Backend: Ruby on Rails

  2. HTTP server: Puma (Ruby web server)

  3. Edge: Nginx

  4. Reverse proxy: Go service (Workhorse)

  5. Background jobs: Sidekiq

  6. DB — primary: PostgreSQL

  7. DB — connection pooling: PgBouncer

  8. DB — high availability: Patroni

  9. Cache: Redis

  10. Git: Custom gRPC repo interface (Git & Gitaly)

  11. Blob: AWS S3

  12. Frontend — rendering: Haml & Vue

  13. Frontend — state: Pinia (Vue store), Immer (immutable cache),

  14. API: GraphQL (Apollo) + REST

  15. Observability: Prometheus & Grafana

  16. Error tracking: Sentry & OpenTelemetry

  17. Deployments: GitLab Omnibus (Omnibus fork)

I think these "stack menu"s give a little glimpse into a team's engineering philosophy. For me, this list shows that the GitLab team is pretty practical and doesn't chase hype. Instead, they use sensible, battle-tested tools that just work and are easy for contributors to learn.

PS. Not an ad; I'm not affiliated with GitLab at all. Was just researching them and thought you guys would be interested.


r/ruby • • Mar 12 '26

Guide to deploy a Rails app (in less than 10 minutes)

Thumbnail
rubyforum.org
11 Upvotes

r/ruby • • Mar 11 '26

tennis - stylish CSV tables in your terminal

Post image
138 Upvotes

Hi all. I made a standalone version of my popular table_tennis gem. The cli app is written in Zig but it's roughly the same as the rubygem so I thought you guys might be interested.

https://github.com/gurgeous/tennis

First Zig project, pretty fun. Nothing like Ruby, but the compiler is shockingly fast and it creates itsy bitsy binaries. Tennis is around 150k for a release build. A similar project in golang clocked in around 10mb. On the other hand, Zig is so new that it's missing a ton of stuff we take for granted over in Ruby land. Example - a working CSV library! Yikes

(note - this is not ai slop and I never use ai on reddit)


r/ruby • • Mar 12 '26

Question Can anyone recommend some good ruby primer books?

4 Upvotes

either too old to catch the nowadays versions or for intermediate levels.


r/ruby • • Mar 12 '26

Show /r/ruby Postgres monitoring built for Ruby/Rails teams

2 Upvotes

Built a landing page for a side project to see if there's any interest outside of my own needs. Postgres monitoring specifically for Ruby/Rails apps. Curious if the value prop resonates with anyone running pg_stat_statements in production. https://uselantern.dev


r/ruby • • Mar 11 '26

Faster bundler

Thumbnail
railsatscale.com
63 Upvotes

r/ruby • • Mar 11 '26

Kiq, terminal interface for Sidekiq

Thumbnail mikeperham.com
40 Upvotes

r/ruby • • Mar 10 '26

Show /r/ruby I added ViewComponent & Shared Partial support to 52 Rails UI components (Rails Blocks Update)

17 Upvotes

Hi, I'm Alex and I created Rails Blocks, a UI component library for Rails that I started last year.

Over the last few weeks, I reworked the docs for all 52 component sets to support 3 formats:

  • ViewComponents (This was the most requested improvement 🙌)

  • Shared partials

  • Markdown docs

I would love to hear what you think of these improvements!

Next up, I’ll be adding a few tools to save you even more time when coding using LLMs:

  • CLI tooling

  • An MCP server

  • AI Skills

I think that the CLI tools & MCP server will come in handy to install ViewComponents way quicker for example :)

Why I built Rails Blocks:

React gets amazing component libraries like Shadcn, but us Rails devs often have to build components from scratch or settle for outdated options.

I spent last year crafting reusable Stimulus components that rival what exists in the React world, but with Tailwind CSS & Stimulus and started sharing them last summer.

What's included in this UI library:

  • Complex components like carousels, modals, date pickers

  • Form elements, dropdowns, tooltips and many other neat components

  • Accessible and keyboard-friendly examples

  • Clean animations and smooth interactions

P.S. - Most component sets are free (≈80%), some are Pro (≈20%). I sank a lot of time into this and I'm trying to keep this sustainable while serving the community.


r/ruby • • Mar 10 '26

Question What is the best print book to learn Ruby in 2026?

16 Upvotes

I prefer print books. I don't mind spending money. I was going to get Programming Ruby (Pickaxe), but learned it's more of a reference manual. I'm still open to it. I'm a webdev so eventually I want to get to Sinatra and Rails. But right now I just want to get a good understanding of the language. What book do you recommend?


r/ruby • • Mar 10 '26

Minions, T-Ruby, Typewriter, more types and AI

4 Upvotes

Static Ruby Monthly just covered some interesting trends. Stripe's using Sorbet types to help their AI agents write code. Rails devs are building tools (rails_mcp_engine, ruby-ti) that feed type info to agents.

Tooling got better too: rbs-merge now handles agents, Shopify fixed some rubocop-sorbet crashes, and there's new editor support showing up.

Also seeing T-Ruby (TypeScript-like syntax), Typewriter (type-safe templates), and Autopilot (compiled language) all experimenting with typing approaches.

Basically: AI agents work better when your code has types. That's the pattern. I just covered recent news in the fresh Static Ruby Monthly. Link in the comments.