Exception: Puppet::ModuleTool::Errors::NotInstalledError

Inherits:
ModuleToolError show all
Defined in:
lib/vendor/puppet/module_tool/errors/shared.rb

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ NotInstalledError

Returns a new instance of NotInstalledError.



59
60
61
62
63
64
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 59

def initialize(options)
  @module_name = options[:module_name]
  @suggestions = options[:suggestions] || []
  @action      = options[:action]
  super "Could not #{@action} '#{@module_name}'; module is not installed"
end

Instance Method Details

#multilineObject



66
67
68
69
70
71
72
73
74
75
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 66

def multiline
  message = []
  message << "Could not #{@action} module '#{@module_name}'"
  message << "  Module '#{@module_name}' is not installed"
  message += @suggestions.map do |suggestion|
    "    You may have meant `puppet module #{@action} #{suggestion}`"
  end
  message << "    Use `puppet module install` to install this module" if @action == :upgrade
  message.join("\n")
end