类 Rake::InvocationChain

InvocationChain 跟踪任务调用的链,以检测循环依赖。

常量

EMPTY

公共类方法

append(invocation, chain) 点击以切换源代码

类级别的 append。

# File rake-13.2.1/lib/rake/invocation_chain.rb, line 28
def self.append(invocation, chain)
  chain.append(invocation)
end

公共实例方法

append(invocation) 点击以切换源代码

将调用附加到调用链中。如果该调用已在列表中,则会出错。

# File rake-13.2.1/lib/rake/invocation_chain.rb, line 15
def append(invocation)
  if member?(invocation)
    fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}"
  end
  conj(invocation)
end
member?(invocation) 点击以切换源代码

该调用是否已在链中?

# File rake-13.2.1/lib/rake/invocation_chain.rb, line 9
def member?(invocation)
  head == invocation || tail.member?(invocation)
end
to_s() 点击以切换源代码

转换为字符串,例如:TOP => invocation => invocation

# File rake-13.2.1/lib/rake/invocation_chain.rb, line 23
def to_s
  "#{prefix}#{head}"
end

私有实例方法

prefix() 点击以切换源代码
# File rake-13.2.1/lib/rake/invocation_chain.rb, line 34
def prefix
  "#{tail} => "
end