Sha256: e2ffeb1d3d57e61f758349ede562d173c0273d07b7217a5c2ef5acc6be1cd230

Contents?: true

Size: 411 Bytes

Versions: 78

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

class Gem::UnknownCommandSpellChecker
  attr_reader :error

  def initialize(error)
    @error = error
  end

  def corrections
    @corrections ||=
      spell_checker.correct(error.unknown_command).map(&:inspect)
  end

  private

  def spell_checker
    dictionary = Gem::CommandManager.instance.command_names
    DidYouMean::SpellChecker.new(dictionary: dictionary)
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
rubygems-update-3.6.3 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.6.2 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.6.1 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.6.0 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.23 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.22 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.21 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.20 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.19 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.18 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.17 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.16 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.15 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.14 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.13 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.12 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.10 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.9 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.8 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.7 lib/rubygems/unknown_command_spell_checker.rb