Exception: Puppet::ModuleTool::Errors::NoCandidateReleasesError
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::NoCandidateReleasesError
- Defined in:
- lib/puppet/module_tool/errors/shared.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ NoCandidateReleasesError
constructor
A new instance of NoCandidateReleasesError.
- #multiline ⇒ Object
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ NoCandidateReleasesError
Returns a new instance of NoCandidateReleasesError.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 25 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
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 39 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 '%{version}' are available from %{source}") % { version: @requested_version, source: @source } end .join("\n") end |