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.
410
411
412
413
|
# File 'lib/rake.rb', line 410
def initialize(value, tail)
@value = value
@tail = tail
end
|
Class Method Details
.append(value, chain) ⇒ Object
430
431
432
|
# File 'lib/rake.rb', line 430
def self.append(value, chain)
chain.append(value)
end
|
Instance Method Details
#append(value) ⇒ Object
419
420
421
422
423
424
|
# File 'lib/rake.rb', line 419
def append(value)
if member?(value)
fail RuntimeError, "Circular dependency detected: #{to_s} => #{value}"
end
self.class.new(value, self)
end
|
#member?(obj) ⇒ Boolean
415
416
417
|
# File 'lib/rake.rb', line 415
def member?(obj)
@value == obj || @tail.member?(obj)
end
|
#to_s ⇒ Object
426
427
428
|
# File 'lib/rake.rb', line 426
def to_s
"#{prefix}#{@value}"
end
|