Exception: Tomo::Configuration::UnknownPluginError

Inherits:
Error
  • Object
show all
Defined in:
lib/tomo/configuration/unknown_plugin_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

raise_with

Methods included from Tomo::Colors

enabled?

Instance Attribute Details

#gem_nameObject

Returns the value of attribute gem_name.



6
7
8
# File 'lib/tomo/configuration/unknown_plugin_error.rb', line 6

def gem_name
  @gem_name
end

#known_pluginsObject

Returns the value of attribute known_plugins.



6
7
8
# File 'lib/tomo/configuration/unknown_plugin_error.rb', line 6

def known_plugins
  @known_plugins
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/tomo/configuration/unknown_plugin_error.rb', line 6

def name
  @name
end

Instance Method Details

#to_consoleObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/tomo/configuration/unknown_plugin_error.rb', line 8

def to_console
  error = <<~ERROR
    #{yellow(name)} is not a recognized plugin.
  ERROR

  sugg = Error::Suggestions.new(dictionary: known_plugins, word: name)
  error += sugg.to_console if sugg.any?

  error + gem_suggestion
end