Exception: Thor::UnknownArgumentError

Inherits:
Error
  • Object
show all
Includes:
if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # rubocop:disable Naming/ConstantName if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # rubocop:disable Naming/ConstantName # In order to support versions of Ruby that don't have keyword # arguments, we need our own spell checker class that doesn't take key # words. Even though this code wouldn't be hit because of the check # above, it's still necessary because the interpreter would otherwise be # unable to parse the file. class NoKwargSpellChecker < DidYouMean::SpellChecker # :nodoc: def initialize(dictionary) @dictionary = dictionary end end Module.new do def to_s super + DidYouMean.formatter.message_for(corrections) end def corrections @corrections ||= self.class.const_get(:SpellChecker).new(self).corrections end end end
Defined in:
lib/thor/error.rb

Defined Under Namespace

Classes: SpellChecker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(switches, unknown) ⇒ UnknownArgumentError

Returns a new instance of UnknownArgumentError.


96
97
98
99
100
101
# File 'lib/thor/error.rb', line 96

def initialize(switches, unknown)
  @switches = switches
  @unknown = unknown

  super("Unknown switches #{unknown.map(&:inspect).join(', ')}")
end

Instance Attribute Details

#switchesObject (readonly)

Returns the value of attribute switches.


94
95
96
# File 'lib/thor/error.rb', line 94

def switches
  @switches
end

#unknownObject (readonly)

Returns the value of attribute unknown.


94
95
96
# File 'lib/thor/error.rb', line 94

def unknown
  @unknown
end