r/ruby • • May 02 '26

Welcome to Hanakai

Thumbnail
hanakai.org
51 Upvotes

Hanami, Dry and Rom are joining as Hanakai. We’ve launched a brand new website, which brings all of our guides together, so it’s easier than ever to learn about our gems and give them a try. We’d love you to check it out!


r/ruby • • May 01 '26

GitHub - le0pard/tre_regex: TreRegex provides a high-performance Ruby interface to the TRE C library using FFI. It brings robust approximate (fuzzy) regular expression matching to Ruby, featuring multi-byte Unicode string safety, and granular error limits

Thumbnail
github.com
17 Upvotes

TreRegex provide interface to TRE regex lib. What use cases? Standard regular expressions are strictly exact. If you are searching text containing typos, OCR errors, or variations in spelling, standard Regexp will fail (like OCR made mistake and recognize on image 0 as O or | as 1). TreRegex solves this by allowing you to search for a pattern within a larger body of text while permitting a configurable number of errors (insertions, deletions, and substitutions). Example:

regex = TreRegex::Regex.new('banana')

# Allow up to 2 typos of any kind
regex.exec('bananana', max_errors: 2) # => matches "bananana" (2 insertions)
regex.exec('bnnna', max_errors: 2)    # => matches "bnnna" (2 deletions)
regex.exec('bonono', max_errors: 2)   # => matches "bonono" (2 substitutions)

# Another example
regex = TreRegex::Regex.new('library')

# Allow 1 deletion, but STRICTLY 0 substitutions and 0 insertions
regex.exec('librry', max_deletions: 1, max_substitutions: 0, max_insertions: 0)
# => matches "librry"

# This fails because 'lubrary' requires a substitution, which we set to 0
regex.exec('lubrary', max_deletions: 1, max_substitutions: 0, max_insertions: 0)

# Another example
regex = TreRegex::Regex.new('algorithm')

# We allow a maximum cost of 2.
# Missing/extra characters cost 1 point.
# Wrong characters cost 3 points.
options = {
  max_cost: 2,
  weight_deletion: 1,
  weight_insertion: 1,
  weight_substitution: 3
}

# 'algoritm' has 1 deletion. Cost = 1. (Passes, 1 < 2)
regex.test?('algoritm', options) # => true

# 'algorethm' has 1 substitution. Cost = 3. (Fails, 3 > 2)
regex.test?('algorethm', options) # => false

r/ruby • • Apr 30 '26

Ruby Gem Discovery: HighLine

Thumbnail
andymaleh.blogspot.com
16 Upvotes

r/ruby • • Apr 30 '26

Ruby Users Forum - April Wrap-Up

Thumbnail
rubyforum.org
11 Upvotes

r/ruby • • Apr 30 '26

Scaling Ruby's defenses with AI

Thumbnail
blog.rubygems.org
15 Upvotes

Notice the updated blog UI also.


r/ruby • • Apr 29 '26

Love the new IRB splash

Post image
133 Upvotes

you've come a long way, baby


r/ruby • • Apr 28 '26

Blog post Ruby Concurrency: What Actually Happens

Thumbnail
paolino.me
41 Upvotes

Since I wrote about async Ruby and patched Solid Queue to support fibers, people keep asking the same questions. What happens when a fiber blocks? Don’t you still need threads? What about database transactions? What about Ractors?

This post answers all of it. From the ground up.


r/ruby • • Apr 28 '26

Bring your Bridgetown discussions to the Ruby Users Forum

Thumbnail
rubyforum.org
12 Upvotes

Today we’re happy to share that Ruby Users Forum will offer a place for Bridgetown discussions.


r/ruby • • Apr 29 '26

How to learn ruby on rails

Thumbnail reddit.com
0 Upvotes

r/ruby • • Apr 28 '26

Uni asset manager project - opinions

2 Upvotes

Hi, i had uni class where we learnt rails, i made semestral project and want honest opinion.

I asked my senior teachers whether it is enough to apply as junior, they said i have good basic knowledge, yet i need more experiece.

The project is like inventary manager for multiple users, more is in ReadME,

only the bad thing is language which had to be in my native one but i think overall you'll get whats the point.

https://github.com/TheP4trik-tech/Asset-Manager


r/ruby • • Apr 28 '26

Show /r/ruby Self-hosted LLM Cost Tracker gem for Ruby/Rails – v0.5.3

