InvocationChain tracks the chain of task invocations to detect circular dependencies.
Methods
Classes and Modules
Class Rake::InvocationChain::EmptyInvocationChainConstants
| EMPTY | = | EmptyInvocationChain.new |
Public Class methods
[ show source ]
# File lib/rake.rb, line 369
369: def self.append(value, chain)
370: chain.append(value)
371: end
[ show source ]
# File lib/rake.rb, line 349
349: def initialize(value, tail)
350: @value = value
351: @tail = tail
352: end
Public Instance methods
[ show source ]
# File lib/rake.rb, line 358
358: def append(value)
359: if member?(value)
360: fail RuntimeError, "Circular dependency detected: #{to_s} => #{value}"
361: end
362: self.class.new(value, self)
363: end
[ show source ]
# File lib/rake.rb, line 354
354: def member?(obj)
355: @value == obj || @tail.member?(obj)
356: end
[ show source ]
# File lib/rake.rb, line 365
365: def to_s
366: "#{prefix}#{@value}"
367: end