The gem that has been saving people from typos since 2014
This version 1.2.0 only has support for Ruby 2.5.0 and later as it uses new features that are only available in 2.5. All future patch releases under 1.2.* will only be compatible with Ruby 2.5.0 and later as well. Versions earlier than 1.1.* will still be maintained until Ruby 2.4 is deprecated. Any other versions below 1.0 will no longer be maintained.
KeyError
name suggestion feature has been promoted to a stable feature and is available by default (acf59450dfb67eefae9b465ccc8029af46ae7dd0, https://bugs.ruby-lang.org/issues/12063)true
, false
or nil
if a NameError occurs because of a typo in these names (#94, @styd)The version 1.1.0
only has support for Ruby 2.4.0 and later. All patch releases under 1.1.*
will only be compatible with Ruby 2.4.0 and later as well. Versions earlier than 1.0.*
will still be maintained until Ruby 2.3 is deprecated. Any other versions below 1.0
will no longer be maintained.
Suggest a method name on a NameError from the Struct#[]
or Struct#[]=
method (https://github.com/yuki24/did_you_mean/pull/73):
Struct.new(:foo).new[:fooo]
# => NameError: no member 'fooo' in struct
# Did you mean? foo
# foo=
Added a public interface for the gem's spell checker:
DidYouMean::SpellChecker.new(dictionary: ['email', 'fail', 'eval']).correct('meail')
# => ['email']
Methods defined on nil
by default are no longer suggested. Note that methods, defined after the gem is loaded, will still be suggested (e.g. ActiveSupport).
NoMethodError#private_call?
method instead (0a1b7612252055e583a373b473932f789381ca0f)This version is only compatible with Ruby 2.3 and later.
require 'did_you_mean/experimental'
require 'did_you_mean/extra_features'
is now deprecated in favor of require 'did_you_mean/experimental'
DidYouMean::SpellCheckable
module with the DidYouMean::SpellChecker
class. This is a slower implementation but close to the model explained in this talk, more reusable and possibly makes it easier to expose the class as a public interface.This version is only compatible with Ruby 2.3 and later.
NameError#receiver
method has become part of the MRI 2.3This version is only compatible with Ruby 2.3 and later.