Sha256: 54f32634d9abe3b1415e3e95af6ea75ab409e15f6649bfc5ee10bf913303cac7

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

module Nanoc::Int::Compiler::Stages
  class Preprocess
    def initialize(action_provider:, site:, dependency_store:, checksum_store:)
      @action_provider = action_provider
      @site = site
      @dependency_store = dependency_store
      @checksum_store = checksum_store
    end

    def run
      if @action_provider.need_preprocessing?
        @site.data_source = Nanoc::Int::InMemDataSource.new(@site.items, @site.layouts)
        @action_provider.preprocess(@site)

        @dependency_store.items = @site.items
        @dependency_store.layouts = @site.layouts
        @checksum_store.objects = @site.items.to_a + @site.layouts.to_a + @site.code_snippets + [@site.config]
      end

      @site.freeze
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/base/services/compiler/stages/preprocess.rb
nanoc-4.7.8 lib/nanoc/base/services/compiler/stages/preprocess.rb
nanoc-4.7.7 lib/nanoc/base/services/compiler/stages/preprocess.rb