123456789_123456789_123456789_123456789_123456789_

Class: Bundler::Thor::UndefinedCommandError::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 28

def initialize(error)
  @error = error
end

Instance Attribute Details

#error (readonly)

[ GitHub ]

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

attr_reader :error

Instance Method Details

#corrections

[ GitHub ]

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

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

#spell_checker

[ GitHub ]

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

def spell_checker
  DidYouMean::SpellChecker.new(dictionary: error.all_commands)
end