Exception: Puppet::ModuleTool::Errors::InvalidDependencyCycleError Private
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::InvalidDependencyCycleError
- 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) ⇒ InvalidDependencyCycleError
constructor
private
A new instance of InvalidDependencyCycleError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ InvalidDependencyCycleError
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 InvalidDependencyCycleError.
104 105 106 107 108 109 110 111 112 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 104 def initialize() @module_name = [:module_name] @requested_module = [:requested_module] @requested_version = [:requested_version] @conditions = [:conditions] @source = [:source][1..] super _("'%{module_name}' (%{version}) requested; Invalid dependency cycle") % { module_name: @requested_module, version: v(@requested_version) } 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.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 114 def multiline dependency_list = [] dependency_list << _("You specified '%{name}' (%{version})") % { name: @source.first[:name], version: v(@requested_version) } dependency_list += @source[1..].map do |m| # TRANSLATORS This message repeats as separate lines as a list under the heading "You specified '%{name}' (%{version})\n" _("This depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) } end = [] << _("Could not install module '%{module_name}' (%{version})") % { module_name: @requested_module, version: v(@requested_version) } << _(" No version of '%{module_name}' will satisfy dependencies") % { module_name: @module_name } << dependency_list.map { |s| " #{s}".join(",\n") } # TRANSLATORS `puppet module install --force` is a command line and should not be translated << _(" Use `puppet module install --force` to install this module anyway") .join("\n") end |