class Nanoc::Core::DependencyTracker

@api private

Constants

C_ARGS
C_ATTR
C_OBJ
C_RAW_CONTENT

Attributes

dependency_store[R]

Public Class Methods

new(dependency_store) click to toggle source
# File lib/nanoc/core/dependency_tracker.rb, line 39
def initialize(dependency_store)
  @dependency_store = dependency_store
  @stack = []
end

Public Instance Methods

bounce(obj, raw_content: false, attributes: false, compiled_content: false, path: false) click to toggle source
# File lib/nanoc/core/dependency_tracker.rb, line 67
def bounce(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
  enter(obj, raw_content: raw_content, attributes: attributes, compiled_content: compiled_content, path: path)
  exit
end
enter(obj, raw_content: false, attributes: false, compiled_content: false, path: false) click to toggle source
# File lib/nanoc/core/dependency_tracker.rb, line 45
def enter(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
  unless @stack.empty?
    Nanoc::Core::NotificationCenter.post(:dependency_created, @stack.last, obj)
    @dependency_store.record_dependency(
      @stack.last,
      obj,
      raw_content: raw_content,
      attributes: attributes,
      compiled_content: compiled_content,
      path: path,
    )
  end

  @stack.push(obj)
end
exit() click to toggle source
# File lib/nanoc/core/dependency_tracker.rb, line 62
def exit
  @stack.pop
end