Exception: Gem::UnknownCommandError

Inherits:
Exception
  • Object
show all
Defined in:
lib/rubygems/exceptions.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unknown_command) ⇒ UnknownCommandError



15
16
17
18
19
20
# File 'lib/rubygems/exceptions.rb', line 15

def initialize(unknown_command)
  self.class.attach_correctable

  @unknown_command = unknown_command
  super("Unknown command #{unknown_command}")
end

Instance Attribute Details

#unknown_commandObject (readonly)

Returns the value of attribute unknown_command.



13
14
15
# File 'lib/rubygems/exceptions.rb', line 13

def unknown_command
  @unknown_command
end

Class Method Details

.attach_correctableObject



22
23
24
25
26
27
28
# File 'lib/rubygems/exceptions.rb', line 22

def self.attach_correctable
  return if method_defined?(:corrections)

  if defined?(DidYouMean) && DidYouMean.respond_to?(:correct_error)
    DidYouMean.correct_error(Gem::UnknownCommandError, Gem::UnknownCommandSpellChecker)
  end
end