ruby/did_you_mean
67.7
Adequate · 19 September 2026
982
lines of production code
Ruby
primary language
1
measurement 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 watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 68.
Lenses
- Code Health 99
- Architecture 69
- Maturity 56
- Readiness 80
- Security 93
Changes since last survey
- 300 commits — 270 feature/other, 30 fixes
By area
- lib/did_you_mean — 76 commits
- (root) — 65 commits
- (repo) — 55 commits
- .github/workflows — 19 commits
- test/spell_checking — 15 commits
- lib/did_you_mean.rb — 13 commits
- test/test_tree_spell_checker.rb — 9 commits
- test/core_ext — 8 commits
- test/test_ractor_compatibility.rb — 6 commits
- test/tree_spell — 5 commits
- test/tree_spell_checker_test.rb — 5 commits
- test/helper.rb — 3 commits
- test/lib — 3 commits
- test/test_verbose_formatter.rb — 3 commits
- evaluation/calculator.rb — 2 commits
- test/fixtures — 2 commits
- .github/dependabot.yml — 1 commit
- benchmark/jaro_winkler — 1 commit
- documentation/CHANGELOG.md.erb — 1 commit
- documentation/human_typo_api.md — 1 commit
Notable commits
- fix: Fix Leaked file descriptor in test/did_you_mean
- fix: Fix NoMethodError being dumpable with experimental
- fix: Fix frozen_string_literal is ignored after any tokens warning. (#172)
- fix: Fix build...
- fix: Fix builds
- fix: Fix failing tests
- fix: Fix https://github.com/ruby/ruby/runs/665672396\#step:14:21 by removing duplicates
- fix: Fix issue with array initialisation
- fix: Fix test
- fix: Fix test
- fix: Fix tests for JRuby
- fix: Fix up relative file paths for yml files
- fix: Fix verbose formatter test requirements
- fix: Fixed bug with rejecting correct value in spell checker. Fixed #121 (#134)
- fix: Fixed correction duplicates in VariableNameChecker
- fix: Fixes a bug where DYM suggests the same class name in the error message
- fix: Fixes a bug where name errors can not be dumped
- fix: Fixes a bug where suggestions are not shown on subsequent errors
- fix: Fixes bug where formatter= does not set anything
- fix: Fixes the compatibility with old versions
- …and 280 more
Written by watchdog.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 19 September 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.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.