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.5.6 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.5 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.4 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.3 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.2 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.1 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.5.0 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.3.27 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.22 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.21 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.20 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.19 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.18 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.17 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.16 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.15 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.14 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.13 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.12 lib/rubygems/unknown_command_spell_checker.rb
rubygems-update-3.4.11 lib/rubygems/unknown_command_spell_checker.rb