Sha256: 0fc4dc5ed78974a5f420330f88c7208844df41428a6dcf2d48a2820f85bec900

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

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

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

      checksum_store =
        Nanoc::Int::ChecksumStore.new(site: site)

      item_rep_repo = Nanoc::Int::ItemRepRepo.new

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

      outdatedness_checker =
        Nanoc::Int::OutdatednessChecker.new(
          site: site,
          checksum_store: checksum_store,
          dependency_store: dependency_store,
          rule_memory_store: rule_memory_store,
          action_provider: action_provider,
          reps: item_rep_repo,
        )

      params = {
        compiled_content_cache: Nanoc::Int::CompiledContentCache.new(env_name: site.config.env_name),
        checksum_store: checksum_store,
        rule_memory_store: rule_memory_store,
        dependency_store: dependency_store,
        outdatedness_checker: outdatedness_checker,
        reps: item_rep_repo,
        action_provider: action_provider,
      }

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-4.4.2 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.4.1 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.4.0 lib/nanoc/base/services/compiler_loader.rb
nanoc-4.3.8 lib/nanoc/base/services/compiler_loader.rb