nanoc-core 4.14.1 → 4.14.2
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1eb383ecd0b9f70dab794c7cbbeaea2000372252ec7fca79a88977f4b9ee52e4
|
|
4
|
+
data.tar.gz: 10b983997d7836e81a8d9926f8ccaf2f2208e557fce3a61d67675dc954d8dd4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a05d9133dfcea7375b3b2dbc86d876701f86d29298bc029eae947b59893071f06df12aeb0491179ec3b6f725770de9ff7af940d16ffbd978c02859acb50e2cb
|
|
7
|
+
data.tar.gz: e374dd038fb6535c7e48ec2228f872ec06a70022a82306da0a4ac35c11ec2133e88aea1bee4f0ec5fbe339965a63e67f2054a34d1afacb8b7275c26de7e5e6c1
|
|
@@ -33,7 +33,12 @@ module Nanoc
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
selector = Nanoc::Core::ItemRepSelector.new(
|
|
36
|
+
selector = Nanoc::Core::ItemRepSelector.new(
|
|
37
|
+
outdated_reps:,
|
|
38
|
+
reps: @reps,
|
|
39
|
+
dependency_store: @dependency_store,
|
|
40
|
+
)
|
|
41
|
+
|
|
37
42
|
run_phase_stack do |phase_stack|
|
|
38
43
|
selector.each do |rep|
|
|
39
44
|
handle_errors_while(rep) do
|
|
@@ -4,17 +4,22 @@ module Nanoc
|
|
|
4
4
|
module Core
|
|
5
5
|
# Yields item reps to compile.
|
|
6
6
|
class ItemRepSelector
|
|
7
|
-
def initialize(reps)
|
|
7
|
+
def initialize(outdated_reps:, reps:, dependency_store:)
|
|
8
|
+
@outdated_reps = outdated_reps
|
|
8
9
|
@reps = reps
|
|
10
|
+
@dependency_store = dependency_store
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
# A priority queue that tracks dependencies and can detect circular
|
|
12
14
|
# dependencies.
|
|
13
15
|
class ItemRepPriorityQueue
|
|
14
|
-
def initialize(reps)
|
|
16
|
+
def initialize(outdated_reps:, reps:, dependency_store:)
|
|
17
|
+
@reps = reps
|
|
18
|
+
@dependency_store = dependency_store
|
|
19
|
+
|
|
15
20
|
# Prio A: most important; prio C: least important.
|
|
16
21
|
@prio_a = nil
|
|
17
|
-
@prio_b =
|
|
22
|
+
@prio_b = outdated_reps.dup
|
|
18
23
|
@prio_c = []
|
|
19
24
|
|
|
20
25
|
# List of reps that we’ve already seen. Reps from `reps` will end up
|
|
@@ -59,30 +64,31 @@ module Nanoc
|
|
|
59
64
|
@completed << @this
|
|
60
65
|
end
|
|
61
66
|
|
|
62
|
-
def mark_failed(
|
|
63
|
-
record_dependency(
|
|
67
|
+
def mark_failed(needed_rep:)
|
|
68
|
+
record_dependency(needed_rep)
|
|
64
69
|
|
|
65
|
-
# `@this` depends on `
|
|
66
|
-
# move `@this` into priority C, and `
|
|
70
|
+
# `@this` depends on `needed_rep`, so `needed_rep` has to be compiled
|
|
71
|
+
# first. Thus, move `@this` into priority C, and `needed_rep` into
|
|
72
|
+
# priority A.
|
|
67
73
|
|
|
68
|
-
# Put `@this` (item rep that needs `
|
|
69
|
-
# priority C (lowest prio).
|
|
74
|
+
# Put `@this` (item rep that needs `needed_rep` to be compiled first)
|
|
75
|
+
# into priority C (lowest prio).
|
|
70
76
|
@prio_c.push(@this) unless @prio_c.include?(@this)
|
|
71
77
|
|
|
72
|
-
# Put `
|
|
78
|
+
# Put `needed_rep` (item rep that needs to be compiled first, before
|
|
73
79
|
# `@this`) into priority A (highest prio).
|
|
74
|
-
@prio_a =
|
|
80
|
+
@prio_a = needed_rep
|
|
75
81
|
|
|
76
|
-
# Remember that we’ve prioritised `
|
|
77
|
-
# come from @prio_b at some point in the future, so we’ll
|
|
78
|
-
# it then.
|
|
79
|
-
@seen <<
|
|
82
|
+
# Remember that we’ve prioritised `needed_rep`. This particular
|
|
83
|
+
# element will come from @prio_b at some point in the future, so we’ll
|
|
84
|
+
# have to skip it then.
|
|
85
|
+
@seen << needed_rep
|
|
80
86
|
end
|
|
81
87
|
|
|
82
88
|
private
|
|
83
89
|
|
|
84
|
-
def record_dependency(
|
|
85
|
-
@dependencies[@this] <<
|
|
90
|
+
def record_dependency(rep)
|
|
91
|
+
@dependencies[@this] << rep
|
|
86
92
|
|
|
87
93
|
find_cycle(@this, [@this])
|
|
88
94
|
end
|
|
@@ -102,7 +108,11 @@ module Nanoc
|
|
|
102
108
|
end
|
|
103
109
|
|
|
104
110
|
def each
|
|
105
|
-
pq = ItemRepPriorityQueue.new(
|
|
111
|
+
pq = ItemRepPriorityQueue.new(
|
|
112
|
+
outdated_reps: @outdated_reps,
|
|
113
|
+
reps: @reps,
|
|
114
|
+
dependency_store: @dependency_store,
|
|
115
|
+
)
|
|
106
116
|
|
|
107
117
|
loop do
|
|
108
118
|
rep = pq.next
|
|
@@ -115,7 +125,7 @@ module Nanoc
|
|
|
115
125
|
actual_error = e.is_a?(Nanoc::Core::Errors::CompilationError) ? e.unwrap : e
|
|
116
126
|
|
|
117
127
|
if actual_error.is_a?(Nanoc::Core::Errors::UnmetDependency)
|
|
118
|
-
pq.mark_failed(actual_error.rep)
|
|
128
|
+
pq.mark_failed(needed_rep: actual_error.rep)
|
|
119
129
|
else
|
|
120
130
|
raise(e)
|
|
121
131
|
end
|
data/lib/nanoc/core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nanoc-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.14.
|
|
4
|
+
version: 4.14.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Denis Defreyne
|
|
@@ -303,7 +303,7 @@ licenses:
|
|
|
303
303
|
- MIT
|
|
304
304
|
metadata:
|
|
305
305
|
rubygems_mfa_required: 'true'
|
|
306
|
-
source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.14.
|
|
306
|
+
source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.14.2/nanoc-core
|
|
307
307
|
rdoc_options: []
|
|
308
308
|
require_paths:
|
|
309
309
|
- lib
|
|
@@ -318,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
318
318
|
- !ruby/object:Gem::Version
|
|
319
319
|
version: '0'
|
|
320
320
|
requirements: []
|
|
321
|
-
rubygems_version: 3.
|
|
321
|
+
rubygems_version: 3.6.9
|
|
322
322
|
specification_version: 4
|
|
323
323
|
summary: Core of Nanoc
|
|
324
324
|
test_files: []
|