Exception: Puppet::ModuleTool::Errors::NotInstalledError
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::NotInstalledError
- Defined in:
- lib/puppet/module_tool/errors/shared.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ NotInstalledError
constructor
A new instance of NotInstalledError.
- #multiline ⇒ Object
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ NotInstalledError
Returns a new instance of NotInstalledError.
116 117 118 119 120 121 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 116 def initialize() @module_name = [:module_name] @suggestions = [:suggestions] || [] @action = [:action] super _("Could not %{action} '%{module_name}'; module is not installed") % { action: @action, module_name: @module_name } end |
Instance Method Details
#multiline ⇒ Object
123 124 125 126 127 128 129 130 131 132 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 123 def multiline = [] << _("Could not %{action} module '%{module_name}'") % { action: @action, module_name: @module_name } << _(" Module '%{module_name}' is not installed") % { module_name: @module_name } += @suggestions.map do |suggestion| _(" You may have meant `puppet module %{action} %{suggestion}`") % { action: @action, suggestion: suggestion } end << _(" Use `puppet module install` to install this module") if @action == :upgrade .join("\n") end |