class Rake::InvocationChain
InvocationChain
tracks the chain of task invocations to detect circular dependencies.
Constants
- EMPTY
Public Class Methods
append(value, chain)
click to toggle source
# File lib/rake/invocation_chain.rb 27 def self.append(value, chain) 28 chain.append(value) 29 end
new(value, tail)
click to toggle source
# File lib/rake/invocation_chain.rb 7 def initialize(value, tail) 8 @value = value 9 @tail = tail 10 end
Public Instance Methods
append(value)
click to toggle source
# File lib/rake/invocation_chain.rb 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)
click to toggle source
# File lib/rake/invocation_chain.rb 12 def member?(obj) 13 @value == obj || @tail.member?(obj) 14 end
to_s()
click to toggle source
# File lib/rake/invocation_chain.rb 23 def to_s 24 "#{prefix}#{@value}" 25 end
Private Instance Methods
prefix()
click to toggle source
# File lib/rake/invocation_chain.rb 33 def prefix 34 "#{@tail.to_s} => " 35 end