Exception: Puppet::ModuleTool::Errors::NoCandidateReleasesError Private
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::NoCandidateReleasesError
- 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) ⇒ NoCandidateReleasesError
constructor
private
A new instance of NoCandidateReleasesError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ NoCandidateReleasesError
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 NoCandidateReleasesError.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 41 def initialize() @module_name = [:module_name] @requested_version = [:requested_version] @installed_version = [:installed_version] @source = [:source] @action = [:action] if @requested_version == :latest super _("Could not %{action} '%{module_name}'; no releases are available from %{source}") % { action: @action, module_name: @module_name, source: @source } else super _("Could not %{action} '%{module_name}'; no releases matching '%{version}' are available from %{source}") % { action: @action, module_name: @module_name, version: @requested_version, source: @source } end 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.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 55 def multiline = [] << _("Could not %{action} '%{module_name}' (%{version})") % { action: @action, module_name: @module_name, version: vstring } if @requested_version == :latest << _(" No releases are available from %{source}") % { source: @source } << _(" Does '%{module_name}' have at least one published release?") % { module_name: @module_name } else << _(" No releases matching '%{requested_version}' are available from %{source}") % { requested_version: @requested_version, source: @source } end .join("\n") end |