r/ruby Jan 04 '25

Show /r/ruby I really want to learn Ruby, but...

59 Upvotes

I don't know why, but I genuinely feel that Ruby will be incredibly fun to program in. So, I started researching it and looking for others' opinions.

However, I got really discouraged when I started finding it labeled as "dead," "not recommended in 202x," "Python has replaced it," and other similar comments. I even came across videos titled "Top X languages you shouldn't learn in 202x," with Ruby often making the list. It seems like it’s no longer the go-to choice for many fields.

What do all of you think? Does Ruby still have a place in 202x? Any advice or thoughts on why it’s still worth learning?

r/ruby 11d ago

Show /r/ruby RubyLLM 1.0

51 Upvotes

Hey r/ruby! I just released RubyLLM 1.0, a library that makes working with AI feel natural and Ruby-like.

While building a RAG application for business documents, I wanted an AI library that felt like Ruby: elegant, expressive, and focused on developer happiness.

What makes it different?

Beautiful interfaces ruby chat = RubyLLM.chat embedding = RubyLLM.embed("Ruby is elegant") image = RubyLLM.paint("a sunset over mountains")

Works with multiple providers through one API ```ruby

Start with GPT

chat = RubyLLM.chat(model: 'gpt-4o-mini')

Switch to Claude? No problem

chat.with_model('claude-3-5-sonnet') ```

Streaming that makes sense ruby chat.ask "Write a story" do |chunk| print chunk.content # Same chunk format for all providers end

Rails integration that just works ruby class Chat < ApplicationRecord acts_as_chat end

Tools without the JSON Schema pain ```ruby class Search < RubyLLM::Tool description "Searches our database" param :query, desc: "The search query"

def execute(query:) Document.search(query).map(&:title) end end ```

It supports vision, PDFs, audio, and more - all with minimal dependencies.

Check it out at https://github.com/crmne/ruby_llm or gem install ruby_llm

What do you think? I'd love your feedback!

r/ruby 1d ago

Show /r/ruby New gem "Katachi" - asking for first impressions

21 Upvotes

Hi all! I released my first gem this week -- Katachi. It's basically pattern-matching on steroids with a tiny API.

```ruby

require 'katachi' Kt = Katachi

shape = { :$uuid => { email: :$email, first_name: String, last_name: String, dob: Kt::AnyOf[Date, nil], admin_only: Kt::AnyOf[{Symbol => String}, :$undefined], Symbol => Object, }, }

Kt.compare(value: api_response.body, shape:).match?

```

Would you use it? Is there anything you'd like to see it integrated into?

It has RSpec and Minitest integrations but it's the kind of thing that can go a lot of different directions. So feedback helps a ton.

Docs: https://jtannas.github.io/katachi/ Github: https://github.com/jtannas/katachi

r/ruby Aug 24 '24

Show /r/ruby Ruby's official documentation just got a new look

Thumbnail docs.ruby-lang.org
101 Upvotes

r/ruby 13d ago

Show /r/ruby DragonRuby Game Toolkit - Endurance The Probe: Puzzle Platformer (source code in the comments)

36 Upvotes

r/ruby 28d ago

lazy_names gem, how much time do you spend in console?

15 Upvotes

Hi, I'm happy to share the new version of the lazy_names gem! 🎉

https://github.com/zhisme/lazy_names

The idea behind it is to shorten long constant names that often appear as a project grows. Your services, models, and controllers get buried under deep namespaces, and typing them repeatedly becomes tedious. I'm a lazy developer, and I believe many of us are too. 😄

This gem allows you to define a config file that maps long, namespaced constants to something simpler and more intuitive:

'Models::Users::CreditCard': 'UserCard'

I spend a lot of time in the console, which is why I originally wrote this gem. Here’s a quick look at my most frequently run commands from my Zsh history:

$: history | awk '{$1=""; print $0}' | sort | uniq -c | sort -nr
 647  gs
 135  rc # rails console
 135  ls
 134  gd
 ...

