Exception: Molinillo::CircularDependencyError

Inherits:
ResolverError
  • Object
show all
Defined in:
lib/molinillo/errors.rb

Overview

Note:

This exception will be thrown if and only if a Vertex is added to a DependencyGraph that has a DependencyGraph::Vertex#path_to? an existing DependencyGraph::Vertex

An error caused by attempting to fulfil a dependency that was circular

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vertices) ⇒ CircularDependencyError

Initializes a new error with the given circular vertices.

Parameters:



47
48
49
50
# File 'lib/molinillo/errors.rb', line 47

def initialize(vertices)
  super "There is a circular dependency between #{vertices.map(&:name).join(' and ')}"
  @dependencies = vertices.map { |vertex| vertex.payload.possibilities.last }.to_set
end

Instance Attribute Details

#dependenciesObject (readonly)

Set<Object>

the dependencies responsible for causing the error



42
43
44
# File 'lib/molinillo/errors.rb', line 42

def dependencies
  @dependencies
end