Class
Rake::InvocationChain
In: lib/rake/invocation_chain.rb
Parent: Object

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

Methods

append, append, member?, new, to_s,
Classes and Modules

Class Rake::InvocationChain::EmptyInvocationChain

Public Class methods
append(value, chain)
    # File lib/rake/invocation_chain.rb, line 27
27:     def self.append(value, chain)
28:       chain.append(value)
29:     end
new(value, tail)
    # File lib/rake/invocation_chain.rb, line 7
 7:     def initialize(value, tail)
 8:       @value = value
 9:       @tail = tail
10:     end
Public Instance methods
append(value)
    # File lib/rake/invocation_chain.rb, line 16
16:     def append(value)
17:       if member?(value)
18:         fail RuntimeError, "Circular dependency detected: #{to_s} => #{value}"
19:       end
20:       self.class.new(value, self)
21:     end
member?(obj)
    # File lib/rake/invocation_chain.rb, line 12
12:     def member?(obj)
13:       @value == obj || @tail.member?(obj)
14:     end
to_s()
    # File lib/rake/invocation_chain.rb, line 23
23:     def to_s
24:       "#{prefix}#{@value}"
25:     end