# class Puppet::ModuleTool::Errors::InvalidDependencyCycleError

### Public Class Methods

new(options) click to toggle source
Calls superclass method Puppet::Error.new

    # File lib/puppet/module_tool/errors/shared.rb, line 33
    def initialize(options)
      @module_name       = options[:module_name]
      @requested_module  = options[:requested_module]
      @requested_version = options[:requested_version]
      @conditions        = options[:conditions]
      @source            = options[:source][1..-1]

      super "'#{@requested_module}' (#{v(@requested_version)}) requested; Invalid dependency cycle"
    end

### Public Instance Methods

multiline() click to toggle source

    # File lib/puppet/module_tool/errors/shared.rb, line 43
    def multiline
      trace = []
      trace << "You specified '#{@source.first[:name]}' (#{v(@requested_version)})"
      trace += @source[1..-1].map { |m| "which depends on '#{m[:name]}' (#{v(m[:version])})" }

      message = []
      message << "Could not install module '#{@requested_module}' (#{v(@requested_version)})"
      message << "  No version of '#{@module_name}' will satisfy dependencies"
      message << trace.map { |s| "    #{s}" }.join(",\n")
      message << "    Use `puppet module install --force` to install this module anyway"

      message.join("\n")
    end