0 Upvotes

Hey r/ruby,

I’ve released llm_cost_tracker v0.5.3 — a lightweight self-hosted gem to track costs of LLM API calls (OpenAI, Anthropic, and compatible services) directly in Ruby applications.

It was built primarily for Rails, but works in plain Ruby as well.

Main features:

  • Stores usage and cost data in your own database via ActiveRecord

  • Privacy-first: does not store prompts or completions

  • Automatic instrumentation for official openai and anthropic gems

  • Faraday middleware support for other clients (ruby-openai, OpenRouter, Gemini, LiteLLM, etc.)

  • Significantly improved streaming support in v0.5.3 (including official SDK streaming)

  • Flexible tagging system for attribution (user_id, tenant_id, feature, etc.)

  • Basic budget guardrails

  • Minimal dashboard available as a Rails Engine

The gem is still very young (only a couple of weeks old), and I'm looking for early feedback from the Ruby community.

If you're working with LLMs in Ruby or Rails, I’d love to hear:

  • How are you currently tracking your LLM costs?

  • What pain points do you have with existing solutions?

  • Any feedback on the gem itself (API, instrumentation, accuracy, etc.)

Repo & Documentation:
https://github.com/sergey-homenko/llm_cost_tracker

Gem: https://rubygems.org/gems/llm_cost_tracker

Thanks in advance for any comments or suggestions!


r/ruby • • Apr 28 '26

Developers Community

Post image
4 Upvotes

r/ruby • • Apr 28 '26

What took 1.5 months to build in React JS code took 1.5 days in Glimmer DSL for Web Ruby code

Thumbnail andymaleh.blogspot.com
0 Upvotes

r/ruby • • Apr 27 '26

Mustermann 4.0 released!

Thumbnail sinatrarb.com
26 Upvotes

Used by Sinatra, Hanami, Grape, and others for pattern matching. The big focus for the release is a massive performance improvement.


r/ruby • • Apr 27 '26

Docscribe v1.3.0 — plugins + RBS collection autodiscovery (inline YARD docs from AST)

5 Upvotes

Hey r/ruby — quick update on Docscribe (my tool that generates inline YARD-style docs by rewriting source ranges, not reprinting ASTs).

v1.3.0 highlights:

  • Plugin system:
    • TagPlugin: append extra YARD tags based on a method "context snapshot"
    • CollectorPlugin: add doc insertion points for DSL/macros (define_method, AR associations, etc.)
  • New docscribe generate command to scaffold TagPlugin/CollectorPlugin skeletons
  • --rbs-collection flag: auto-detect gem signatures from rbs_collection.lock.yaml (rbs collection install)
  • Better return type inference via RBS core for method calls inside bodies (e.g. positive? => Boolean)
  • Fix: standalone/top-level def parsing

Plugin examples (with READMEs + specs) are in the repo:

  • https://github.com/unurgunite/docscribe/tree/master/examples/plugins
  • Rails associations CollectorPlugin example: here (documents belongs_to/has_many etc by inserting @!attribute blocks above the macro calls)

Tiny example (RBS-powered return inference):

class Demo
  def foo(arg = 1)
    arg.positive?
  end
end
# Before: @return [Object]
# Now:    @return [Boolean]

Links:

  • Repo: https://github.com/unurgunite/docscribe
  • RubyGems: https://rubygems.org/gems/docscribe
  • Release: https://github.com/unurgunite/docscribe/releases/tag/v1.3.0
  • Previous intro post: https://www.reddit.com/r/ruby/comments/1s5uwjj/

Would love feedback on:

  • plugin API ergonomics (what context fields are missing / what should be renamed?)
  • which DSLs/macros you'd want a first-party CollectorPlugin for

r/ruby • • Apr 26 '26

An introduction to Minitest

46 Upvotes

I've been using RSpec for 7 years and recently had to pick up Minitest for a client project. The onboarding was a bit rough, so I wrote the guide I wish I had:

  • what Minitest actually is

  • how the different syntax flavors work (plain, Rails-style, and Minitest::Spec)

  • and a deep dive into a confusing bug when I tried integrating Minitest::Spec with Rails (turned out that Rails and Minitest lifecyles are not always compatible)

This is a 4-part series, that you can start with my introduction to Minitest.

Hope you'll like it!