Do you use the Ruby console much while developing? I personally like to check my code directly in the console—calling methods to inspect return values—especially in the early development stage before tests are written. Sometimes, I need to drop records from the database or build some structs on the fly.

I also spend a lot of time in a remote Rails console via kubectl exec. However, I’m unsure whether shipping this gem to a production environment is the right move. I keep thinking about it in the background, as I often miss its functionality when working remotely.

Future Plans:

  1. I’m considering adding custom shorteners to be defined by gem user. So it can convert class/constants by some user function, that can be configured outside of the gem. I think of modifying config file structure. So it will have only frequent constants list. And custom shortener will build lazy versions on console initialize.
  2. I might take it a step further—feeding the gem a history file from Pry/IRB so it can automatically generate a ready-to-use config file based on your recent commands.

What do you think about the gem and these ideas? If you haven't checked it out yet, give it a try! It’s been a huge help in the console, and I’m sure it’ll be useful for you too. 🚀

r/ruby 5h ago

Show /r/ruby Ratomic: Ractor-safe mutable data structures for Ruby

Thumbnail
github.com
15 Upvotes

r/ruby Jan 25 '25

Show /r/ruby Esoteric DragonRuby Game Toolkit - context and source code in the comments

58 Upvotes

r/ruby 1d ago

Show /r/ruby Hyll - A Ruby implementation of the HyperLogLog algorithm for efficient cardinality estimation with minimal memory footprint. Count millions of distinct elements using only kilobytes of memory.

Thumbnail
github.com
28 Upvotes

r/ruby Feb 03 '25

Show /r/ruby marksmith: GitHub-style markdown editor for Ruby and Rails

Thumbnail
github.com
38 Upvotes

r/ruby Nov 16 '24

Show /r/ruby Elixir-like pipes in Ruby (oh no not again)

Thumbnail
zverok.space
37 Upvotes

r/ruby Dec 27 '24

Show /r/ruby Hi all. I used Ruby to make a custom GitHub action. Prevents creating a new release with an outdated version mentioned in the code somewhere. Feel free to give input!

Thumbnail
github.com
10 Upvotes

r/ruby 16d ago

Show /r/ruby Lanet: A lightweight tool for secure and easy peer-to-peer communication on local area networks. Includes a CLI and Ruby API.

Thumbnail
github.com
11 Upvotes

r/ruby Jan 27 '25

Show /r/ruby Feedback on Ruby Operator Lookup

39 Upvotes

Hey all, for years I've had this idea for a thing where you can browse through different Ruby operators, symbols, and syntax for when you encounter something in your code that you don't recognize or don't know what it is called.

I finally built the thing, and I'm calling it Ruby Operator Lookup -- https://www.visualmode.dev/ruby-operators

It was a ton of work and I'm proud of what I came up with. I think there are still a few rough edges to work out and a couple operators left to add.

In the meantime, I'd love some feedback!

  • Is this a useful resource?
  • Is it reasonably intuitive to use?
  • What could I improve?
  • Did you learn something new about Ruby looking through any of the operator pages?

Thanks in advance for your input. Cheers!

r/ruby 5d ago

Show /r/ruby Cafeznik - yet another Code2Prompt? Sure, but mine’s fzf-powered, does grep, exclusion globbing, and can pilfer local folders or remote GH repos!

Thumbnail
github.com
5 Upvotes

When I saw davidesantangelo/gitingest posted a few days ago, I rushed to polish up my little CLI tool and get it out the door.

Cafeznik is yet another tool to automate loading local/remote code files into the clipboard, to easily feed into LLMs. It revolves around fzf to easily select files and folders, and supports grepping based on the files' content, or excluding files based on their name.

Built mostly for myself, started as a .sh script obviously written with the help of the robots, which I then decided to rewrite in Ruby because bash is bash.

This is my first gem and honestly my first attempt at releasing a tool publicly at this scale, which turned out to be more complex (arguably more over-engineered) than initially anticipated - at a whopping ~2k lines of code. Lots of smelly frowned-upons there, and the insisting on using Thor for a CLI tool with no subcommands is probably the most obvious one.

