lib/nanoc/base/compilation/compiler.rb
def compile_rep(rep)
      Nanoc::NotificationCenter.post(:compilation_started, rep)
      Nanoc::NotificationCenter.post(:processing_started,  rep)
      Nanoc::NotificationCenter.post(:visit_started,       rep.item)

      # Calculate rule memory if we haven’t yet done do
      rules_collection.new_rule_memory_for_rep(rep)

      if !rep.item.forced_outdated? && !outdatedness_checker.outdated?(rep) && compiled_content_cache[rep]
        # Reuse content
        Nanoc::NotificationCenter.post(:cached_content_used, rep)
        rep.content = compiled_content_cache[rep]
      else
        # Recalculate content
        rep.snapshot(:raw)
        rep.snapshot(:pre, :final => false)
        rules_collection.compilation_rule_for(rep).apply_to(rep, :compiler => self)
        rep.snapshot(:post) if rep.has_snapshot?(:post)
        rep.snapshot(:last)
      end

      rep.compiled = true
      compiled_content_cache[rep] = rep.content

      Nanoc::NotificationCenter.post(:visit_ended,       rep.item)
      Nanoc::NotificationCenter.post(:processing_ended,  rep)
      Nanoc::NotificationCenter.post(:compilation_ended, rep)
    rescue => e
      rep.forget_progress
      Nanoc::NotificationCenter.post(:compilation_failed, rep, e)
      raise e
    end
# Compiles the given item representation.
#
# This method should not be called directly; please use
# {Nanoc::Compiler#run} instead, and pass this item representation's item
# as its first argument.
#
# @param [Nanoc::ItemRep] rep The rep that is to be compiled
#
# @return [void]
Compiles the given item representation.
This method should not be called directly; please use
{Nanoc::Compiler#run} instead, and pass this item representation's item
as its first argument.
Compiles the given item representation . This method should not be called directly ; please use { Nanoc :: Compiler#run } instead and pass this item representation ' s item as its first argument .
def compile_rep(rep)
      Nanoc::NotificationCenter.post(:compilation_started, rep)
      Nanoc::NotificationCenter.post(:processing_started,  rep)
      Nanoc::NotificationCenter.post(:visit_started,       rep.item)
      rules_collection.new_rule_memory_for_rep(rep)
      if !rep.item.forced_outdated? && !outdatedness_checker.outdated?(rep) && compiled_content_cache[rep]
        Nanoc::NotificationCenter.post(:cached_content_used, rep)
        rep.content = compiled_content_cache[rep]
      else
        rep.snapshot(:raw)
        rep.snapshot(:pre, :final => false)
        rules_collection.compilation_rule_for(rep).apply_to(rep, :compiler => self)
        rep.snapshot(:post) if rep.has_snapshot?(:post)
        rep.snapshot(:last)
      end
      rep.compiled = true
      compiled_content_cache[rep] = rep.content
      Nanoc::NotificationCenter.post(:visit_ended,       rep.item)
      Nanoc::NotificationCenter.post(:processing_ended,  rep)
      Nanoc::NotificationCenter.post(:compilation_ended, rep)
    rescue => e
      rep.forget_progress
      Nanoc::NotificationCenter.post(:compilation_failed, rep, e)
      raise e
    end
def compile_rep ( rep ) Nanoc :: NotificationCenter . post ( :compilation_started , rep ) Nanoc :: NotificationCenter . post ( :processing_started , rep ) Nanoc :: NotificationCenter . post ( :visit_started , rep . item ) rules_collection . new_rule_memory_for_rep ( rep ) if ! rep . item . forced_outdated? && ! outdatedness_checker . outdated? ( rep ) && compiled_content_cache [ rep ] Nanoc :: NotificationCenter . post ( :cached_content_used , rep ) rep . content = compiled_content_cache [ rep ] else rep . snapshot ( :raw ) rep . snapshot ( :pre , :final => false ) rules_collection . compilation_rule_for ( rep ) . apply_to ( rep , :compiler => self ) rep . snapshot ( :post ) if rep . has_snapshot? ( :post ) rep . snapshot ( :last ) end rep . compiled = true compiled_content_cache [ rep ] = rep . content Nanoc :: NotificationCenter . post ( :visit_ended , rep . item ) Nanoc :: NotificationCenter . post ( :processing_ended , rep ) Nanoc :: NotificationCenter . post ( :compilation_ended , rep ) rescue => e rep . forget_progress Nanoc :: NotificationCenter . post ( :compilation_failed , rep , e ) raise e end
Compiles the given item representation.
Compiles the given item representation .
# Calculate rule memory if we haven’t yet done do # Reuse content # Recalculate content
None
void
rep
rep The rep that is to be compiled
rep The rep that is to be compiled