ztk 1.19.1 → 1.19.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 +4 -4
- data/lib/ztk/parallel.rb +8 -3
- data/lib/ztk/version.rb +1 -1
- data/spec/ztk/parallel_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03cf80347fd94de831b81ab1ff3f8691ad5e1f78
|
4
|
+
data.tar.gz: 027e70a20091498e07e1c9d3775aacac8a1efa3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9ed8fea1f649dfb232079abda6aa94ee4bd038d3c18991d1a3429f8db402f2a8cdf60f1ffe6be65ee416f3231b6db9a7f813a898b5fcea492516cf4bead281
|
7
|
+
data.tar.gz: 7df424f31235d4c0bf6cbb4fd392d9c7580bf66c05dd0580479abef1222b527cc205597dce67efe71bce02ea42cee865da998f57ed338af80bde8666648a8c59
|
data/lib/ztk/parallel.rb
CHANGED
@@ -185,6 +185,11 @@ module ZTK
|
|
185
185
|
begin
|
186
186
|
data = block.call
|
187
187
|
rescue Exception => e
|
188
|
+
config.ui.logger.fatal { e.message }
|
189
|
+
e.backtrace.each do |line|
|
190
|
+
config.ui.logger << line
|
191
|
+
config.ui.logger << "\n"
|
192
|
+
end
|
188
193
|
data = ExceptionWrapper.new(e)
|
189
194
|
end
|
190
195
|
|
@@ -288,13 +293,13 @@ module ZTK
|
|
288
293
|
def process_data(data)
|
289
294
|
return data if !(ZTK::Parallel::ExceptionWrapper === data)
|
290
295
|
|
291
|
-
config.
|
292
|
-
|
293
|
-
if (config.raise_exceptions == true)
|
296
|
+
if ((config.raise_exceptions == true) || (ZTK::Parallel::Break === data.exception))
|
297
|
+
config.ui.logger.fatal { "exception(#{data.exception.inspect})" }
|
294
298
|
signal_all
|
295
299
|
raise data.exception
|
296
300
|
end
|
297
301
|
|
302
|
+
config.ui.logger.warn { "exception(#{data.exception.inspect})" }
|
298
303
|
return data.exception
|
299
304
|
end
|
300
305
|
|
data/lib/ztk/version.rb
CHANGED
data/spec/ztk/parallel_spec.rb
CHANGED
@@ -96,6 +96,20 @@ describe ZTK::Parallel do
|
|
96
96
|
}.should_not raise_error
|
97
97
|
end
|
98
98
|
|
99
|
+
it "should not ignore ZTK::Parallel::Break exceptions" do
|
100
|
+
subject = ZTK::Parallel.new(:raise_exceptions => false)
|
101
|
+
|
102
|
+
lambda {
|
103
|
+
3.times do |x|
|
104
|
+
subject.process do
|
105
|
+
raise ZTK::Parallel::Break
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
subject.waitall
|
110
|
+
}.should raise_error
|
111
|
+
end
|
112
|
+
|
99
113
|
end
|
100
114
|
|
101
115
|
describe "#wait" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ztk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.19.
|
4
|
+
version: 1.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Patten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|