Exception: Puppet::ModuleTool::Errors::MultipleInstalledError

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) ⇒ MultipleInstalledError

Returns a new instance of MultipleInstalledError.



79
80
81
82
83
84
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 79

def initialize(options)
  @module_name = options[:module_name]
  @modules     = options[:installed_modules]
  @action      = options[:action]
  super "Could not #{@action} '#{@module_name}'; module appears in multiple places in the module path"
end

Instance Method Details

#multilineObject



86
87
88
89
90
91
92
93
94
95
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 86

def multiline
  message = []
  message << "Could not #{@action} module '#{@module_name}'"
  message << "  Module '#{@module_name}' appears multiple places in the module path"
  message += @modules.map do |mod|
    "    '#{@module_name}' (#{v(mod.version)}) was found in #{mod.modulepath}"
  end
  message << "    Use the `--modulepath` option to limit the search to specific directories"
  message.join("\n")
end