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

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

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ MultipleInstalledError


138
139
140
141
142
143
144
# File 'lib/puppet/module_tool/errors/shared.rb', line 138

def initialize(options)
  @module_name = options[:module_name]
  @modules     = options[:installed_modules]
  @action      = options[:action]
  #TRANSLATORS "module path" refers to a set of directories where modules may be installed
  super _("Could not %{action} '%{module_name}'; module appears in multiple places in the module path") % { action: @action, module_name: @module_name }
end

Instance Method Details

#multilineObject


146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/puppet/module_tool/errors/shared.rb', line 146

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}'") % { action: @action, module_name: @module_name }
  message << _("  Module '%{module_name}' appears multiple places in the module path") % { module_name: @module_name }
  message += @modules.map do |mod|
    #TRANSLATORS This is repeats as separate lines as a list under "Module '%{module_name}' appears multiple places in the module path"
    _("    '%{module_name}' (%{version}) was found in %{path}") % { module_name: @module_name, version: v(mod.version), path: mod.modulepath }
  end
  #TRANSLATORS `--modulepath` is command line option and should not be translated
  message << _("    Use the `--modulepath` option to limit the search to specific directories")
  message.join("\n")
end