Class: Rake::InvocationChain
- Inherits:
-
Object
- Object
- Rake::InvocationChain
show all
- Defined in:
- lib/rake.rb
Overview
InvocationChain tracks the chain of task invocations to detect circular dependencies.
Defined Under Namespace
Classes: EmptyInvocationChain
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of InvocationChain.
391
392
393
394
|
# File 'lib/rake.rb', line 391
def initialize(value, tail)
@value = value
@tail = tail
end
|
Class Method Details
.append(value, chain) ⇒ Object
411
412
413
|
# File 'lib/rake.rb', line 411
def self.append(value, chain)
chain.append(value)
end
|
Instance Method Details
#append(value) ⇒ Object
400
401
402
403
404
405
|
# File 'lib/rake.rb', line 400
def append(value)
if member?(value)
fail RuntimeError, "Circular dependency detected: #{to_s} => #{value}"
end
self.class.new(value, self)
end
|
#member?(obj) ⇒ Boolean
396
397
398
|
# File 'lib/rake.rb', line 396
def member?(obj)
@value == obj || @tail.member?(obj)
end
|
#to_s ⇒ Object
407
408
409
|
# File 'lib/rake.rb', line 407
def to_s
"#{prefix}#{@value}"
end
|