nanoc 4.11.0 → 4.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS.md +6 -0
  3. data/lib/nanoc.rb +4 -7
  4. data/lib/nanoc/base.rb +3 -3
  5. data/lib/nanoc/base/assertions.rb +1 -1
  6. data/lib/nanoc/base/entities.rb +2 -20
  7. data/lib/nanoc/base/entities/action_sequence.rb +60 -64
  8. data/lib/nanoc/base/entities/checksum_collection.rb +23 -21
  9. data/lib/nanoc/base/entities/dependency.rb +24 -22
  10. data/lib/nanoc/base/entities/outdatedness_reasons.rb +74 -72
  11. data/lib/nanoc/base/entities/outdatedness_status.rb +19 -17
  12. data/lib/nanoc/base/entities/props.rb +119 -117
  13. data/lib/nanoc/base/entities/site.rb +46 -50
  14. data/lib/nanoc/base/errors.rb +183 -198
  15. data/lib/nanoc/base/repos.rb +4 -2
  16. data/lib/nanoc/base/repos/action_sequence_store.rb +44 -42
  17. data/lib/nanoc/base/repos/aggregate_data_source.rb +24 -22
  18. data/lib/nanoc/base/repos/checksum_store.rb +51 -49
  19. data/lib/nanoc/base/repos/compiled_content_cache.rb +47 -45
  20. data/lib/nanoc/base/repos/compiled_content_store.rb +76 -0
  21. data/lib/nanoc/base/repos/config_loader.rb +74 -72
  22. data/lib/nanoc/base/repos/dependency_store.rb +174 -172
  23. data/lib/nanoc/base/repos/in_mem_data_source.rb +17 -15
  24. data/lib/nanoc/base/repos/item_rep_repo.rb +26 -24
  25. data/lib/nanoc/base/repos/outdatedness_store.rb +50 -48
  26. data/lib/nanoc/base/repos/prefixed_data_source.rb +21 -19
  27. data/lib/nanoc/base/repos/site_loader.rb +75 -73
  28. data/lib/nanoc/base/repos/store.rb +93 -91
  29. data/lib/nanoc/base/services.rb +7 -3
  30. data/lib/nanoc/base/services/action_provider.rb +23 -21
  31. data/lib/nanoc/base/services/action_sequence_builder.rb +42 -34
  32. data/lib/nanoc/base/services/compilation_context.rb +49 -47
  33. data/lib/nanoc/base/services/compiler.rb +177 -170
  34. data/lib/nanoc/base/services/compiler/phases.rb +8 -1
  35. data/lib/nanoc/base/services/compiler/phases/abstract.rb +44 -38
  36. data/lib/nanoc/base/services/compiler/phases/cache.rb +34 -28
  37. data/lib/nanoc/base/services/compiler/phases/mark_done.rb +17 -11
  38. data/lib/nanoc/base/services/compiler/phases/notify.rb +21 -0
  39. data/lib/nanoc/base/services/compiler/phases/recalculate.rb +37 -31
  40. data/lib/nanoc/base/services/compiler/phases/resume.rb +47 -48
  41. data/lib/nanoc/base/services/compiler/phases/write.rb +65 -59
  42. data/lib/nanoc/base/services/compiler/stage.rb +27 -8
  43. data/lib/nanoc/base/services/compiler/stages.rb +7 -1
  44. data/lib/nanoc/base/services/compiler/stages/build_reps.rb +25 -19
  45. data/lib/nanoc/base/services/compiler/stages/calculate_checksums.rb +34 -28
  46. data/lib/nanoc/base/services/compiler/stages/cleanup.rb +33 -27
  47. data/lib/nanoc/base/services/compiler/stages/compile_reps.rb +79 -69
  48. data/lib/nanoc/base/services/compiler/stages/determine_outdatedness.rb +46 -40
  49. data/lib/nanoc/base/services/compiler/stages/forget_outdated_dependencies.rb +15 -9
  50. data/lib/nanoc/base/services/compiler/stages/load_stores.rb +28 -22
  51. data/lib/nanoc/base/services/compiler/stages/postprocess.rb +16 -10
  52. data/lib/nanoc/base/services/compiler/stages/preprocess.rb +25 -19
  53. data/lib/nanoc/base/services/compiler/stages/prune.rb +23 -17
  54. data/lib/nanoc/base/services/compiler/stages/store_post_compilation_state.rb +15 -9
  55. data/lib/nanoc/base/services/compiler/stages/store_pre_compilation_state.rb +26 -20
  56. data/lib/nanoc/base/services/compiler_loader.rb +26 -24
  57. data/lib/nanoc/base/services/dependency_tracker.rb +47 -45
  58. data/lib/nanoc/base/services/executor.rb +16 -15
  59. data/lib/nanoc/base/services/filter.rb +37 -5
  60. data/lib/nanoc/base/services/instrumentor.rb +12 -10
  61. data/lib/nanoc/base/services/item_rep_builder.rb +21 -19
  62. data/lib/nanoc/base/services/item_rep_router.rb +72 -70
  63. data/lib/nanoc/base/services/item_rep_selector.rb +48 -46
  64. data/lib/nanoc/base/services/item_rep_writer.rb +58 -53
  65. data/lib/nanoc/base/services/outdatedness_checker.rb +181 -179
  66. data/lib/nanoc/base/services/outdatedness_rule.rb +23 -21
  67. data/lib/nanoc/base/services/outdatedness_rules.rb +5 -3
  68. data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +28 -24
  69. data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +20 -16
  70. data/lib/nanoc/base/services/outdatedness_rules/content_modified.rb +13 -9
  71. data/lib/nanoc/base/services/outdatedness_rules/item_collection_extended.rb +12 -8
  72. data/lib/nanoc/base/services/outdatedness_rules/layout_collection_extended.rb +12 -8
  73. data/lib/nanoc/base/services/outdatedness_rules/not_written.rb +10 -6
  74. data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +39 -35
  75. data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +19 -15
  76. data/lib/nanoc/base/services/pruner.rb +2 -2
  77. data/lib/nanoc/base/views.rb +7 -0
  78. data/lib/nanoc/base/views/basic_item_view.rb +1 -1
  79. data/lib/nanoc/base/views/compilation_item_rep_view.rb +2 -2
  80. data/lib/nanoc/base/views/identifiable_collection_view.rb +2 -2
  81. data/lib/nanoc/base/views/mixins/document_view_mixin.rb +1 -1
  82. data/lib/nanoc/base/views/mixins/mutable_document_view_mixin.rb +5 -5
  83. data/lib/nanoc/base/views/mutable_item_collection_view.rb +3 -3
  84. data/lib/nanoc/base/views/mutable_layout_collection_view.rb +2 -2
  85. data/lib/nanoc/base/views/view_context_for_compilation.rb +6 -6
  86. data/lib/nanoc/base/views/view_context_for_pre_compilation.rb +2 -2
  87. data/lib/nanoc/base/views/view_context_for_shell.rb +2 -2
  88. data/lib/nanoc/checking/check.rb +1 -1
  89. data/lib/nanoc/cli/commands/compile_listeners/abstract.rb +24 -7
  90. data/lib/nanoc/cli/commands/compile_listeners/debug_printer.rb +79 -15
  91. data/lib/nanoc/cli/commands/compile_listeners/diff_generator.rb +4 -7
  92. data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +15 -24
  93. data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +22 -18
  94. data/lib/nanoc/cli/commands/create-site.rb +2 -7
  95. data/lib/nanoc/cli/commands/shell.rb +1 -1
  96. data/lib/nanoc/cli/commands/show-data.rb +9 -9
  97. data/lib/nanoc/cli/logger.rb +1 -1
  98. data/lib/nanoc/data_sources/filesystem.rb +8 -8
  99. data/lib/nanoc/filters/erb.rb +1 -1
  100. data/lib/nanoc/filters/erubi.rb +1 -1
  101. data/lib/nanoc/filters/erubis.rb +1 -1
  102. data/lib/nanoc/filters/haml.rb +1 -1
  103. data/lib/nanoc/filters/sass.rb +1 -1
  104. data/lib/nanoc/filters/slim.rb +1 -1
  105. data/lib/nanoc/helpers/breadcrumbs.rb +2 -2
  106. data/lib/nanoc/helpers/capturing.rb +9 -8
  107. data/lib/nanoc/helpers/filtering.rb +2 -2
  108. data/lib/nanoc/helpers/rendering.rb +1 -1
  109. data/lib/nanoc/rule_dsl.rb +10 -0
  110. data/lib/nanoc/rule_dsl/action_provider.rb +3 -3
  111. data/lib/nanoc/rule_dsl/action_recorder.rb +3 -3
  112. data/lib/nanoc/rule_dsl/action_sequence_calculator.rb +7 -7
  113. data/lib/nanoc/rule_dsl/compilation_rule.rb +2 -2
  114. data/lib/nanoc/rule_dsl/compilation_rule_context.rb +9 -9
  115. data/lib/nanoc/rule_dsl/compiler_dsl.rb +4 -4
  116. data/lib/nanoc/rule_dsl/routing_rule.rb +3 -3
  117. data/lib/nanoc/rule_dsl/rule.rb +5 -5
  118. data/lib/nanoc/rule_dsl/rule_context.rb +3 -3
  119. data/lib/nanoc/rule_dsl/rules_collection.rb +4 -4
  120. data/lib/nanoc/spec.rb +15 -15
  121. data/lib/nanoc/version.rb +1 -1
  122. metadata +10 -111
  123. data/lib/nanoc/base/contracts_support.rb +0 -130
  124. data/lib/nanoc/base/core_ext.rb +0 -5
  125. data/lib/nanoc/base/core_ext/array.rb +0 -50
  126. data/lib/nanoc/base/core_ext/hash.rb +0 -54
  127. data/lib/nanoc/base/core_ext/string.rb +0 -16
  128. data/lib/nanoc/base/entities/code_snippet.rb +0 -53
  129. data/lib/nanoc/base/entities/configuration-schema.json +0 -122
  130. data/lib/nanoc/base/entities/configuration.rb +0 -206
  131. data/lib/nanoc/base/entities/content.rb +0 -112
  132. data/lib/nanoc/base/entities/context.rb +0 -70
  133. data/lib/nanoc/base/entities/directed_graph.rb +0 -195
  134. data/lib/nanoc/base/entities/document.rb +0 -125
  135. data/lib/nanoc/base/entities/identifiable_collection.rb +0 -141
  136. data/lib/nanoc/base/entities/identifier.rb +0 -222
  137. data/lib/nanoc/base/entities/item.rb +0 -10
  138. data/lib/nanoc/base/entities/item_collection.rb +0 -14
  139. data/lib/nanoc/base/entities/item_rep.rb +0 -91
  140. data/lib/nanoc/base/entities/layout.rb +0 -10
  141. data/lib/nanoc/base/entities/layout_collection.rb +0 -14
  142. data/lib/nanoc/base/entities/lazy_value.rb +0 -43
  143. data/lib/nanoc/base/entities/pattern.rb +0 -85
  144. data/lib/nanoc/base/entities/processing_action.rb +0 -21
  145. data/lib/nanoc/base/entities/processing_actions.rb +0 -5
  146. data/lib/nanoc/base/entities/processing_actions/filter.rb +0 -36
  147. data/lib/nanoc/base/entities/processing_actions/layout.rb +0 -36
  148. data/lib/nanoc/base/entities/processing_actions/snapshot.rb +0 -46
  149. data/lib/nanoc/base/entities/snapshot_def.rb +0 -22
  150. data/lib/nanoc/base/repos/data_source.rb +0 -168
  151. data/lib/nanoc/base/repos/snapshot_repo.rb +0 -67
  152. data/lib/nanoc/base/services/checksummer.rb +0 -274
  153. data/lib/nanoc/base/services/notification_center.rb +0 -87
  154. data/lib/nanoc/base/services/temp_filename_factory.rb +0 -52
