lib/nanoc/base/compilation/outdatedness_checker.rb
def outdated_due_to_dependencies?(obj, processed=Set.new)
      # Convert from rep to item if necessary
      obj = obj.item if obj.type == :item_rep

      # Get from cache
      if @objects_outdated_due_to_dependencies.has_key?(obj)
        return @objects_outdated_due_to_dependencies[obj]
      end

      # Check processed
      # Don’t return true; the false will be or’ed into a true if there
      # really is a dependency that is causing outdatedness.
      return false if processed.include?(obj)

      # Calculate
      is_outdated = dependency_tracker.objects_causing_outdatedness_of(obj).any? do |other|
        other.nil? || basic_outdated?(other) || outdated_due_to_dependencies?(other, processed.merge([obj]))
      end

      # Cache
      @objects_outdated_due_to_dependencies[obj] = is_outdated

      # Done
      is_outdated
    end
# Checks whether the given object is outdated due to dependencies.
#
# @param [Nanoc::Item, Nanoc::ItemRep, Nanoc::Layout] obj The object
#   whose outdatedness should be checked.
#
# @param [Set] processed The collection of items that has been visited
#   during this outdatedness check. This is used to prevent checks for
#   items that (indirectly) depend on their own from looping
#   indefinitely. It should not be necessary to pass this a custom value.
#
# @return [Boolean] true if the object is outdated, false otherwise
Checks whether the given object is outdated due to dependencies.
Checks whether the given object is outdated due to dependencies .
def outdated_due_to_dependencies?(obj, processed=Set.new)
      obj = obj.item if obj.type == :item_rep
      if @objects_outdated_due_to_dependencies.has_key?(obj)
        return @objects_outdated_due_to_dependencies[obj]
      end
      return false if processed.include?(obj)
      is_outdated = dependency_tracker.objects_causing_outdatedness_of(obj).any? do |other|
        other.nil? || basic_outdated?(other) || outdated_due_to_dependencies?(other, processed.merge([obj]))
      end
      @objects_outdated_due_to_dependencies[obj] = is_outdated
      is_outdated
    end
def outdated_due_to_dependencies? ( obj , processed = Set . new ) obj = obj . item if obj . type == :item_rep if @objects_outdated_due_to_dependencies . has_key? ( obj ) return @objects_outdated_due_to_dependencies [ obj ] end return false if processed . include? ( obj ) is_outdated = dependency_tracker . objects_causing_outdatedness_of ( obj ) . any? do | other | other . nil? || basic_outdated? ( other ) || outdated_due_to_dependencies? ( other , processed . merge ( [ obj ] ) ) end @objects_outdated_due_to_dependencies [ obj ] = is_outdated is_outdated end
Checks whether the given object is outdated due to dependencies.
Checks whether the given object is outdated due to dependencies .
# Convert from rep to item if necessary # Get from cache # Check processed # Don’t return true; the false will be or’ed into a true if there # really is a dependency that is causing outdatedness. # Calculate # Cache # Done
true if the object is outdated, false otherwise
true if the object is outdated false otherwise
Boolean
obj
processed
new
processed The collection of items that has been visited during this outdatedness check. This is used to prevent checks for items that (indirectly) depend on their own from looping indefinitely. It should not be necessary to pass this a custom value.
processed The collection of items that has been visited during this outdatedness check . This is used to prevent checks for items that ( indirectly ) depend on their own from looping indefinitely . It should not be necessary to pass this a custom value .