In Files

  • ruby-3.1.2/lib/rubygems/unknown_command_spell_checker.rb

Files

Class/Module Index [+]

Quicksearch

Gem::UnknownCommandSpellChecker

Attributes

error[R]

Public Class Methods

new(error) click to toggle source
 
               # File ruby-3.1.2/lib/rubygems/unknown_command_spell_checker.rb, line 6
def initialize(error)
  @error = error
end
            

Public Instance Methods

corrections() click to toggle source
 
               # File ruby-3.1.2/lib/rubygems/unknown_command_spell_checker.rb, line 10
def corrections
  @corrections ||=
    spell_checker.correct(error.unknown_command).map(&:inspect)
end
            

Private Instance Methods

spell_checker() click to toggle source
 
               # File ruby-3.1.2/lib/rubygems/unknown_command_spell_checker.rb, line 17
def spell_checker
  dictionary = Gem::CommandManager.instance.command_names
  DidYouMean::SpellChecker.new(dictionary: dictionary)
end