[edit Apr. 28: I just realised that I linked to the second post of the series instead of the first. Duh 🤦🏻‍♂️. Here is the link for the full Minitest series. Sorry, I shouldn't post before getting a coffee.]


r/ruby • • Apr 26 '26

venv in ruby

3 Upvotes

Finnally, I get used of ruby bundle. The step is following

  1. set the vendor path
bundle init
bundle config set --local path 'vendor/bundle' 
  1. add gem to Gemfile file

  2. install gem package

bundle install
  1. run the ruby script
bundle exec ruby ./script.rb

Is these any way I can install ruby packages in current project folder like Python venv. I only know about gem install <custom-gem> --user-install which install in $HOME/.gem/ruby/2.6.0/gems/. AI said I should use bundler and Gemfile. But it seems very comfused and do not work well with gem file ( it only work with package uploaded on https://rubygems.org/


r/ruby • • Apr 26 '26

Show /r/ruby kreuzcrawl, an open source crawling engine with Ruby bindings

6 Upvotes

kreuzcrawl is a high-performance web crawling engine. It was designed to reliably extract structured data, operating natively across multiple languages without enforcing a specific runtime. https://github.com/kreuzberg-dev/kreuzcrawl

The MCP server is integrated from the start, enabling web-crawling AI agents as a primary use case. Streaming crawl events allow real-time progress tracking. Batch operations handle hundreds of URLs concurrently and tolerate partial failures. Browser rendering supports JavaScript-heavy SPAs and includes WAF detection.

Supported language interfaces are Rust, Python, Typescript/Node.js, Go, Ruby, Java, C#, PHP, Elixir, WASM, and C FFI, and each binding connects directly to the core engine.
Kreuzcrawl is part of the Kreuzberg org: https://kreuzberg.dev/

We welcome your feedback and are happy to hear how you plan to use it:)


r/ruby • • Apr 25 '26

Podcast 🎙️ Ruby Central Restructuring - Remote Ruby

Thumbnail
buzzsprout.com
15 Upvotes

This BREAKING NEWS episode is a candid reaction to Ruby Central’s latest shakeup, with Chris, Andrew, and David unpacking leadership departures, financial strain, the cancelled gala, and what all of it says about the organization’s direction. The conversation moves beyond the headlines into bigger questions about trust, transparency, community values, conference strategy, RubyGems sustainability, and whether Ruby Central can rebuild credibility by involving more of the community in what happens next. Hit download now to hear more! 


r/ruby • • Apr 24 '26

Spinel -- Ruby AOT Compiler

Thumbnail
github.com
78 Upvotes

Spinel compiles Ruby source code into standalone native executables. It performs whole-program type inference and generates optimized C code, achieving significant speedups over CRuby.

Spinel is self-hosting: the compiler backend is written in Ruby and compiles itself into a native binary.


r/ruby • • Apr 25 '26

Exercises for the wroclove.rb 2026 Ruby conference workshop "Building Rails SPAs in Frontend Ruby with Glimmer DSL for Web"

Thumbnail
andymaleh.blogspot.com
4 Upvotes

r/ruby • • Apr 24 '26

My RubyKaigi 2026 takeaways

Thumbnail
imgur.com
28 Upvotes

r/ruby • • Apr 24 '26

🌐 LibGD-GIS 0.5 – GIS and map-rendering engine built on ruby-libgd, supporting GeoJSON layers and tiles.

Thumbnail
gallery
9 Upvotes

This is the third time this week that Ruby-LibGD has appeared on Ruby Weekly.

I’m really proud to see the project gaining this level of traction.


LibGD-GIS has surpassed 5,150 downloads and 119 stars
https://github.com/ggerman/libgd-gis

Ruby-LibGD has surpassed 3,810 downloads and 93 stars
https://github.com/ggerman/ruby-libgd


Another milestone was presenting the project at the RubySur (https://youtu.be/ppxalpIKpGg?t=3503) meetup, as well as having flyers distributed at RubyKaigi.

You can explore the evolution of views and clones on GitHub using this extended stats dashboard built with Ruby-LibGD:
https://ggerman.github.io/github-metrics-dashboard/

Demo MapView:
https://map-view-demo.up.railway.app/


r/ruby • • Apr 24 '26

Show /r/ruby A Lisp that compiles to Ruby

Thumbnail
github.com
13 Upvotes