lib/nanoc/base/views/item_rep.rb in nanoc-4.0.0b3 vs lib/nanoc/base/views/item_rep.rb in nanoc-4.0.0b4
- old
+ new
@@ -33,10 +33,13 @@
# will be the content compiled right before the first layout call (if
# any).
#
# @return [String] The content at the given snapshot.
def compiled_content(params = {})
+ Nanoc::Int::NotificationCenter.post(:visit_started, unwrap.item)
+ Nanoc::Int::NotificationCenter.post(:visit_ended, unwrap.item)
+
@item_rep.compiled_content(params)
end
# Returns the item rep’s path, as used when being linked to. It starts
# with a slash and it is relative to the output directory. It does not
@@ -46,10 +49,13 @@
# @option params [Symbol] :snapshot (:last) The snapshot for which the
# path should be returned.
#
# @return [String] The item rep’s path.
def path(params = {})
+ Nanoc::Int::NotificationCenter.post(:visit_started, unwrap.item)
+ Nanoc::Int::NotificationCenter.post(:visit_ended, unwrap.item)
+
@item_rep.path(params)
end
# Returns the item that this item rep belongs to.
#
@@ -58,9 +64,12 @@
Nanoc::ItemView.new(@item_rep.item)
end
# @api private
def raw_path(params = {})
+ Nanoc::Int::NotificationCenter.post(:visit_started, unwrap.item)
+ Nanoc::Int::NotificationCenter.post(:visit_ended, unwrap.item)
+
@item_rep.raw_path(params)
end
# @api private
def binary?