build-graph 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build/graph/controller.rb +2 -0
- data/lib/build/graph/version.rb +1 -1
- data/lib/build/graph/walker.rb +15 -2
- data/spec/build/graph/graph_spec.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 352d33b7bfac2d8e559ecd87b7acfb80fe3d2ec2
|
4
|
+
data.tar.gz: 50de42b77ee8d939d3a76fac7f5de7585805f71a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb0aa87814c60ae5b7b90408b8bf9be855ca48d15bd5049245869250bb1b0a59da7ee05eee57eee506673fc6c5978729f8a8f4156fb1e0264272f61c8a23dae
|
7
|
+
data.tar.gz: 6fc6b5b7d67dc98e8acfa462cd8d2ed92c31900abd1a8264f006413782730af1e971125a10fd2e04515158fb1e9d10fc4bf4bdb0b25b43faaf667134f6719a7d
|
data/lib/build/graph/version.rb
CHANGED
data/lib/build/graph/walker.rb
CHANGED
@@ -54,6 +54,9 @@ module Build
|
|
54
54
|
|
55
55
|
# Failed output paths:
|
56
56
|
@failed = Set.new
|
57
|
+
|
58
|
+
# The number of failed nodes:
|
59
|
+
@failures = 0
|
57
60
|
end
|
58
61
|
|
59
62
|
attr :controller
|
@@ -66,6 +69,13 @@ module Build
|
|
66
69
|
|
67
70
|
attr :parents
|
68
71
|
|
72
|
+
# A list of outputs which have failed to generate:
|
73
|
+
attr :failed
|
74
|
+
|
75
|
+
def failed?
|
76
|
+
@failures > 0
|
77
|
+
end
|
78
|
+
|
69
79
|
def task(*arguments)
|
70
80
|
@task.call(self, *arguments)
|
71
81
|
end
|
@@ -108,8 +118,11 @@ module Build
|
|
108
118
|
@dirty.delete(node)
|
109
119
|
|
110
120
|
# Fail outputs if the node failed:
|
111
|
-
|
112
|
-
|
121
|
+
if node.failed?
|
122
|
+
@failed += node.outputs
|
123
|
+
@failures += 1
|
124
|
+
end
|
125
|
+
|
113
126
|
# Clean the node's outputs:
|
114
127
|
node.outputs.each do |path|
|
115
128
|
if edges = @outputs.delete(path)
|
@@ -122,11 +122,13 @@ module Build::Graph::GraphSpec
|
|
122
122
|
def update!
|
123
123
|
group = Process::Group.new
|
124
124
|
|
125
|
-
super do |walker, node|
|
125
|
+
walker = super do |walker, node|
|
126
126
|
Task.new(self, walker, node, group)
|
127
127
|
end
|
128
128
|
|
129
129
|
group.wait
|
130
|
+
|
131
|
+
return walker
|
130
132
|
end
|
131
133
|
end
|
132
134
|
|
@@ -204,7 +206,8 @@ module Build::Graph::GraphSpec
|
|
204
206
|
end
|
205
207
|
end
|
206
208
|
|
207
|
-
controller.update!
|
209
|
+
walker = controller.update!
|
210
|
+
expect(walker).to be_kind_of Build::Graph::Walker
|
208
211
|
|
209
212
|
expect(program_path).to be_exist
|
210
213
|
expect(code_glob.first.mtime).to be <= program_path.mtime
|