Exception: Puppet::ModuleTool::Errors::InvalidModuleNameError Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ InvalidModuleNameError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InvalidModuleNameError.



132
133
134
135
136
137
# File 'lib/puppet/module_tool/errors/shared.rb', line 132

def initialize(options)
  @module_name = options[:module_name]
  @suggestion = options[:suggestion]
  @action = options[:action]
  super _("Could not %{action} '%{module_name}', did you mean '%{suggestion}'?") % { action: @action, module_name: @module_name, suggestion: @suggestion }
end

Instance Method Details

#multilineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}'") % { action: @action, module_name: @module_name }
  message << _("  The name '%{module_name}' is invalid") % { module_name: @module_name }
  message << _("    Did you mean `puppet module %{action} %{suggestion}`?") % { action: @action, suggestion: @suggestion }
  message.join("\n")
end