@@ -1,16 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class ForgetOutdatedDependencies < Nanoc::Int::Compiler::Stage
5
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class ForgetOutdatedDependencies < Nanoc::Int::Compiler::Stage
8
+ include Nanoc::Core::ContractsSupport
6
9
 
7
- def initialize(dependency_store:)
8
- @dependency_store = dependency_store
9
- end
10
+ def initialize(dependency_store:)
11
+ @dependency_store = dependency_store
12
+ end
10
13
 
11
- contract C::IterOf[Nanoc::Int::Item] => C::Any
12
- def run(outdated_items)
13
- outdated_items.each { |i| @dependency_store.forget_dependencies_for(i) }
14
+ contract C::IterOf[Nanoc::Core::Item] => C::Any
15
+ def run(outdated_items)
16
+ outdated_items.each { |i| @dependency_store.forget_dependencies_for(i) }
17
+ end
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,30 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class LoadStores < Nanoc::Int::Compiler::Stage
5
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class LoadStores < Nanoc::Int::Compiler::Stage
8
+ include Nanoc::Core::ContractsSupport
6
9
 
7
- def initialize(checksum_store:, compiled_content_cache:, dependency_store:, action_sequence_store:, outdatedness_store:)
8
- @checksum_store = checksum_store
9
- @compiled_content_cache = compiled_content_cache
10
- @dependency_store = dependency_store
11
- @action_sequence_store = action_sequence_store
12
- @outdatedness_store = outdatedness_store
13
- end
10
+ def initialize(checksum_store:, compiled_content_cache:, dependency_store:, action_sequence_store:, outdatedness_store:)
11
+ @checksum_store = checksum_store
12
+ @compiled_content_cache = compiled_content_cache
13
+ @dependency_store = dependency_store
14
+ @action_sequence_store = action_sequence_store
15
+ @outdatedness_store = outdatedness_store
16
+ end
14
17
 
