def compiled_content(params={})
if self.item.binary?
raise Nanoc::Errors::CannotGetCompiledContentOfBinaryItem.new(self)
end
Nanoc::NotificationCenter.post(:visit_started, self.item)
Nanoc::NotificationCenter.post(:visit_ended, self.item)
snapshot = params.fetch(:snapshot) { @content[:pre] ? :pre : :last }
is_moving = [ :pre, :post, :last ].include?(snapshot)
if !is_moving && snapshots.find { |s| s.first == snapshot && s.last == true }.nil?
raise Nanoc::Errors::NoSuchSnapshot.new(self, snapshot)
end
if @content[snapshot].nil? || (!self.compiled? && is_moving)
raise Nanoc::Errors::UnmetDependency.new(self)
else
@content[snapshot]
end
end