Class: Nanoc::Int::CompilerLoader Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/base/services/compiler_loader.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#load(site) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/nanoc/base/services/compiler_loader.rb', line 4

def load(site)
  rule_memory_store = Nanoc::Int::RuleMemoryStore.new

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

  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,
    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