123456789_123456789_123456789_123456789_123456789_

Class: Bundler::Thor::UnknownArgumentError::SpellChecker

Relationships & Source Files
Inherits: Object
Defined in: lib/bundler/vendor/thor/lib/thor/error.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(error) ⇒ SpellChecker

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 69

def initialize(error)
  @error = error
end

Instance Attribute Details

#error (readonly)

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 67

attr_reader :error

Instance Method Details

#corrections

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 73

def corrections
  @corrections ||=
    error.unknown.flat_map { |unknown| spell_checker.correct(unknown) }.uniq.map(&:inspect)
end

#spell_checker

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 78

def spell_checker
  @spell_checker ||= DidYouMean::SpellChecker.new(dictionary: error.switches)
end