lib/nanoc/base/services/compiler.rb in nanoc-4.7.3 vs lib/nanoc/base/services/compiler.rb in nanoc-4.7.4

- old
+ new

@@ -31,11 +31,11 @@ @compiled_content_cache = compiled_content_cache @snapshot_repo = snapshot_repo end def filter_name_and_args_for_layout(layout) - mem = @action_provider.memory_for(layout) + mem = @action_provider.action_sequence_for(layout) if mem.nil? || mem.size != 1 || !mem[0].is_a?(Nanoc::Int::ProcessingActions::Filter) raise Nanoc::Int::Errors::UndefinedFilterForLayout.new(layout) end [mem[0].filter_name, mem[0].params] end @@ -82,11 +82,11 @@ # @api private attr_reader :checksum_store # @api private - attr_reader :rule_memory_store + attr_reader :action_sequence_store # @api private attr_reader :action_provider # @api private @@ -102,16 +102,16 @@ attr_reader :outdatedness_store # @api private attr_reader :snapshot_repo - def initialize(site, compiled_content_cache:, checksum_store:, rule_memory_store:, action_provider:, dependency_store:, outdatedness_checker:, reps:, outdatedness_store:) + def initialize(site, compiled_content_cache:, checksum_store:, action_sequence_store:, action_provider:, dependency_store:, outdatedness_checker:, reps:, outdatedness_store:) @site = site @compiled_content_cache = compiled_content_cache @checksum_store = checksum_store - @rule_memory_store = rule_memory_store + @action_sequence_store = action_sequence_store @dependency_store = dependency_store @outdatedness_checker = outdatedness_checker @reps = reps @action_provider = action_provider @outdatedness_store = outdatedness_store @@ -139,34 +139,34 @@ stores.each(&:load) end # TODO: rename to store_preprocessed_state def store - # Calculate rule memory + # Calculate action sequence (@reps.to_a + @site.layouts.to_a).each do |obj| - rule_memory_store[obj] = action_provider.memory_for(obj).serialize + action_sequence_store[obj] = action_provider.action_sequence_for(obj).serialize end # Calculate checksums objects_to_checksum = site.items.to_a + site.layouts.to_a + site.code_snippets + [site.config] objects_to_checksum.each { |obj| checksum_store.add(obj) } # Store checksum_store.store - rule_memory_store.store + action_sequence_store.store end def store_output_state @dependency_store.store end def build_reps builder = Nanoc::Int::ItemRepBuilder.new( site, action_provider, @reps ) - builder.run + @action_sequences = builder.run end def compilation_context @_compilation_context ||= CompilationContext.new( action_provider: action_provider, @@ -212,22 +212,22 @@ def compile_reps_stage @_compile_reps_stage ||= Stages::CompileReps.new( outdatedness_store: @outdatedness_store, dependency_store: @dependency_store, - action_provider: action_provider, + action_sequences: @action_sequences, compilation_context: compilation_context, compiled_content_cache: compiled_content_cache, ) end def cleanup_stage @_cleanup_stage ||= Stages::Cleanup.new(site.config) end def determine_outdatedness - determine_outdatedness_stage.run do |outdated_items| + determine_outdatedness_stage.run(@action_sequences) do |outdated_items| @outdated_items = outdated_items end end def forget_dependencies_if_needed @@ -239,10 +239,10 @@ def stores [ checksum_store, compiled_content_cache, @dependency_store, - rule_memory_store, + action_sequence_store, @outdatedness_store, ] end end end