class Nanoc::Core::CompilationPhases::Recalculate
Provides functionality for (re)calculating the content of an item rep, without caching or outdatedness checking.
Public Class Methods
new(action_sequences:, dependency_store:, compilation_context:)
click to toggle source
Calls superclass method
Nanoc::Core::CompilationPhases::Abstract::new
# File lib/nanoc/core/compilation_phases/recalculate.rb, line 11 def initialize(action_sequences:, dependency_store:, compilation_context:) super(wrapped: nil) @action_sequences = action_sequences @dependency_store = dependency_store @compilation_context = compilation_context end
Public Instance Methods
run(rep, is_outdated:)
click to toggle source
# File lib/nanoc/core/compilation_phases/recalculate.rb, line 20 def run(rep, is_outdated:) # rubocop:disable Lint/UnusedMethodArgument dependency_tracker = Nanoc::Core::DependencyTracker.new(@dependency_store) dependency_tracker.enter(rep.item) executor = Nanoc::Core::Executor.new(rep, @compilation_context, dependency_tracker) @compilation_context.compiled_content_store.set_current(rep, rep.item.content) actions = @action_sequences[rep] actions.each do |action| case action when Nanoc::Core::ProcessingActions::Filter executor.filter(action.filter_name, action.params) when Nanoc::Core::ProcessingActions::Layout executor.layout(action.layout_identifier, action.params) when Nanoc::Core::ProcessingActions::Snapshot action.snapshot_names.each do |snapshot_name| executor.snapshot(snapshot_name) end else raise Nanoc::Core::Errors::InternalInconsistency, "unknown action #{action.inspect}" end end ensure dependency_tracker.exit end