lib/nanoc/base/services/executor.rb in nanoc-4.4.5 vs lib/nanoc/base/services/executor.rb in nanoc-4.4.6
- old
+ new
@@ -33,13 +33,10 @@
# Check whether file was written
if filter.class.to_binary? && !File.file?(filter.output_filename)
raise OutputNotWrittenError.new(filter_name, filter.output_filename)
end
-
- # Create snapshot
- snapshot(@rep.snapshot_contents[:post] ? :post : :pre, final: false) unless @rep.binary?
ensure
Nanoc::Int::NotificationCenter.post(:filtering_ended, @rep, filter_name)
end
end
@@ -53,21 +50,16 @@
filter_args.freeze
# Check whether item can be laid out
raise Nanoc::Int::Errors::CannotLayoutBinaryItem.new(@rep) if @rep.binary?
- # Create "pre" snapshot
- if @rep.snapshot_contents[:post].nil?
- snapshot(:pre, final: true)
- end
-
# Create filter
klass = Nanoc::Filter.named(filter_name)
raise Nanoc::Int::Errors::UnknownFilter.new(filter_name) if klass.nil?
view_context = @compilation_context.create_view_context(@dependency_tracker)
layout_view = Nanoc::LayoutView.new(layout, view_context)
- filter = klass.new(assigns_for(@rep).merge({ layout: layout_view }))
+ filter = klass.new(assigns_for(@rep).merge(layout: layout_view))
# Visit
@dependency_tracker.bounce(layout, raw_content: true)
begin
@@ -76,18 +68,15 @@
# Layout
content = layout.content
arg = content.binary? ? content.filename : content.string
res = filter.setup_and_run(arg, filter_args)
@rep.snapshot_contents[:last] = Nanoc::Int::TextualContent.new(res).tap(&:freeze)
-
- # Create "post" snapshot
- snapshot(:post, final: false)
ensure
Nanoc::Int::NotificationCenter.post(:filtering_ended, @rep, filter_name)
end
end
- def snapshot(snapshot_name, final: true, path: nil) # rubocop:disable Lint/UnusedMethodArgument
+ def snapshot(snapshot_name)
@rep.snapshot_contents[snapshot_name] = @rep.snapshot_contents[:last]
end
def assigns_for(rep)
@compilation_context.assigns_for(rep, @dependency_tracker)