Exception: Puppet::ModuleTool::Errors::NotInstalledError Private
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::NotInstalledError
- 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
Instance Method Summary collapse
-
#initialize(options) ⇒ NotInstalledError
constructor
private
A new instance of NotInstalledError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ NotInstalledError
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 NotInstalledError.
149 150 151 152 153 154 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 149 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
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.
156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 156 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| # TRANSLATORS `puppet module %{action} %{suggestion}` is a command line and should not be translated _(" You may have meant `puppet module %{action} %{suggestion}`") % { action: @action, suggestion: suggestion } end # TRANSLATORS `puppet module install` is a command line and should not be translated << _(" Use `puppet module install` to install this module") if @action == :upgrade .join("\n") end |