nanoc 4.11.8 → 4.11.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +8 -0
- data/lib/nanoc.rb +4 -1
- data/lib/nanoc/base.rb +0 -1
- data/lib/nanoc/base/errors.rb +4 -49
- data/lib/nanoc/base/repos.rb +0 -15
- data/lib/nanoc/base/repos/site_loader.rb +1 -1
- data/lib/nanoc/base/services.rb +0 -2
- data/lib/nanoc/base/services/compiler.rb +1 -1
- data/lib/nanoc/base/services/compiler/phases/recalculate.rb +1 -1
- data/lib/nanoc/base/services/compiler/stages/build_reps.rb +1 -1
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +1 -1
- data/lib/nanoc/base/services/compiler/stages/load_stores.rb +1 -1
- data/lib/nanoc/base/services/compiler_loader.rb +6 -6
- data/lib/nanoc/base/services/outdatedness_checker.rb +10 -10
- data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +4 -4
- data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +2 -2
- data/lib/nanoc/base/services/outdatedness_rules/content_modified.rb +2 -2
- data/lib/nanoc/base/services/outdatedness_rules/item_collection_extended.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_rules/layout_collection_extended.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_rules/not_written.rb +2 -2
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +2 -2
- data/lib/nanoc/base/services/pruner.rb +1 -1
- data/lib/nanoc/base/views/view_context_for_compilation.rb +1 -1
- data/lib/nanoc/base/views/view_context_for_pre_compilation.rb +1 -1
- data/lib/nanoc/base/views/view_context_for_shell.rb +2 -2
- data/lib/nanoc/checking/check.rb +17 -1
- data/lib/nanoc/cli/commands/shell.rb +1 -1
- data/lib/nanoc/cli/error_handler.rb +1 -1
- data/lib/nanoc/filters/handlebars.rb +2 -2
- data/lib/nanoc/filters/sass/importer.rb +3 -2
- data/lib/nanoc/rule_dsl/action_provider.rb +1 -1
- data/lib/nanoc/spec.rb +4 -4
- data/lib/nanoc/version.rb +1 -1
- metadata +5 -21
- data/lib/nanoc/base/entities.rb +0 -7
- data/lib/nanoc/base/entities/outdatedness_reasons.rb +0 -88
- data/lib/nanoc/base/entities/outdatedness_status.rb +0 -27
- data/lib/nanoc/base/repos/action_sequence_store.rb +0 -50
- data/lib/nanoc/base/repos/binary_compiled_content_cache.rb +0 -128
- data/lib/nanoc/base/repos/checksum_store.rb +0 -74
- data/lib/nanoc/base/repos/compiled_content_cache.rb +0 -68
- data/lib/nanoc/base/repos/compiled_content_store.rb +0 -77
- data/lib/nanoc/base/repos/dependency_store.rb +0 -204
- data/lib/nanoc/base/repos/item_rep_repo.rb +0 -37
- data/lib/nanoc/base/repos/outdatedness_store.rb +0 -55
- data/lib/nanoc/base/repos/prefixed_data_source.rb +0 -31
- data/lib/nanoc/base/repos/store.rb +0 -114
- data/lib/nanoc/base/repos/textual_compiled_content_cache.rb +0 -82
- data/lib/nanoc/base/services/dependency_tracker.rb +0 -63
- data/lib/nanoc/base/services/outdatedness_rule.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff9ad828cf4dbae57144f1794213717d587b220f19b3b6a9bc168b250d3f5508
|
4
|
+
data.tar.gz: f4fd81a18bb15b30cc53109c4e7c3ddf2d71235d23ebc49ce6639c435b850101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ebe934930f925c2a829d1c52106c3fb5e0ca12f6c4a2a96093d60edef05fffe0de80bb9e68195e668921d3d5ec57bcd2f64956062a387933e83e9d49fbd53b6
|
7
|
+
data.tar.gz: a175cb61715a437e1679b827130fb034d3f9b9fb82062437b807e8ce3d6e9897d23d92a9ef40ae6ef0ae47fb76a9d3800293a41b2b42dea5e9089ee840557ffa
|
data/NEWS.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.11.9 (2019-08-17)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Allowed specifying excluded files across all checks (#1438)
|
8
|
+
* Replace handlebars.rb with ruby-handlebars (#1443)
|
9
|
+
* Improved dependency tracking for Sass imports (#1451, #1452) [Romain Goyet]
|
10
|
+
|
3
11
|
## 4.11.8 (2019-08-08)
|
4
12
|
|
5
13
|
Fixes:
|
data/lib/nanoc.rb
CHANGED
@@ -44,7 +44,6 @@ require 'net/http'
|
|
44
44
|
require 'net/https'
|
45
45
|
require 'open3'
|
46
46
|
require 'pathname'
|
47
|
-
require 'pstore'
|
48
47
|
require 'set'
|
49
48
|
require 'singleton'
|
50
49
|
require 'stringio'
|
@@ -62,6 +61,10 @@ require 'yaml'
|
|
62
61
|
# Load extracted Nanoc dependencies
|
63
62
|
require 'nanoc-core'
|
64
63
|
|
64
|
+
# Re-export from Nanoc::Core
|
65
|
+
Nanoc::Identifier = Nanoc::Core::Identifier
|
66
|
+
Nanoc::DataSource = Nanoc::Core::DataSource
|
67
|
+
|
65
68
|
# Load Nanoc
|
66
69
|
require 'nanoc/version'
|
67
70
|
require 'nanoc/base'
|
data/lib/nanoc/base.rb
CHANGED
data/lib/nanoc/base/errors.rb
CHANGED
@@ -8,6 +8,10 @@ module Nanoc
|
|
8
8
|
module Errors
|
9
9
|
Generic = ::Nanoc::Error
|
10
10
|
|
11
|
+
UnmetDependency = ::Nanoc::Core::Errors::UnmetDependency
|
12
|
+
NoSuchSnapshot = ::Nanoc::Core::Errors::NoSuchSnapshot
|
13
|
+
CannotGetCompiledContentOfBinaryItem = ::Nanoc::Core::Errors::CannotGetCompiledContentOfBinaryItem
|
14
|
+
|
11
15
|
# Generic trivial error. Superclass for all Nanoc-specific errors that are
|
12
16
|
# considered "trivial", i.e. errors that do not require a full crash report.
|
13
17
|
class GenericTrivial < Generic
|
@@ -106,26 +110,6 @@ module Nanoc
|
|
106
110
|
end
|
107
111
|
end
|
108
112
|
|
109
|
-
# Error that is raised when an rep cannot be compiled because it depends
|
110
|
-
# on other representations.
|
111
|
-
class UnmetDependency < Generic
|
112
|
-
# @return [Nanoc::Core::ItemRep] The item representation that cannot yet be
|
113
|
-
# compiled
|
114
|
-
attr_reader :rep
|
115
|
-
|
116
|
-
# @return [Symbol] The name of the snapshot that cannot yet be compiled
|
117
|
-
attr_reader :snapshot_name
|
118
|
-
|
119
|
-
# @param [Nanoc::Core::ItemRep] rep The item representation that cannot yet be
|
120
|
-
# compiled
|
121
|
-
def initialize(rep, snapshot_name)
|
122
|
-
@rep = rep
|
123
|
-
@snapshot_name = snapshot_name
|
124
|
-
|
125
|
-
super("The current item cannot be compiled yet because of an unmet dependency on the “#{rep.item.identifier}” item (rep “#{rep.name}”, snapshot “#{snapshot_name}”).")
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
113
|
# Error that is raised when a binary item is attempted to be laid out.
|
130
114
|
class CannotLayoutBinaryItem < Generic
|
131
115
|
# @param [Nanoc::Core::ItemRep] rep The item representation that was attempted
|
@@ -159,35 +143,6 @@ module Nanoc
|
|
159
143
|
end
|
160
144
|
end
|
161
145
|
|
162
|
-
# Error that is raised when the compiled content at a non-existing snapshot
|
163
|
-
# is requested.
|
164
|
-
class NoSuchSnapshot < Generic
|
165
|
-
# @return [Nanoc::Core::ItemRep] The item rep from which the compiled content
|
166
|
-
# was requested
|
167
|
-
attr_reader :item_rep
|
168
|
-
|
169
|
-
# @return [Symbol] The requested snapshot
|
170
|
-
attr_reader :snapshot
|
171
|
-
|
172
|
-
# @param [Nanoc::Core::ItemRep] item_rep The item rep from which the compiled
|
173
|
-
# content was requested
|
174
|
-
#
|
175
|
-
# @param [Symbol] snapshot The requested snapshot
|
176
|
-
def initialize(item_rep, snapshot)
|
177
|
-
@item_rep = item_rep
|
178
|
-
@snapshot = snapshot
|
179
|
-
super("The “#{item_rep.inspect}” item rep does not have a snapshot “#{snapshot.inspect}”")
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# Error that is raised when the compiled content of a binary item is attempted to be accessed.
|
184
|
-
class CannotGetCompiledContentOfBinaryItem < Generic
|
185
|
-
# @param [Nanoc::Core::ItemRep] rep The binary item representation whose compiled content was attempted to be accessed
|
186
|
-
def initialize(rep)
|
187
|
-
super("You cannot access the compiled content of a binary item representation (but you can access the path). The offending item rep is #{rep}.")
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
146
|
# Error that is raised when attempting to call #parent or #children on an item with a legacy identifier.
|
192
147
|
class CannotGetParentOrChildrenOfNonLegacyItem < Generic
|
193
148
|
def initialize(identifier)
|
data/lib/nanoc/base/repos.rb
CHANGED
@@ -1,19 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Re-exported from Nanoc::Core
|
4
|
-
Nanoc::DataSource = Nanoc::Core::DataSource
|
5
|
-
|
6
|
-
require_relative 'repos/store'
|
7
|
-
|
8
|
-
require_relative 'repos/checksum_store'
|
9
|
-
require_relative 'repos/binary_compiled_content_cache'
|
10
|
-
require_relative 'repos/textual_compiled_content_cache'
|
11
|
-
require_relative 'repos/compiled_content_cache'
|
12
3
|
require_relative 'repos/config_loader'
|
13
|
-
require_relative 'repos/dependency_store'
|
14
|
-
require_relative 'repos/item_rep_repo'
|
15
|
-
require_relative 'repos/outdatedness_store'
|
16
|
-
require_relative 'repos/action_sequence_store'
|
17
4
|
require_relative 'repos/site_loader'
|
18
|
-
require_relative 'repos/compiled_content_store'
|
19
|
-
require_relative 'repos/prefixed_data_source'
|
@@ -16,7 +16,7 @@ module Nanoc
|
|
16
16
|
data_sources_to_aggregate =
|
17
17
|
with_data_sources(config) do |data_sources|
|
18
18
|
data_sources.map do |ds|
|
19
|
-
Nanoc::
|
19
|
+
Nanoc::Core::PrefixedDataSource.new(ds, ds.items_root, ds.layouts_root)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
data/lib/nanoc/base/services.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative 'services/compilation_context'
|
4
4
|
require_relative 'services/compiler'
|
5
5
|
require_relative 'services/compiler_loader'
|
6
|
-
require_relative 'services/dependency_tracker'
|
7
6
|
require_relative 'services/executor'
|
8
7
|
require_relative 'services/filter'
|
9
8
|
require_relative 'services/item_rep_builder'
|
@@ -11,7 +10,6 @@ require_relative 'services/item_rep_router'
|
|
11
10
|
require_relative 'services/item_rep_selector'
|
12
11
|
require_relative 'services/item_rep_writer'
|
13
12
|
require_relative 'services/pruner'
|
14
|
-
require_relative 'services/outdatedness_rule'
|
15
13
|
require_relative 'services/outdatedness_rules'
|
16
14
|
|
17
15
|
require_relative 'services/compiler/phases'
|
@@ -18,7 +18,7 @@ module Nanoc
|
|
18
18
|
@action_provider = action_provider
|
19
19
|
@outdatedness_store = outdatedness_store
|
20
20
|
|
21
|
-
@compiled_content_store = Nanoc::
|
21
|
+
@compiled_content_store = Nanoc::Core::CompiledContentStore.new
|
22
22
|
end
|
23
23
|
|
24
24
|
contract Nanoc::Core::Site => C::Any
|
@@ -19,7 +19,7 @@ module Nanoc
|
|
19
19
|
|
20
20
|
contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool], C::Func[C::None => C::Any] => C::Any
|
21
21
|
def run(rep, is_outdated:) # rubocop:disable Lint/UnusedMethodArgument
|
22
|
-
dependency_tracker = Nanoc::
|
22
|
+
dependency_tracker = Nanoc::Core::DependencyTracker.new(@dependency_store)
|
23
23
|
dependency_tracker.enter(rep.item)
|
24
24
|
|
25
25
|
executor = Nanoc::Int::Executor.new(rep, @compilation_context, dependency_tracker)
|
@@ -23,7 +23,7 @@ module Nanoc
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def cleanup_unused_stores
|
26
|
-
used_paths = @output_dirs.map { |d| Nanoc::
|
26
|
+
used_paths = @output_dirs.map { |d| Nanoc::Core::Store.tmp_path_prefix(d) }
|
27
27
|
all_paths = Dir.glob('tmp/nanoc/*')
|
28
28
|
(all_paths - used_paths).each do |obsolete_path|
|
29
29
|
FileUtils.rm_rf(obsolete_path)
|
@@ -5,20 +5,20 @@ module Nanoc
|
|
5
5
|
# @api private
|
6
6
|
class CompilerLoader
|
7
7
|
def load(site, action_provider: nil)
|
8
|
-
action_sequence_store = Nanoc::
|
8
|
+
action_sequence_store = Nanoc::Core::ActionSequenceStore.new(config: site.config)
|
9
9
|
|
10
10
|
dependency_store =
|
11
|
-
Nanoc::
|
11
|
+
Nanoc::Core::DependencyStore.new(site.items, site.layouts, site.config)
|
12
12
|
|
13
13
|
objects = site.items.to_a + site.layouts.to_a + site.code_snippets + [site.config]
|
14
14
|
|
15
15
|
checksum_store =
|
16
|
-
Nanoc::
|
16
|
+
Nanoc::Core::ChecksumStore.new(config: site.config, objects: objects)
|
17
17
|
|
18
18
|
action_provider ||= Nanoc::Core::ActionProvider.named(site.config.action_provider).for(site)
|
19
19
|
|
20
20
|
outdatedness_store =
|
21
|
-
Nanoc::
|
21
|
+
Nanoc::Core::OutdatednessStore.new(config: site.config)
|
22
22
|
|
23
23
|
compiled_content_cache =
|
24
24
|
compiled_content_cache_class.new(config: site.config)
|
@@ -38,9 +38,9 @@ module Nanoc
|
|
38
38
|
def compiled_content_cache_class
|
39
39
|
feature_name = Nanoc::Feature::BINARY_COMPILED_CONTENT_CACHE
|
40
40
|
if Nanoc::Feature.enabled?(feature_name)
|
41
|
-
Nanoc::
|
41
|
+
Nanoc::Core::CompiledContentCache
|
42
42
|
else
|
43
|
-
Nanoc::
|
43
|
+
Nanoc::Core::TextualCompiledContentCache
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -48,13 +48,13 @@ module Nanoc
|
|
48
48
|
|
49
49
|
C_OBJ_MAYBE_REP = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep, Nanoc::Core::Configuration, Nanoc::Core::Layout, Nanoc::Core::ItemCollection, Nanoc::Core::LayoutCollection]
|
50
50
|
|
51
|
-
contract C::KeywordArgs[outdatedness_checker: OutdatednessChecker, reps: Nanoc::
|
51
|
+
contract C::KeywordArgs[outdatedness_checker: OutdatednessChecker, reps: Nanoc::Core::ItemRepRepo] => C::Any
|
52
52
|
def initialize(outdatedness_checker:, reps:)
|
53
53
|
@outdatedness_checker = outdatedness_checker
|
54
54
|
@reps = reps
|
55
55
|
end
|
56
56
|
|
57
|
-
contract C_OBJ_MAYBE_REP => C::Maybe[OutdatednessStatus]
|
57
|
+
contract C_OBJ_MAYBE_REP => C::Maybe[Nanoc::Core::OutdatednessStatus]
|
58
58
|
memoized def outdatedness_status_for(obj)
|
59
59
|
case obj
|
60
60
|
when Nanoc::Core::ItemRep
|
@@ -76,8 +76,8 @@ module Nanoc
|
|
76
76
|
|
77
77
|
private
|
78
78
|
|
79
|
-
contract C::ArrayOf[Class], C_OBJ_MAYBE_REP, OutdatednessStatus => C::Maybe[OutdatednessStatus]
|
80
|
-
def apply_rules(rules, obj, status = OutdatednessStatus.new)
|
79
|
+
contract C::ArrayOf[Class], C_OBJ_MAYBE_REP, Nanoc::Core::OutdatednessStatus => C::Maybe[Nanoc::Core::OutdatednessStatus]
|
80
|
+
def apply_rules(rules, obj, status = Nanoc::Core::OutdatednessStatus.new)
|
81
81
|
rules.inject(status) do |acc, rule|
|
82
82
|
if !acc.useful_to_apply?(rule)
|
83
83
|
acc
|
@@ -92,9 +92,9 @@ module Nanoc
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
contract C::ArrayOf[Class], C::ArrayOf[C_OBJ_MAYBE_REP] => C::Maybe[OutdatednessStatus]
|
95
|
+
contract C::ArrayOf[Class], C::ArrayOf[C_OBJ_MAYBE_REP] => C::Maybe[Nanoc::Core::OutdatednessStatus]
|
96
96
|
def apply_rules_multi(rules, objs)
|
97
|
-
objs.inject(OutdatednessStatus.new) { |acc, elem| apply_rules(rules, elem, acc) }
|
97
|
+
objs.inject(Nanoc::Core::OutdatednessStatus.new) { |acc, elem| apply_rules(rules, elem, acc) }
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -109,13 +109,13 @@ module Nanoc
|
|
109
109
|
attr_reader :action_sequences
|
110
110
|
attr_reader :site
|
111
111
|
|
112
|
-
Reasons = Nanoc::
|
112
|
+
Reasons = Nanoc::Core::OutdatednessReasons
|
113
113
|
|
114
114
|
C_OBJ = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep, Nanoc::Core::Configuration, Nanoc::Core::Layout, Nanoc::Core::ItemCollection]
|
115
115
|
C_ITEM_OR_REP = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep]
|
116
116
|
C_ACTION_SEQUENCES = C::HashOf[C_OBJ => Nanoc::Core::ActionSequence]
|
117
117
|
|
118
|
-
contract C::KeywordArgs[site: Nanoc::Core::Site, checksum_store: Nanoc::
|
118
|
+
contract C::KeywordArgs[site: Nanoc::Core::Site, checksum_store: Nanoc::Core::ChecksumStore, checksums: Nanoc::Core::ChecksumCollection, dependency_store: Nanoc::Core::DependencyStore, action_sequence_store: Nanoc::Core::ActionSequenceStore, action_sequences: C_ACTION_SEQUENCES, reps: Nanoc::Core::ItemRepRepo] => C::Any
|
119
119
|
def initialize(site:, checksum_store:, checksums:, dependency_store:, action_sequence_store:, action_sequences:, reps:)
|
120
120
|
@site = site
|
121
121
|
@checksum_store = checksum_store
|
@@ -202,12 +202,12 @@ module Nanoc
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def attributes_unaffected?(status, dependency)
|
205
|
-
reason = status.reasons.find { |r| r.is_a?(Nanoc::
|
205
|
+
reason = status.reasons.find { |r| r.is_a?(Nanoc::Core::OutdatednessReasons::AttributesModified) }
|
206
206
|
reason && dependency.props.attributes.is_a?(Enumerable) && (dependency.props.attributes & reason.attributes).empty?
|
207
207
|
end
|
208
208
|
|
209
209
|
def raw_content_unaffected?(status, dependency)
|
210
|
-
reason = status.reasons.find { |r| r.is_a?(Nanoc::
|
210
|
+
reason = status.reasons.find { |r| r.is_a?(Nanoc::Core::OutdatednessReasons::DocumentCollectionExtended) }
|
211
211
|
if reason.nil?
|
212
212
|
false
|
213
213
|
elsif !dependency.props.raw_content.is_a?(Enumerable)
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class AttributesModified < Nanoc::
|
6
|
+
class AttributesModified < Nanoc::Core::OutdatednessRule
|
7
7
|
include Nanoc::Core::ContractsSupport
|
8
8
|
|
9
9
|
affects_props :attributes, :compiled_content
|
10
10
|
|
11
|
-
contract C::Or[Nanoc::Core::ItemRep, Nanoc::Core::Item, Nanoc::Core::Configuration, Nanoc::Core::Layout], C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::
|
11
|
+
contract C::Or[Nanoc::Core::ItemRep, Nanoc::Core::Item, Nanoc::Core::Configuration, Nanoc::Core::Layout], C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic]
|
12
12
|
def apply(obj, outdatedness_checker)
|
13
13
|
case obj
|
14
14
|
when Nanoc::Core::ItemRep
|
@@ -20,7 +20,7 @@ module Nanoc
|
|
20
20
|
|
21
21
|
old_checksums = outdatedness_checker.checksum_store.attributes_checksum_for(obj)
|
22
22
|
unless old_checksums
|
23
|
-
return Nanoc::
|
23
|
+
return Nanoc::Core::OutdatednessReasons::AttributesModified.new(true)
|
24
24
|
end
|
25
25
|
|
26
26
|
new_checksums = outdatedness_checker.checksums.attributes_checksum_for(obj)
|
@@ -29,7 +29,7 @@ module Nanoc
|
|
29
29
|
changed_attributes = attributes.reject { |a| old_checksums[a] == new_checksums[a] }
|
30
30
|
|
31
31
|
if changed_attributes.any?
|
32
|
-
Nanoc::
|
32
|
+
Nanoc::Core::OutdatednessReasons::AttributesModified.new(changed_attributes)
|
33
33
|
end
|
34
34
|
else
|
35
35
|
raise ArgumentError
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class CodeSnippetsModified < Nanoc::
|
6
|
+
class CodeSnippetsModified < Nanoc::Core::OutdatednessRule
|
7
7
|
DDMemoize.activate(self)
|
8
8
|
|
9
9
|
include Nanoc::Core::ContractsSupport
|
@@ -12,7 +12,7 @@ module Nanoc
|
|
12
12
|
|
13
13
|
def apply(_obj, outdatedness_checker)
|
14
14
|
if any_snippets_modified?(outdatedness_checker)
|
15
|
-
Nanoc::
|
15
|
+
Nanoc::Core::OutdatednessReasons::CodeSnippetsModified
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class ContentModified < Nanoc::
|
6
|
+
class ContentModified < Nanoc::Core::OutdatednessRule
|
7
7
|
affects_props :raw_content, :compiled_content
|
8
8
|
|
9
9
|
def apply(obj, outdatedness_checker)
|
@@ -12,7 +12,7 @@ module Nanoc
|
|
12
12
|
ch_old = outdatedness_checker.checksum_store.content_checksum_for(obj)
|
13
13
|
ch_new = outdatedness_checker.checksums.content_checksum_for(obj)
|
14
14
|
if ch_old != ch_new
|
15
|
-
Nanoc::
|
15
|
+
Nanoc::Core::OutdatednessReasons::ContentModified
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -3,15 +3,15 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class ItemCollectionExtended < Nanoc::
|
6
|
+
class ItemCollectionExtended < Nanoc::Core::OutdatednessRule
|
7
7
|
affects_props :raw_content
|
8
8
|
|
9
|
-
contract Nanoc::Core::ItemCollection, C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::
|
9
|
+
contract Nanoc::Core::ItemCollection, C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic]
|
10
10
|
def apply(_obj, outdatedness_checker)
|
11
11
|
new_items = outdatedness_checker.dependency_store.new_items
|
12
12
|
|
13
13
|
if new_items.any?
|
14
|
-
Nanoc::
|
14
|
+
Nanoc::Core::OutdatednessReasons::ItemCollectionExtended.new(new_items)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -3,15 +3,15 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class LayoutCollectionExtended < Nanoc::
|
6
|
+
class LayoutCollectionExtended < Nanoc::Core::OutdatednessRule
|
7
7
|
affects_props :raw_content
|
8
8
|
|
9
|
-
contract Nanoc::Core::LayoutCollection, C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::
|
9
|
+
contract Nanoc::Core::LayoutCollection, C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic]
|
10
10
|
def apply(_obj, outdatedness_checker)
|
11
11
|
new_layouts = outdatedness_checker.dependency_store.new_layouts
|
12
12
|
|
13
13
|
if new_layouts.any?
|
14
|
-
Nanoc::
|
14
|
+
Nanoc::Core::OutdatednessReasons::LayoutCollectionExtended.new(new_layouts)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module Nanoc
|
4
4
|
module Int
|
5
5
|
module OutdatednessRules
|
6
|
-
class NotWritten < Nanoc::
|
6
|
+
class NotWritten < Nanoc::Core::OutdatednessRule
|
7
7
|
affects_props :raw_content, :attributes, :compiled_content, :path
|
8
8
|
|
9
9
|
def apply(obj, _outdatedness_checker)
|
10
10
|
if obj.raw_paths.values.flatten.compact.any? { |fn| !File.file?(fn) }
|
11
|
-
Nanoc::
|
11
|
+
Nanoc::Core::OutdatednessReasons::NotWritten
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|