15
- contract C::None => C::Any
16
- def run
17
- load_store(@checksum_store)
18
- load_store(@compiled_content_cache)
19
- load_store(@dependency_store)
20
- load_store(@action_sequence_store)
21
- load_store(@outdatedness_store)
22
- end
18
+ contract C::None => C::Any
19
+ def run
20
+ load_store(@checksum_store)
21
+ load_store(@compiled_content_cache)
22
+ load_store(@dependency_store)
23
+ load_store(@action_sequence_store)
24
+ load_store(@outdatedness_store)
25
+ end
23
26
 
24
- contract Nanoc::Int::Store => C::Any
25
- def load_store(store)
26
- Nanoc::Int::Instrumentor.call(:store_loaded, store.class) do
27
- store.load
27
+ contract Nanoc::Int::Store => C::Any
28
+ def load_store(store)
29
+ Nanoc::Int::Instrumentor.call(:store_loaded, store.class) do
30
+ store.load
31
+ end
32
+ end
33
+ end
28
34
  end
29
35
  end
30
36
  end
@@ -1,17 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class Postprocess < Nanoc::Int::Compiler::Stage
5
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class Postprocess < Nanoc::Int::Compiler::Stage
8
+ include Nanoc::Core::ContractsSupport
6
9
 
7
- def initialize(action_provider:, site:)
8
- @action_provider = action_provider
9
- @site = site
10
- end
10
+ def initialize(action_provider:, site:)
11
+ @action_provider = action_provider
12
+ @site = site
13
+ end
11
14
 
