About

Professional Ruby developer with more than a decade of experience.

I work with Ruby web applications at any stage, whether that means building something new, extending an existing system, or keeping it running smoothly. I prefer practical solutions over clever ones, and aim to leave codebases cleaner and more maintainable than I found them.

Primarily Rails, but comfortable with other Ruby stacks. Based in Sweden, working remotely with clients in Europe and beyond.

Open Source

RABARBER

GitHub stars

Simple yet flexible role-based authorization for Ruby on Rails with comprehensive role management and multi-tenancy support.


VERI

GitHub stars

Minimalistic cookie-based authentication for Ruby on Rails with granular session management, user impersonation, and multi-tenancy support.


GREPFRUIT

GitHub stars

Fast parallel regex search across files powered by Ruby Ractors, available as a programmatic API and CLI.


KREDS

GitHub stars

Rails credentials access with blank value detection and clear human-readable error messages.

Blog

← Back to articles

Grepfruit v3.2: Programmatic API for Text Search

January 3, 2026

Grepfruit, a ractor-powered text search gem, adds a programmatic API in v3.2, a count-only mode, and Ruby 4 support.

What's new?

Programmatic API

The gem can now be used programmatically directly in Ruby applications:

Grepfruit.search(
  regex: /TODO/, 
  path: "spec/test_dataset", 
  exclude: ["foo.md", "baz.py"]
)
# returns =>
{
  search: {
    pattern: /TODO/,
    directory: "/Users/enjaku/Development/grepfruit/spec/test_dataset",
    exclusions: ["foo.md", "baz.py"],
    inclusions: []
  },
  summary: {
    files_checked: 2,
    files_with_matches: 2,
    total_matches: 4
  },
  matches: [
    {file: "bar.txt", line: 3, content: "TODO: Fix the alignment issue in the header."},
    {file: "bar.txt", line: 7, content: "TODO: Update the user permissions module."},
    {file: "bar.txt", line: 14, content: "TODO: Review the new design specifications."},
    {file: "folder/bad.yml", line: 21, content: "# TODO: Add configuration for cache settings"}
  ]
}

All CLI options are available as keyword arguments, and the API returns structured data that should be easy to work with in Ruby scripts.

Count-only mode

Use the --count flag (or count: true in the API) to show only match statistics without displaying the actual matches.

Ruby 4 support

Grepfruit now supports Ruby 4 and its updated Ractor implementation.

Check out the gem here.

Contact