ruby/did_you_mean
64.1
Adequate · 6 November 2026
982
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is the DidYouMean library, a Ruby gem that provides typo correction suggestions for various programming errors. It enhances standard error messages for NameError, NoMethodError, KeyError, and LoadError by suggesting likely correct identifiers, method names, hash keys, or file paths. The library utilizes optimized string distance algorithms like Levenshtein and Jaro-Winkler to generate these suggestions and is designed to be thread-safe via Ractor compatibility.
How it got here
2014–2015 — DidYouMean 2.0 architecture and Ractor support
10 changes.
This period focused on rewriting the DidYouMean gem's core architecture to version 2.0, introducing optimized spell-checking algorithms and a new class-based structure for various error types. Significant effort was dedicated to ensuring Ractor compatibility for concurrent environments and integrating suggestions directly into NameError messages. The work also included adding comprehensive benchmarking and evaluation tools to measure performance and accuracy.
2017–2022 — Test coverage and documentation expansion
8 changes.
This period focused on significantly expanding test coverage for the DidYouMean library, particularly for the TreeSpell module, spell-checking engines, and Ractor compatibility. It also involved adding comprehensive documentation for the TreeSpellChecker and introducing tooling to automate changelog generation.
Features
Add benchmarking scripts for memory usage, speed, and require path checking
New benchmark scripts have been added to the \benchmark\ directory to measure performance characteristics of the library. \memory\_usage.rb\ profiles memory consumption when correcting method names using \memory\_profiler\. \speed.yml\ provides a YAML-based benchmark configuration for comparing string distance algorithms (Jaro, Jaro Winkler, Levenshtein) and the SpellChecker's correction logic. \require\_path\_checker.rb\ benchmarks the performance of the RequirePathChecker when handling LoadErrors with and without slashes in the path.
benchmark · high confidence
Added Jaro-Winkler benchmark scripts for performance and memory profiling
New benchmark scripts have been added to the Jaro-Winkler module to allow users and developers to measure performance characteristics. The speed.rb script uses Benchmark::IPS to compare the current Jaro distance calculation against potential optimizations, while memory\_usage.rb utilizes MemoryProfiler to track memory consumption during repeated distance calculations. These tools provide a standardized way to evaluate the efficiency of the string similarity algorithm.
_benchmark/jaro\winkler · high confidence
Added documentation for TreeSpellChecker and changelog generation tooling
New documentation files have been added to the documentation/ directory, including API references for the TreeSpellChecker and HumanTypo components, and a detailed explanation of the TreeSpellChecker algorithm's accuracy and performance. Additionally, a changelog generation script (changelog\_generator.rb) and its ERB template (CHANGELOG.md.erb) were introduced to automate changelog creation from GitHub releases.
documentation · high confidence
Added evaluation tools to measure spell-checker accuracy
New scripts have been added to the evaluation directory to benchmark the spell checker's performance. The \calculator.rb\ script loads a dictionary and a set of known incorrect words (sourced from the Birkbeck Spelling Error Corpus) to calculate and report the accuracy of corrections, logging any failures to a timestamped file. The \dictionary\_generator.rb\ script fetches word lists from the Simple English Wiktionary API to populate the evaluation dictionary.
evaluation · high confidence
Behavioural changes
Deprecation of custom formatter require paths
Requiring specific formatter files like \did\_you\_mean/formatters/plain\_formatter\ or \did\_you\_mean/formatters/verbose\_formatter\ now emits a deprecation warning. Users should update their code to require \did\_you\_mean/formatter\ instead, as the verbose formatter now falls back to the default formatter for compatibility.
_lib/did\_you\mean/formatters · high confidence
DidYouMean gem version 2.0.0: New spell-checking architecture and removal of experimental features
The did\_you\_mean gem has been updated to version 2.0.0, introducing a complete rewrite of the spell-checking engine. The new architecture replaces the previous implementation with optimized Levenshtein and Jaro-Winkler distance algorithms, managed by a new SpellChecker class and a specialized TreeSpellChecker for hierarchical dictionaries. This change improves performance and accuracy for typo correction. Additionally, the gem has removed previously experimental features; requiring 'did\_you\_mean/experimental' or 'did\_you\_mean/verbose' now emits a deprecation warning and has no effect, and the instance method on the Formatter has been deprecated in favor of the class method.
_lib/did\_you\mean · high confidence
DidYouMean now supports Ractor and requires Ruby 2.8+ for require path suggestions
The DidYouMean library has been restructured to support Ractor, making the spell checker map shareable in concurrent contexts. Additionally, the require path suggestion feature is now enabled only for Ruby 2.8.0 and later, ensuring compatibility with older Ruby versions while maintaining robustness in modern environments.
lib · high confidence
Enhanced NameError messages with DidYouMean suggestions
NameError exceptions now automatically append helpful suggestions for misspelled constants or methods to their error messages. This change integrates the DidYouMean library directly into the NameError class, using the \detailed\_message\ method where available (Ruby 2.3+) or falling back to \to\_s\ for older versions, ensuring users see potential corrections without needing to parse complex stack traces. The implementation is optimized to avoid duplicate suggestions and handles edge cases where suggestions might fail gracefully.
_lib/did\_you\_mean/core\ext · high confidence
Refactored NameError spell checkers for Ractor compatibility and improved suggestions
The ClassNameChecker and VariableNameChecker have been rewritten to use the NameError receiver and local variables directly instead of parsing error messages or using bindings, making the spell-checking logic Ractor-compatible. VariableNameChecker now suggests reserved words (such as yield) and includes Ruby predefined objects in its dictionary, while also excluding specific false-positive suggestions. These changes improve the accuracy of 'Did you mean?' suggestions for undefined class and variable names and ensure the feature works correctly in concurrent Ruby environments.
_lib/did\_you\_mean/spell\_checkers/name\_error\checkers · high confidence
Restructured spell checkers with new KeyError and RequirePath support
The spell checking logic in \lib/did\_you\_mean/spell\_checkers\ has been reorganized into distinct checker classes. A new \KeyErrorChecker\ now provides typo suggestions for missing hash keys, and a \RequirePathChecker\ suggests correct file paths on \LoadError\. The \MethodNameChecker\ has been updated to exclude writer/reader suggestions from each other and to suggest Ruby reserved words when appropriate. Additionally, the \PatternKeyNameChecker\ (renamed from \NoMatchingPatternKeyErrorChecker\) handles typo suggestions for pattern matching keys, and the entire module structure has been adjusted to be Ractor-compatible.
_lib/did\_you\_mean/spell\checkers · high confidence
Test coverage
Add test helper for CoreAssertions; Added benchmarking scripts for Levenshtein distance; Added test coverage for the spell-checking suggestion engine; Added test fixtures for Ruby and RSpec project structures; Added test suite for DidYouMean spell checkers and Ractor compatibility; Added test suite for TreeSpell helper classes; Added tests for NameError and NoMethodError extensions.
Dependencies
Updated gemspec metadata and added development dependencies
The gemspec now specifies a minimum Ruby version of 2.5.0 and includes updated summary, description, and homepage metadata. Development dependencies have been added to the Gemfile, including benchmark-ips, benchmark\_driver, memory\_profiler, jaro\_winkler (\>= 1.4.0), test-unit, test-unit-ruby-core (\>= 1.0.7), and rake.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 64 (-0.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 75 → 75 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 51 → 51 (+0.0)
- Readiness 82 → 82 (+0.0)
- Security 94 → 90 (-3.9)
- Performance 100 → 100 (+0.0)
Resolved (1)
- Inconsistent naming for the primary correction operation. DidYouMean.correct_error implies a high-level orchestration or error-specific handling, while SpellChecker and TreeSpellChecker use the generic correct. This creates ambiguity about whether correct_error is a distinct operation or just a wrapper.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ruby/did_you_mean was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 6740bdcb2844541b46f5244c21adea8386a23607 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.