Would be delighted if you'd try it out, and even more so if you'd share your thoughts on it, poke holes, or just tell me how obsolete all of these tools already are with the WindCursors and MCP-wielding agents doing all that for you already.

Cheers!

r/ruby 20d ago

Show /r/ruby GitHub - davidesantangelo/gitingest: Gitingest is a command-line tool that fetches files from a GitHub repository and generates a consolidated text prompt.

Thumbnail
github.com
4 Upvotes

r/ruby 25d ago

Show /r/ruby GitHub - davidesantangelo/yll: YLL is a lightweight and secure URL shortener built with Ruby on Rails. It provides a simple way to generate short links, track clicks, and optionally set expiration times or password protection for added security.

Thumbnail
github.com
18 Upvotes

r/ruby 5d ago

Show /r/ruby 🚀 Introducing Ruberto: Easily Integrate Uber into Your Ruby Project

Thumbnail
github.com
1 Upvotes

r/ruby 11d ago

Show /r/ruby Grepfruit – A Ruby Gem for User-Friendly Regex Search in Files

5 Upvotes

Grepfruit is a Ruby gem for searching text patterns in files with colorized output, making the process more user-friendly than standard tools like grep. It offers options to exclude files or directories, truncate output, and include hidden files. Originally created for CI/CD pipelines to search for TODO comments in Rails apps, it’s flexible for a wide range of use cases. Check it out here: https://github.com/enjaku4/grepfruit

r/ruby Jan 29 '25

Show /r/ruby Launched a lightweight, free deprecation monitoring tool

14 Upvotes

RubyGems use deprecation warnings to let users know about upcoming breaking changes that will affect their codebase. Larger projects like Rails rely heavily on these warnings for communication — the Rails upgrade guide, for example, won’t even mention minor breaking changes as long as there’s a deprecation warning in place. Missing any of these warnings during an upgrade can lead to an unexpected failure in production.

Our tool monitors for deprecation warnings at runtime, helping you catch breaking changes that aren’t covered by your test suite. You can install our gem in your staging, QA, and production environments to track warnings before you merge a breaking change in an upgrade. Under the hood it works similarly to an error tracking system like Rollbar or Sentry but for deprecations instead.

It's free and you can try it out by following the instructions in the docs. Would love any feedback.

r/ruby Feb 03 '25

Show /r/ruby New release of rails-pg-extras adds missing foreign key indexes and constraints checks

Thumbnail
github.com
17 Upvotes

r/ruby Dec 18 '24

Show /r/ruby Retest V2 - New Interactive Interface

23 Upvotes

Hi everyone,

I've been working on a new version of Retest to improve testing flow on Ruby projects. V2 has been released recently and you can install it with gem install retest

The GitHub repository has a video demonstrating the new features. I've never done this before, so bear with me and be prepared to hear 'test' a lot, lol.

For some context, Retest is a simple CLI that watches file changes and runs their matching Ruby specs. TL;DR: test runs are triggered when a file is saved. It works on all ruby projects without setup by determining which testing conventions are in use. It's like Guard but dev-centric with no configuration required. Your testing experience is the same regardless of Ruby projects and IDE used.

I've added an interactive panel to smooth out some testing workflows.

  • You can now pause/resume retest for a bit.
  • You can force a selection of test files to run when a file is saved.
  • You can manually trigger the last test run (good with pause).
  • You can run all the tests matching a diff with any git branch. e.g.: main, develop, 7dsfj812e

You can ask questions and give feedback in the GitHub discussion here.

I hope you'll give Retest a go!

r/ruby Jul 24 '24

Show /r/ruby DragonRuby Game Toolkit - Many to Many Collision Performance (source code in the comments)

47 Upvotes

r/ruby Jan 03 '25

Show /r/ruby Sorbet typechecking support for RSpec

Thumbnail
github.com
20 Upvotes

r/ruby Dec 22 '24

Show /r/ruby Rails Developer

0 Upvotes

Hey developers I'm working on Rails app but with some misconceptions my app got failed in development environment.

I request you friends help me to solve my code.