Sha256: caa48401ccc4ecdc71455b73458a8b6ae1df187c9616326464b66a052a9e3c6f

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

module Nanoc::Int
  # @api private
  class CompilerLoader
    def load(site, action_provider: nil)
      action_sequence_store = Nanoc::Int::ActionSequenceStore.new(config: site.config)

      dependency_store =
        Nanoc::Int::DependencyStore.new(site.items, site.layouts, site.config)

      objects = site.items.to_a + site.layouts.to_a + site.code_snippets + [site.config]

      checksum_store =
        Nanoc::Int::ChecksumStore.new(config: site.config, objects: objects)

      action_provider ||= Nanoc::Int::ActionProvider.named(:rule_dsl).for(site)

      outdatedness_store =
        Nanoc::Int::OutdatednessStore.new(config: site.config)

      compiled_content_cache =
        Nanoc::Int::CompiledContentCache.new(
          config: site.config,
          items: site.items,
        )

      params = {
        compiled_content_cache: compiled_content_cache,
        checksum_store: checksum_store,
        action_sequence_store: action_sequence_store,
        dependency_store: dependency_store,
        action_provider: action_provider,
        outdatedness_store: outdatedness_store,
      }

      Nanoc::Int::Compiler.new(site, params)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-4.9.0 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.19 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.18 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.17 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.16 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.15 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.14 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.8.13 lib/nanoc/base/services/compiler_loader.rb