2 ms·
Neat. In case you're wondering, it's implemented using a levenshtein distance algorithm: https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/symbols/DidYouMea
by timr 12y ago
Neat. In case you're wondering, it's implemented using a levenshtein distance algorithm:
https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/symbols/DidYouMean::MethodMatcher/similar_methods https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/symbols...
and it works by extending the NameError exception:
https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/files/lib/did_you_mean/core_ext/name_error.rb https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/files/l...
- lucaspiller 12y agoThe close_enough gem takes this one step further and uses this to 'patch' method_missing: http://decomplecting.org/blog/2013/03/01/code-typos-got-you-down-stop-worrying-with-close-enough/ http://decomplecting.org/blog/2013/03/01/code-typos-got-you-...