Class: Gem::UnknownCommandSpellChecker
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rubygems/unknown_command_spell_checker.rb |
Class Method Summary
- .new(error) ⇒ UnknownCommandSpellChecker constructor
Instance Attribute Summary
- #error readonly
Instance Method Summary
- #corrections
- #spell_checker private
Constructor Details
.new(error) ⇒ UnknownCommandSpellChecker
Instance Attribute Details
#error (readonly)
[ GitHub ]# File 'lib/rubygems/unknown_command_spell_checker.rb', line 4
attr_reader :error
Instance Method Details
#corrections
[ GitHub ]# File 'lib/rubygems/unknown_command_spell_checker.rb', line 10
def corrections @corrections ||= spell_checker.correct(error.unknown_command).map(&:inspect) end
#spell_checker (private)
[ GitHub ]# File 'lib/rubygems/unknown_command_spell_checker.rb', line 17
def spell_checker dictionary = Gem::CommandManager.instance.command_names DidYouMean::SpellChecker.new(dictionary: dictionary) end