Class: Nanoc::CompilationItemRepView

Inherits:
BasicItemRepView show all
Defined in:
lib/nanoc/base/views/compilation_item_rep_view.rb

Instance Method Summary collapse

Methods inherited from BasicItemRepView

#==, #eql?, #hash, #inspect, #item, #name, #path, #snapshot?

Methods inherited from View

#frozen?, #inspect

Instance Method Details

#compiled_content(snapshot: nil) ⇒ String

Returns the compiled content.

Parameters:

  • snapshot (String)

    The name of the snapshot from which to fetch the compiled content. By default, the returned compiled content will be the content compiled right before the first layout call (if any).

Returns:

  • (String)

    The content at the given snapshot.



37
38
39
40
# File 'lib/nanoc/base/views/compilation_item_rep_view.rb', line 37

def compiled_content(snapshot: nil)
  @context.dependency_tracker.bounce(unwrap.item, compiled_content: true)
  @context.snapshot_repo.compiled_content(rep: unwrap, snapshot: snapshot)
end

#item_view_classObject

This method is abstract.


6
7
8
# File 'lib/nanoc/base/views/compilation_item_rep_view.rb', line 6

def item_view_class
  Nanoc::CompilationItemView
end

#raw_path(snapshot: :last) ⇒ String

Returns the item rep’s raw path. It includes the path to the output directory and the full filename.

Parameters:

  • snapshot (Symbol)

    The snapshot for which the path should be returned.

Returns:

  • (String)

    The item rep’s raw path.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/nanoc/base/views/compilation_item_rep_view.rb', line 17

def raw_path(snapshot: :last)
  @context.dependency_tracker.bounce(unwrap.item, compiled_content: true)

  res = @item_rep.raw_path(snapshot: snapshot)

  unless @item_rep.compiled?
    Fiber.yield(Nanoc::Int::Errors::UnmetDependency.new(@item_rep))
  end

  res
end