12
- contract Nanoc::Int::Compiler => C::Any
13
- def run(compiler)
14
- @action_provider.postprocess(@site, compiler)
15
+ contract Nanoc::Int::Compiler => C::Any
16
+ def run(compiler)
17
+ @action_provider.postprocess(@site, compiler)
18
+ end
19
+ end
20
+ end
15
21
  end
16
22
  end
17
23
  end
@@ -1,28 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class Preprocess < Nanoc::Int::Compiler::Stage
5
- def initialize(action_provider:, site:, dependency_store:, checksum_store:)
6
- @action_provider = action_provider
7
- @site = site
8
- @dependency_store = dependency_store
9
- @checksum_store = checksum_store
10
- end
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class Preprocess < Nanoc::Int::Compiler::Stage
8
+ def initialize(action_provider:, site:, dependency_store:, checksum_store:)
9
+ @action_provider = action_provider
10
+ @site = site
11
+ @dependency_store = dependency_store
12
+ @checksum_store = checksum_store
13
+ end
11
14
 
12
- def run
13
- return if @site.preprocessed?
15
+ def run
16
+ return if @site.preprocessed?
14
17
 
15
- if @action_provider.need_preprocessing?
16
- @site.data_source = Nanoc::Int::InMemDataSource.new(@site.items, @site.layouts, @site.data_source)
17
- @action_provider.preprocess(@site)
18
+ if @action_provider.need_preprocessing?
19
+ @site.data_source = Nanoc::Int::InMemDataSource.new(@site.items, @site.layouts, @site.data_source)
20
+ @action_provider.preprocess(@site)
18
21
 
