Skip to content

aim2bpg/rubree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

963 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Deploy Coverage Code to Test Ratio Test Execution Time

Rubree

A Ruby-based regular expression editor.

Inspired by: https://rubular.com

Site View

Usage

Rubree usage demo

Step Action What happens
1 Click Get started Opens the Terms of Service modal
2 Click Agree and Start Boots the Ruby WASM runtime (~10 s on first visit)
3 Enter a regex in Your regular expression Railroad diagram renders instantly
4 Enter text in Your test string Matches are highlighted in real time
5 Click 🔍 on the diagram Enlarge the railroad diagram in a modal
6 Enter \1! in Substitution Preview substitution result (hello! world! foo)
7 Click the share icon (↗) Copies a permalink to clipboard

Technology stack

⚙️ Backend

🎨 Frontend

  • Hotwire for building the frontend without using much JavaScript by sending HTML instead of JSON over the wire
  • TailwindCSS to not have to write CSS at all
  • RailroadDiagrams a tiny Ruby+SVG library for drawing railroad syntax diagrams like JSON.org

🛠️ Development

  • Foreman for jsbundling-rails, cssbundling-rails
  • Lefthook Fast and powerful Git hooks manager for any type of projects
  • Dev Containers reproducible development environment via .devcontainer/
  • Claude Code AI coding agent for development assistance

🧹 Linting and testing

  • Rubocop the Ruby Linter/Formatter that Serves and Protects
  • ERB Lint Lint your ERB or HTML files
  • Biome Format, lint, and more in a fraction of a second
  • RSpec for Ruby testing
  • Playwright for E2E testing
  • Octocov octocov is a toolkit for collecting code metrics

🚀 Build and Deployment

  • Wasmify Rails — Build Rails apps into WebAssembly so the application can run in the browser
  • GitHub Pages — Host the generated static site (Wasm bundles and assets) as the deployment target

🤖 Shift-left security

  • Dependabot automated dependency updates built into GitHub
  • Gitleaks Find secrets with Gitleaks
  • Brakeman a static analysis security vulnerability scanner for Ruby on Rails applications

▶️ CI/CD Tool

  • GitHub Actions for testing, linting, and building web application and deploy to GitHub Pages

Getting started

git clone https://github.com/aim2bpg/rubree.git
cd rubree
bin/setup

Then open http://localhost:3000 in your browser.

For Dev Container setup, linting, running tests against different browser drivers, and testing the WASM deployment locally, see Development Guide.

For an annotated walkthrough of every feature, see Usage Guide.

Browser Compatibility

Rubree currently supports Chrome and Edge only.

Why are Safari and Firefox not supported?

Safari and Firefox have compatibility limitations with Ruby WebAssembly (Wasmify Rails):

  • Safari: Ruby Wasm crashes during execution due to WebAssembly asyncify incompatibility

    • Error: RangeError: Maximum call stack size exceeded
    • The Ruby WebAssembly runtime crashes when trying to initialize Rails
  • Firefox: Service Worker script evaluation fails

    • Error: TypeError: ServiceWorker script evaluation failed
    • The Service Worker script cannot be evaluated in Firefox's stricter module evaluation

These are fundamental limitations of how Safari and Firefox handle WebAssembly features required by Wasmify Rails. For more details, see wasmify-rails Issue #7.

When accessing Rubree from Safari or Firefox, you will see a warning banner with detailed console error logs for troubleshooting.

Roadmap

Rubree already covers the core editing/visualization/sharing experience — pattern matching, capture groups, railroad diagrams, substitution preview, Ruby code snippets, permalinks, and ReDoS checks. For the full feature checklist and the supported Regexp::Parser syntax scope used for railroad diagram generation, see Roadmap.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/aim2bpg/rubree

License

This project is licensed under the MIT License, see the LICENSE file for details

Articles & Announcements