Paste two versions of Ruby code, or drop .rb, .rake, Gemfile and Rakefile files, to see every change highlighted. Use it to review a Rails model change, compare two Gemfiles, or check a migration. Diffspot highlights Ruby syntax, marks changed words inside each line and recognizes moved blocks. Press Try an example to see it on a real Ruby change.
How to compare Ruby files
- Paste or drop the original Ruby code on the left.
- Paste or drop the changed version on the right. The diff updates as you type.
- Jump between changes with F7 and Shift+F7, or switch to Unified view to read it like a pull request.
- Copy or export a unified diff, a .patch file or an HTML report.
Ruby comparison tips
- Comparing RubySymbols, string interpolation and heredocs are highlighted.
- Cut the noiseGemfile.lock compares well as plain text; unchanged gems collapse so the version bumps stand out.
- Your code stays privateThe comparison runs on your device in WebAssembly. Proprietary code is never uploaded or stored.
- Fast on large filesFiles with hundreds of thousands of lines compare in about a second.
Frequently asked questions
Is Ruby detected automatically?
Yes. Diffspot recognizes Ruby from the file name (.rb, .rake, Gemfile and Rakefile) or from the code itself. You can also choose it in the Syntax menu.
Is my code uploaded?
No. The page loads the diff engine once; after that your code stays in the browser tab. How Diffspot works explains how you can check this yourself.
Can I get a patch file?
Yes. Export → Download .patch creates a standard unified diff that git apply or patch can apply.