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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e76084a809a973f3ca08927952b9edfd7e49035
4
- data.tar.gz: 21f2e9d73900ce57c41a6df1e4700e59be1eed42
3
+ metadata.gz: 352d33b7bfac2d8e559ecd87b7acfb80fe3d2ec2
4
+ data.tar.gz: 50de42b77ee8d939d3a76fac7f5de7585805f71a
5
5
  SHA512:
6
- metadata.gz: 543ff41f1540ce99bfabf3dfa579b244c1f238cda929eb9a49c1f5e0462e061df33b9d7a49133c7ddba1134166805fe94eb2c72737365700743611c7bc13bf35
7
- data.tar.gz: 95e764eac361902a50bc00faacdc6463bdec06e3eebe530c149b4891810772524b6bdeb589e2f581abf1aa129b15aa6ae84652dd74746f16f98d50306fcd66db
6
+ metadata.gz: 0bb0aa87814c60ae5b7b90408b8bf9be855ca48d15bd5049245869250bb1b0a59da7ee05eee57eee506673fc6c5978729f8a8f4156fb1e0264272f61c8a23dae
7
+ data.tar.gz: 6fc6b5b7d67dc98e8acfa462cd8d2ed92c31900abd1a8264f006413782730af1e971125a10fd2e04515158fb1e9d10fc4bf4bdb0b25b43faaf667134f6719a7d
@@ -77,6 +77,8 @@ module Build
77
77
  start_time = Time.now
78
78
 
79
79
  walker = update!
80
+
81
+ return walker
80
82
  ensure
81
83
  end_time = Time.now
82
84
  elapsed_time = end_time - start_time
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Graph
23
- VERSION = "0.3.4"
23
+ VERSION = "0.3.5"
24
24
  end
25
25
  end
@@ -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
- @failed += node.outputs if node.failed?
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams