# File lib/nanoc/base/compilation/dependency_tracker.rb, line 48 def start # Initialize dependency stack. An object will be pushed onto this stack # when it is visited. Therefore, an object on the stack always depends # on all objects pushed above it. @stack = [] # Register start of visits Nanoc::NotificationCenter.on(:visit_started, self) do |obj| if !@stack.empty? Nanoc::NotificationCenter.post(:dependency_created, @stack.last, obj) self.record_dependency(@stack.last, obj) end @stack.push(obj) end # Register end of visits Nanoc::NotificationCenter.on(:visit_ended, self) do |obj| @stack.pop end end