lib/nanoc/helpers/rendering.rb in nanoc-3.8.0 vs lib/nanoc/helpers/rendering.rb in nanoc-4.0.0a1
- old
+ new
@@ -62,29 +62,29 @@
# # Result
# <div class="box">
# I'm boxy! Luvz!
# </div>
#
- # @raise [Nanoc::Errors::UnknownLayout] if the given layout does not
+ # @raise [Nanoc::Int::Errors::UnknownLayout] if the given layout does not
# exist
#
- # @raise [Nanoc::Errors::CannotDetermineFilter] if there is no layout
+ # @raise [Nanoc::Int::Errors::CannotDetermineFilter] if there is no layout
# rule for the given layout
#
- # @raise [Nanoc::Errors::UnknownFilter] if the layout rule for the given
+ # @raise [Nanoc::Int::Errors::UnknownFilter] if the layout rule for the given
# layout specifies an unknown filter
#
# @return [String, nil] The rendered partial, or nil if this method was
# invoked with a block
def render(identifier, other_assigns = {}, &block)
# Find layout
- layout = @site.layouts.find { |l| l.identifier == identifier.cleaned_identifier }
- raise Nanoc::Errors::UnknownLayout.new(identifier.cleaned_identifier) if layout.nil?
+ layout = @site.layouts.find { |l| l.identifier == identifier.__nanoc_cleaned_identifier }
+ raise Nanoc::Int::Errors::UnknownLayout.new(identifier.__nanoc_cleaned_identifier) if layout.nil?
# Visit
- Nanoc::NotificationCenter.post(:visit_started, layout)
- Nanoc::NotificationCenter.post(:visit_ended, layout)
+ Nanoc::Int::NotificationCenter.post(:visit_started, layout)
+ Nanoc::Int::NotificationCenter.post(:visit_ended, layout)
# Capture content, if any
captured_content = block_given? ? capture(&block) : nil
# Get assigns
@@ -99,22 +99,22 @@
site: @site
}.merge(other_assigns)
# Get filter name
filter_name, filter_args = @site.compiler.rules_collection.filter_for_layout(layout)
- raise Nanoc::Errors::CannotDetermineFilter.new(layout.identifier) if filter_name.nil?
+ raise Nanoc::Int::Errors::CannotDetermineFilter.new(layout.identifier) if filter_name.nil?
# Get filter class
filter_class = Nanoc::Filter.named(filter_name)
- raise Nanoc::Errors::UnknownFilter.new(filter_name) if filter_class.nil?
+ raise Nanoc::Int::Errors::UnknownFilter.new(filter_name) if filter_class.nil?
# Create filter
filter = filter_class.new(assigns)
begin
# Notify start
- Nanoc::NotificationCenter.post(:processing_started, layout)
+ Nanoc::Int::NotificationCenter.post(:processing_started, layout)
# Layout
result = filter.setup_and_run(layout.raw_content, filter_args)
# Append to erbout if we have a block
@@ -127,10 +127,10 @@
# Return result
result
end
ensure
# Notify end
- Nanoc::NotificationCenter.post(:processing_ended, layout)
+ Nanoc::Int::NotificationCenter.post(:processing_ended, layout)
end
end
end
end