19
- @dependency_store.items = @site.items
20
- @dependency_store.layouts = @site.layouts
21
- @checksum_store.objects = @site.items.to_a + @site.layouts.to_a + @site.code_snippets + [@site.config]
22
- end
22
+ @dependency_store.items = @site.items
23
+ @dependency_store.layouts = @site.layouts
24
+ @checksum_store.objects = @site.items.to_a + @site.layouts.to_a + @site.code_snippets + [@site.config]
25
+ end
23
26
 
24
- @site.mark_as_preprocessed
25
- @site.freeze
27
+ @site.mark_as_preprocessed
28
+ @site.freeze
29
+ end
30
+ end
31
+ end
26
32
  end
27
33
  end
28
34
  end
@@ -1,26 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class Prune < Nanoc::Int::Compiler::Stage
5
- def initialize(config:, reps:)
6
- @config = config
7
- @reps = reps
8
- end
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class Prune < Nanoc::Int::Compiler::Stage
8
+ def initialize(config:, reps:)
9
+ @config = config
10
+ @reps = reps
11
+ end
9
12
 
10
- def run
11
- if @config[:prune][:auto_prune]
12
- Nanoc::Pruner.new(@config, @reps, exclude: prune_config_exclude).run
13
- end
14
- end
13
+ def run
14
+ if @config[:prune][:auto_prune]
15
+ Nanoc::Pruner.new(@config, @reps, exclude: prune_config_exclude).run
16
+ end
17
+ end
15
18
 
16
- private
19
+ private
17
20
 
18
- def prune_config
19
- @config[:prune] || {}
20
- end
21
+ def prune_config
22
+ @config[:prune] || {}
23
+ end
21
24
 
22
- def prune_config_exclude
23
- prune_config[:exclude] || {}
25
+ def prune_config_exclude
26
+ prune_config[:exclude] || {}
27
+ end
28
+ end
29
+ end
24
30
  end
25
31
  end
26
32
  end
@@ -1,16 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class StorePostCompilationState < Nanoc::Int::Compiler::Stage
5
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class StorePostCompilationState < Nanoc::Int::Compiler::Stage
8
+ include Nanoc::Core::ContractsSupport
6
9
 
7
- def initialize(dependency_store:)
8
- @dependency_store = dependency_store
9
- end
10
+ def initialize(dependency_store:)
11
+ @dependency_store = dependency_store
12
+ end
10
13
 
11
- contract C::None => C::Any
12
- def run
13
- @dependency_store.store
14
+ contract C::None => C::Any
15
+ def run
16
+ @dependency_store.store
17
+ end
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,28 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int::Compiler::Stages
4
- class StorePreCompilationState < Nanoc::Int::Compiler::Stage
5
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ class Compiler
6
+ module Stages
7
+ class StorePreCompilationState < Nanoc::Int::Compiler::Stage
8
+ include Nanoc::Core::ContractsSupport
6
9
 
7
- def initialize(reps:, layouts:, checksum_store:, action_sequence_store:, action_sequences:)
8
- @reps = reps
9
- @layouts = layouts
10
- @checksum_store = checksum_store
11
- @action_sequence_store = action_sequence_store
12
- @action_sequences = action_sequences
13
- end
10
+ def initialize(reps:, layouts:, checksum_store:, action_sequence_store:, action_sequences:)
11
+ @reps = reps
12
+ @layouts = layouts
13
+ @checksum_store = checksum_store
14
+ @action_sequence_store = action_sequence_store
15
+ @action_sequences = action_sequences
16
+ end
14
17
 
