Class: Rake::InvocationChain

Relationships & Source Files
Namespace Children
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, LinkedList
Instance Chain:
self, LinkedList, Enumerable
Inherits: Rake::LinkedList
Defined in: lib/rake/invocation_chain.rb


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

Constant Summary

LinkedList - Inherited


Class Method Summary

LinkedList - Inherited


Cons a new head onto the tail list.


The standard empty list class for the given LinkedList class.


Make a list out of the given arguments.


Instance Attribute Summary

LinkedList - Inherited


Is the list empty? .make guards against a list being empty making any instantiated LinkedList object not empty by default You should consider overriding this method if you implement your own .make method.

#head, #tail

Instance Method Summary

LinkedList - Inherited


Lists are structurally equivalent.


Polymorphically add a new element to the head of a list.


For each item in the list.


Same as #to_s, but with inspected items.


Convert to string: LL(item, item…).

Constructor Details

This class inherits a constructor from Rake::LinkedList

Class Method Details

.append(invocation, chain)

Class level append.

[ GitHub ]

# File 'lib/rake/invocation_chain.rb', line 28

def self.append(invocation, chain)

Instance Method Details


Append an invocation to the chain of invocations. It is an error if the invocation already listed.

[ GitHub ]

# File 'lib/rake/invocation_chain.rb', line 15

def append(invocation)
  if member?(invocation)
    fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}"

#member?(invocation) ⇒ Boolean

Is the invocation already in the chain?

[ GitHub ]

# File 'lib/rake/invocation_chain.rb', line 9

def member?(invocation)
  head == invocation || tail.member?(invocation)

#prefix (private)

[ GitHub ]

# File 'lib/rake/invocation_chain.rb', line 34

def prefix
  "#{tail} => "


Convert to string, ie: TOP => invocation => invocation

[ GitHub ]

# File 'lib/rake/invocation_chain.rb', line 23

def to_s