class Nanoc::Core::PostCompileItemRepView

Public Instance Methods

compiled_content(snapshot: nil) click to toggle source
# File lib/nanoc/core/post_compile_item_rep_view.rb, line 10
def compiled_content(snapshot: nil)
  compilation_context = @context.compilation_context
  snapshot_contents = compilation_context.compiled_content_cache[_unwrap] || {}

  snapshot_name = snapshot || (snapshot_contents[:pre] ? :pre : :last)

  unless snapshot_contents[snapshot_name]
    raise Nanoc::Core::Errors::NoSuchSnapshot.new(_unwrap, snapshot_name)
  end

  content = snapshot_contents[snapshot_name]
  if content.binary?
    raise Nanoc::Core::Errors::CannotGetCompiledContentOfBinaryItem.new(_unwrap)
  end

  content.string
end
item_view_class() click to toggle source
# File lib/nanoc/core/post_compile_item_rep_view.rb, line 6
def item_view_class
  Nanoc::Core::PostCompileItemView
end
raw_path(snapshot: :last) click to toggle source
# File lib/nanoc/core/post_compile_item_rep_view.rb, line 28
def raw_path(snapshot: :last)
  @item_rep.raw_path(snapshot: snapshot)
end