15
- contract Nanoc::Int::ChecksumCollection => C::Any
16
- def run(checksums)
17
- # Calculate action sequence
18
- (@reps.to_a + @layouts.to_a).each do |obj|
19
- @action_sequence_store[obj] = @action_sequences[obj].serialize
20
- end
21
- @action_sequence_store.store
18
+ contract Nanoc::Int::ChecksumCollection => C::Any
19
+ def run(checksums)
20
+ # Calculate action sequence
21
+ (@reps.to_a + @layouts.to_a).each do |obj|
22
+ @action_sequence_store[obj] = @action_sequences[obj].serialize
23
+ end
24
+ @action_sequence_store.store
22
25
 
23
- # Set checksums
24
- @checksum_store.checksums = checksums.to_h
25
- @checksum_store.store
26
+ # Set checksums
27
+ @checksum_store.checksums = checksums.to_h
28
+ @checksum_store.store
29
+ end
30
+ end
31
+ end
26
32
  end
27
33
  end
28
34
  end
@@ -1,37 +1,39 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int
4
- # @api private
5
- class CompilerLoader
6
- def load(site, action_provider: nil)
7
- action_sequence_store = Nanoc::Int::ActionSequenceStore.new(config: site.config)
3
+ module Nanoc
4
+ module Int
5
+ # @api private
6
+ class CompilerLoader
7
+ def load(site, action_provider: nil)
8
+ action_sequence_store = Nanoc::Int::ActionSequenceStore.new(config: site.config)
8
9
 
9
- dependency_store =
10
- Nanoc::Int::DependencyStore.new(site.items, site.layouts, site.config)
10
+ dependency_store =
11
+ Nanoc::Int::DependencyStore.new(site.items, site.layouts, site.config)
11
12
 
12
- objects = site.items.to_a + site.layouts.to_a + site.code_snippets + [site.config]
13
+ objects = site.items.to_a + site.layouts.to_a + site.code_snippets + [site.config]
13
14
 
14
- checksum_store =
15
- Nanoc::Int::ChecksumStore.new(config: site.config, objects: objects)
15
+ checksum_store =
16
+ Nanoc::Int::ChecksumStore.new(config: site.config, objects: objects)
16
17
 
17
- action_provider ||= Nanoc::Int::ActionProvider.named(site.config.action_provider).for(site)
18
+ action_provider ||= Nanoc::Int::ActionProvider.named(site.config.action_provider).for(site)
18
19
 
19
- outdatedness_store =
20
- Nanoc::Int::OutdatednessStore.new(config: site.config)
20
+ outdatedness_store =
21
+ Nanoc::Int::OutdatednessStore.new(config: site.config)
21
22
 
22
- compiled_content_cache =
23
- Nanoc::Int::CompiledContentCache.new(config: site.config)
23
+ compiled_content_cache =
24
+ Nanoc::Int::CompiledContentCache.new(config: site.config)
24
25
 
25
- params = {
26
- compiled_content_cache: compiled_content_cache,
27
- checksum_store: checksum_store,
28
- action_sequence_store: action_sequence_store,
29
- dependency_store: dependency_store,
30
- action_provider: action_provider,
31
- outdatedness_store: outdatedness_store,
32
- }
26
+ params = {
27
+ compiled_content_cache: compiled_content_cache,
28
+ checksum_store: checksum_store,
29
+ action_sequence_store: action_sequence_store,
30
+ dependency_store: dependency_store,
31
+ action_provider: action_provider,
32
+ outdatedness_store: outdatedness_store,
33
+ }
33
34
 
34
- Nanoc::Int::Compiler.new(site, params)
35
+ Nanoc::Int::Compiler.new(site, params)
36
+ end
35
37
  end
36
38
  end
37
39
  end
@@ -1,61 +1,63 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Nanoc::Int
4
- # @api private
5
- class DependencyTracker
6
- include Nanoc::Int::ContractsSupport
3
+ module Nanoc
4
+ module Int
5
+ # @api private
6
+ class DependencyTracker
7
+ include Nanoc::Core::ContractsSupport
7
8
 
