Hacker News new | ask | show | jobs
by timr 4254 days 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...

and it works by extending the NameError exception:

https://www.omniref.com/ruby/gems/did_you_mean/0.6.0/files/l...

1 comments

The 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-...