class Rake::InvocationChain

  1. lib/rake/invocation_chain.rb
Parent: Rake

                

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

Methods

Public Class

  1. new
  2. append

Public Instance

  1. member?
  2. append
  3. to_s

Private Instance

  1. prefix

Classes and Modules

  1. EmptyInvocationChain

Constants

EMPTY = EmptyInvocationChain.new  

Public Class methods

new (value, tail)
[show source]
    # File lib/rake/invocation_chain.rb, line 7
 7:     def initialize(value, tail)
 8:       @value = value
 9:       @tail = tail
10:     end
append (value, chain)
[show source]
    # File lib/rake/invocation_chain.rb, line 27
27:     def self.append(value, chain)
28:       chain.append(value)
29:     end

Public Instance methods

member? (obj)
[show source]
    # File lib/rake/invocation_chain.rb, line 12
12:     def member?(obj)
13:       @value == obj || @tail.member?(obj)
14:     end
append (value)
[show source]
    # 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
to_s ()
[show source]
    # File lib/rake/invocation_chain.rb, line 23
23:     def to_s
24:       "#{prefix}#{@value}"
25:     end

Private Instance methods

prefix ()
[show source]
    # File lib/rake/invocation_chain.rb, line 33
33:     def prefix
34:       "#{@tail.to_s} => "
35:     end