8
- C_OBJ = C::Or[Nanoc::Int::Item, Nanoc::Int::Layout, Nanoc::Int::Configuration, Nanoc::Int::IdentifiableCollection]
9
- C_RAW_CONTENT = C::Or[C::IterOf[C::Or[String, Regexp]], C::Bool]
10
- C_ATTR = C::Or[C::IterOf[Symbol], C::Bool]
11
- C_ARGS = C::KeywordArgs[raw_content: C::Optional[C_RAW_CONTENT], attributes: C::Optional[C_ATTR], compiled_content: C::Optional[C::Bool], path: C::Optional[C::Bool]]
9
+ C_OBJ = C::Or[Nanoc::Core::Item, Nanoc::Core::Layout, Nanoc::Core::Configuration, Nanoc::Core::IdentifiableCollection]
10
+ C_RAW_CONTENT = C::Or[C::IterOf[C::Or[String, Regexp]], C::Bool]
11
+ C_ATTR = C::Or[C::IterOf[Symbol], C::Bool]
12
+ C_ARGS = C::KeywordArgs[raw_content: C::Optional[C_RAW_CONTENT], attributes: C::Optional[C_ATTR], compiled_content: C::Optional[C::Bool], path: C::Optional[C::Bool]]
12
13
 
13
- class Null
14
- include Nanoc::Int::ContractsSupport
14
+ class Null
15
+ include Nanoc::Core::ContractsSupport
15
16
 
16
- contract C_OBJ, C_ARGS => C::Any
17
- def enter(_obj, raw_content: false, attributes: false, compiled_content: false, path: false); end
18
-
19
- contract C_OBJ => C::Any
20
- def exit; end
17
+ contract C_OBJ, C_ARGS => C::Any
18
+ def enter(_obj, raw_content: false, attributes: false, compiled_content: false, path: false); end
21
19
 
22
- contract C_OBJ, C_ARGS => C::Any
23
- def bounce(_obj, raw_content: false, attributes: false, compiled_content: false, path: false); end
24
- end
20
+ contract C_OBJ => C::Any
21
+ def exit; end
25
22
 
26
- attr_reader :dependency_store
23
+ contract C_OBJ, C_ARGS => C::Any
24
+ def bounce(_obj, raw_content: false, attributes: false, compiled_content: false, path: false); end
25
+ end
27
26
 
28
- def initialize(dependency_store)
29
- @dependency_store = dependency_store
30
- @stack = []
31
- end
27
+ attr_reader :dependency_store
32
28
 
33
- contract C_OBJ, C_ARGS => C::Any
34
- def enter(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
35
- unless @stack.empty?
36
- Nanoc::Int::NotificationCenter.post(:dependency_created, @stack.last, obj)
37
- @dependency_store.record_dependency(
38
- @stack.last,
39
- obj,
40
- raw_content: raw_content,
41
- attributes: attributes,
42
- compiled_content: compiled_content,
43
- path: path,
44
- )
29
+ def initialize(dependency_store)
30
+ @dependency_store = dependency_store
31
+ @stack = []
45
32
  end
46
33
 
47
- @stack.push(obj)
48
- end
34
+ contract C_OBJ, C_ARGS => C::Any
35
+ def enter(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
36
+ unless @stack.empty?
37
+ Nanoc::Core::NotificationCenter.post(:dependency_created, @stack.last, obj)
38
+ @dependency_store.record_dependency(
39
+ @stack.last,
40
+ obj,
41
+ raw_content: raw_content,
42
+ attributes: attributes,
43
+ compiled_content: compiled_content,
44
+ path: path,
45
+ )
46
+ end
47
+
48
+ @stack.push(obj)
49
+ end
49
50
 
50
- contract C_OBJ => C::Any
51
- def exit
52
- @stack.pop
53
- end
51
+ contract C_OBJ => C::Any
52
+ def exit
53
+ @stack.pop
54
+ end
54
55
 
55
- contract C_OBJ, C_ARGS => C::Any
56
- def bounce(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
57
- enter(obj, raw_content: raw_content, attributes: attributes, compiled_content: compiled_content, path: path)
58
- exit
56
+ contract C_OBJ, C_ARGS => C::Any
57
+ def bounce(obj, raw_content: false, attributes: false, compiled_content: false, path: false)
58
+ enter(obj, raw_content: raw_content, attributes: attributes, compiled_content: compiled_content, path: path)
59
+ exit
60
+ end
59
61
  end
60
62
  end
61
63
  end