class Rake::InvocationChain

circular dependencies.
InvocationChain tracks the chain of task invocations to detect

def self.append(invocation, chain)

Class level append.
def self.append(invocation, chain)
  chain.append(invocation)
end

def append(invocation)

if the invocation already listed.
Append an invocation to the chain of invocations. It is an error
def append(invocation)
  if member?(invocation)
    fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}"
  end
  conj(invocation)
end

def member?(invocation)

Is the invocation already in the chain?
def member?(invocation)
  head == invocation || tail.member?(invocation)
end

def prefix

def prefix
  "#{tail} => "
end

def to_s

Convert to string, ie: TOP => invocation => invocation
def to_s
  "#{prefix}#{head}"
end