scout-gear 5.2.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,507 @@
1
+ #:type=:single
2
+ #Color Name Color Code
3
+ AliceBlue #f0f8ff
4
+ AntiqueWhite #faebd7
5
+ AntiqueWhite1 #ffefdb
6
+ AntiqueWhite2 #eedfcc
7
+ AntiqueWhite3 #cdc0b0
8
+ AntiqueWhite4 #8b8378
9
+ aquamarine1 #7fffd4
10
+ aquamarine2 #76eec6
11
+ aquamarine4 #458b74
12
+ azure1 #f0ffff
13
+ azure2 #e0eeee
14
+ azure3 #c1cdcd
15
+ azure4 #838b8b
16
+ beige #f5f5dc
17
+ bisque1 #ffe4c4
18
+ bisque2 #eed5b7
19
+ bisque3 #cdb79e
20
+ bisque4 #8b7d6b
21
+ black #000000
22
+ BlanchedAlmond #ffebcd
23
+ blue1 #0000ff
24
+ blue2 #0000ee
25
+ blue4 #00008b
26
+ BlueViolet #8a2be2
27
+ brown #a52a2a
28
+ brown1 #ff4040
29
+ brown2 #ee3b3b
30
+ brown3 #cd3333
31
+ brown4 #8b2323
32
+ burlywood #deb887
33
+ burlywood1 #ffd39b
34
+ burlywood2 #eec591
35
+ burlywood3 #cdaa7d
36
+ burlywood4 #8b7355
37
+ CadetBlue #5f9ea0
38
+ CadetBlue1 #98f5ff
39
+ CadetBlue2 #8ee5ee
40
+ CadetBlue3 #7ac5cd
41
+ CadetBlue4 #53868b
42
+ chartreuse1 #7fff00
43
+ chartreuse2 #76ee00
44
+ chartreuse3 #66cd00
45
+ chartreuse4 #458b00
46
+ chocolate #d2691e
47
+ chocolate1 #ff7f24
48
+ chocolate2 #ee7621
49
+ chocolate3 #cd661d
50
+ coral #ff7f50
51
+ coral1 #ff7256
52
+ coral2 #ee6a50
53
+ coral3 #cd5b45
54
+ coral4 #8b3e2f
55
+ CornflowerBlue #6495ed
56
+ cornsilk1 #fff8dc
57
+ cornsilk2 #eee8cd
58
+ cornsilk3 #cdc8b1
59
+ cornsilk4 #8b8878
60
+ cyan1 #00ffff
61
+ cyan2 #00eeee
62
+ cyan3 #00cdcd
63
+ cyan4 #008b8b
64
+ DarkGoldenrod #b8860b
65
+ DarkGoldenrod1 #ffb90f
66
+ DarkGoldenrod2 #eead0e
67
+ DarkGoldenrod3 #cd950c
68
+ DarkGoldenrod4 #8b6508
69
+ DarkGreen #006400
70
+ DarkKhaki #bdb76b
71
+ DarkOliveGreen #556b2f
72
+ DarkOliveGreen1 #caff70
73
+ DarkOliveGreen2 #bcee68
74
+ DarkOliveGreen3 #a2cd5a
75
+ DarkOliveGreen4 #6e8b3d
76
+ DarkOrange #ff8c00
77
+ DarkOrange1 #ff7f00
78
+ DarkOrange2 #ee7600
79
+ DarkOrange3 #cd6600
80
+ DarkOrange4 #8b4500
81
+ DarkOrchid #9932cc
82
+ DarkOrchid1 #bf3eff
83
+ DarkOrchid2 #b23aee
84
+ DarkOrchid3 #9a32cd
85
+ DarkOrchid4 #68228b
86
+ DarkSalmon #e9967a
87
+ DarkSeaGreen #8fbc8f
88
+ DarkSeaGreen1 #c1ffc1
89
+ DarkSeaGreen2 #b4eeb4
90
+ DarkSeaGreen3 #9bcd9b
91
+ DarkSeaGreen4 #698b69
92
+ DarkSlateBlue #483d8b
93
+ DarkSlateGray #2f4f4f
94
+ DarkSlateGray1 #97ffff
95
+ DarkSlateGray2 #8deeee
96
+ DarkSlateGray3 #79cdcd
97
+ DarkSlateGray4 #528b8b
98
+ DarkTurquoise #00ced1
99
+ DarkViolet #9400d3
100
+ DeepPink1 #ff1493
101
+ DeepPink2 #ee1289
102
+ DeepPink3 #cd1076
103
+ DeepPink4 #8b0a50
104
+ DeepSkyBlue1 #00bfff
105
+ DeepSkyBlue2 #00b2ee
106
+ DeepSkyBlue3 #009acd
107
+ DeepSkyBlue4 #00688b
108
+ DimGray #696969
109
+ DodgerBlue1 #1e90ff
110
+ DodgerBlue2 #1c86ee
111
+ DodgerBlue3 #1874cd
112
+ DodgerBlue4 #104e8b
113
+ firebrick #b22222
114
+ firebrick1 #ff3030
115
+ firebrick2 #ee2c2c
116
+ firebrick3 #cd2626
117
+ firebrick4 #8b1a1a
118
+ FloralWhite #fffaf0
119
+ ForestGreen #228b22
120
+ gainsboro #dcdcdc
121
+ GhostWhite #f8f8ff
122
+ gold1 #ffd700
123
+ gold2 #eec900
124
+ gold3 #cdad00
125
+ gold4 #8b7500
126
+ goldenrod #daa520
127
+ goldenrod1 #ffc125
128
+ goldenrod2 #eeb422
129
+ goldenrod3 #cd9b1d
130
+ goldenrod4 #8b6914
131
+ gray #bebebe
132
+ gray1 #030303
133
+ gray10 #1a1a1a
134
+ gray11 #1c1c1c
135
+ gray12 #1f1f1f
136
+ gray13 #212121
137
+ gray14 #242424
138
+ gray15 #262626
139
+ gray16 #292929
140
+ gray17 #2b2b2b
141
+ gray18 #2e2e2e
142
+ gray19 #303030
143
+ gray2 #050505
144
+ gray20 #333333
145
+ gray21 #363636
146
+ gray22 #383838
147
+ gray23 #3b3b3b
148
+ gray24 #3d3d3d
149
+ gray25 #404040
150
+ gray26 #424242
151
+ gray27 #454545
152
+ gray28 #474747
153
+ gray29 #4a4a4a
154
+ gray3 #080808
155
+ gray30 #4d4d4d
156
+ gray31 #4f4f4f
157
+ gray32 #525252
158
+ gray33 #545454
159
+ gray34 #575757
160
+ gray35 #595959
161
+ gray36 #5c5c5c
162
+ gray37 #5e5e5e
163
+ gray38 #616161
164
+ gray39 #636363
165
+ gray4 #0a0a0a
166
+ gray40 #666666
167
+ gray41 #696969
168
+ gray42 #6b6b6b
169
+ gray43 #6e6e6e
170
+ gray44 #707070
171
+ gray45 #737373
172
+ gray46 #757575
173
+ gray47 #787878
174
+ gray48 #7a7a7a
175
+ gray49 #7d7d7d
176
+ gray5 #0d0d0d
177
+ gray50 #7f7f7f
178
+ gray51 #828282
179
+ gray52 #858585
180
+ gray53 #878787
181
+ gray54 #8a8a8a
182
+ gray55 #8c8c8c
183
+ gray56 #8f8f8f
184
+ gray57 #919191
185
+ gray58 #949494
186
+ gray59 #969696
187
+ gray6 #0f0f0f
188
+ gray60 #999999
189
+ gray61 #9c9c9c
190
+ gray62 #9e9e9e
191
+ gray63 #a1a1a1
192
+ gray64 #a3a3a3
193
+ gray65 #a6a6a6
194
+ gray66 #a8a8a8
195
+ gray67 #ababab
196
+ gray68 #adadad
197
+ gray69 #b0b0b0
198
+ gray7 #121212
199
+ gray70 #b3b3b3
200
+ gray71 #b5b5b5
201
+ gray72 #b8b8b8
202
+ gray73 #bababa
203
+ gray74 #bdbdbd
204
+ gray75 #bfbfbf
205
+ gray76 #c2c2c2
206
+ gray77 #c4c4c4
207
+ gray78 #c7c7c7
208
+ gray79 #c9c9c9
209
+ gray8 #141414
210
+ gray80 #cccccc
211
+ gray81 #cfcfcf
212
+ gray82 #d1d1d1
213
+ gray83 #d4d4d4
214
+ gray84 #d6d6d6
215
+ gray85 #d9d9d9
216
+ gray86 #dbdbdb
217
+ gray87 #dedede
218
+ gray88 #e0e0e0
219
+ gray89 #e3e3e3
220
+ gray9 #171717
221
+ gray90 #e5e5e5
222
+ gray91 #e8e8e8
223
+ gray92 #ebebeb
224
+ gray93 #ededed
225
+ gray94 #f0f0f0
226
+ gray95 #f2f2f2
227
+ gray97 #f7f7f7
228
+ gray98 #fafafa
229
+ gray99 #fcfcfc
230
+ green1 #00ff00
231
+ green2 #00ee00
232
+ green3 #00cd00
233
+ green4 #008b00
234
+ GreenYellow #adff2f
235
+ honeydew1 #f0fff0
236
+ honeydew2 #e0eee0
237
+ honeydew3 #c1cdc1
238
+ honeydew4 #838b83
239
+ HotPink #ff69b4
240
+ HotPink1 #ff6eb4
241
+ HotPink2 #ee6aa7
242
+ HotPink3 #cd6090
243
+ HotPink4 #8b3a62
244
+ IndianRed #cd5c5c
245
+ IndianRed1 #ff6a6a
246
+ IndianRed2 #ee6363
247
+ IndianRed3 #cd5555
248
+ IndianRed4 #8b3a3a
249
+ ivory1 #fffff0
250
+ ivory2 #eeeee0
251
+ ivory3 #cdcdc1
252
+ ivory4 #8b8b83
253
+ khaki #f0e68c
254
+ khaki1 #fff68f
255
+ khaki2 #eee685
256
+ khaki3 #cdc673
257
+ khaki4 #8b864e
258
+ lavender #e6e6fa
259
+ LavenderBlush1 #fff0f5
260
+ LavenderBlush2 #eee0e5
261
+ LavenderBlush3 #cdc1c5
262
+ LavenderBlush4 #8b8386
263
+ LawnGreen #7cfc00
264
+ LemonChiffon1 #fffacd
265
+ LemonChiffon2 #eee9bf
266
+ LemonChiffon3 #cdc9a5
267
+ LemonChiffon4 #8b8970
268
+ light #eedd82
269
+ LightBlue #add8e6
270
+ LightBlue1 #bfefff
271
+ LightBlue2 #b2dfee
272
+ LightBlue3 #9ac0cd
273
+ LightBlue4 #68838b
274
+ LightCoral #f08080
275
+ LightCyan1 #e0ffff
276
+ LightCyan2 #d1eeee
277
+ LightCyan3 #b4cdcd
278
+ LightCyan4 #7a8b8b
279
+ LightGoldenrod1 #ffec8b
280
+ LightGoldenrod2 #eedc82
281
+ LightGoldenrod3 #cdbe70
282
+ LightGoldenrod4 #8b814c
283
+ LightGoldenrodYellow #fafad2
284
+ LightGray #d3d3d3
285
+ LightPink #ffb6c1
286
+ LightPink1 #ffaeb9
287
+ LightPink2 #eea2ad
288
+ LightPink3 #cd8c95
289
+ LightPink4 #8b5f65
290
+ LightSalmon1 #ffa07a
291
+ LightSalmon2 #ee9572
292
+ LightSalmon3 #cd8162
293
+ LightSalmon4 #8b5742
294
+ LightSeaGreen #20b2aa
295
+ LightSkyBlue #87cefa
296
+ LightSkyBlue1 #b0e2ff
297
+ LightSkyBlue2 #a4d3ee
298
+ LightSkyBlue3 #8db6cd
299
+ LightSkyBlue4 #607b8b
300
+ LightSlateBlue #8470ff
301
+ LightSlateGray #778899
302
+ LightSteelBlue #b0c4de
303
+ LightSteelBlue1 #cae1ff
304
+ LightSteelBlue2 #bcd2ee
305
+ LightSteelBlue3 #a2b5cd
306
+ LightSteelBlue4 #6e7b8b
307
+ LightYellow1 #ffffe0
308
+ LightYellow2 #eeeed1
309
+ LightYellow3 #cdcdb4
310
+ LightYellow4 #8b8b7a
311
+ LimeGreen #32cd32
312
+ linen #faf0e6
313
+ magenta #ff00ff
314
+ magenta2 #ee00ee
315
+ magenta3 #cd00cd
316
+ magenta4 #8b008b
317
+ maroon #b03060
318
+ maroon1 #ff34b3
319
+ maroon2 #ee30a7
320
+ maroon3 #cd2990
321
+ maroon4 #8b1c62
322
+ medium #66cdaa
323
+ MediumAquamarine #66cdaa
324
+ MediumBlue #0000cd
325
+ MediumOrchid #ba55d3
326
+ MediumOrchid1 #e066ff
327
+ MediumOrchid2 #d15fee
328
+ MediumOrchid3 #b452cd
329
+ MediumOrchid4 #7a378b
330
+ MediumPurple #9370db
331
+ MediumPurple1 #ab82ff
332
+ MediumPurple2 #9f79ee
333
+ MediumPurple3 #8968cd
334
+ MediumPurple4 #5d478b
335
+ MediumSeaGreen #3cb371
336
+ MediumSlateBlue #7b68ee
337
+ MediumSpringGreen #00fa9a
338
+ MediumTurquoise #48d1cc
339
+ MediumVioletRed #c71585
340
+ MidnightBlue #191970
341
+ MintCream #f5fffa
342
+ MistyRose1 #ffe4e1
343
+ MistyRose2 #eed5d2
344
+ MistyRose3 #cdb7b5
345
+ MistyRose4 #8b7d7b
346
+ moccasin #ffe4b5
347
+ NavajoWhite1 #ffdead
348
+ NavajoWhite2 #eecfa1
349
+ NavajoWhite3 #cdb38b
350
+ NavajoWhite4 #8b795e
351
+ NavyBlue #000080
352
+ OldLace #fdf5e6
353
+ OliveDrab #6b8e23
354
+ OliveDrab1 #c0ff3e
355
+ OliveDrab2 #b3ee3a
356
+ OliveDrab4 #698b22
357
+ orange1 #ffa500
358
+ orange2 #ee9a00
359
+ orange3 #cd8500
360
+ orange4 #8b5a00
361
+ OrangeRed1 #ff4500
362
+ OrangeRed2 #ee4000
363
+ OrangeRed3 #cd3700
364
+ OrangeRed4 #8b2500
365
+ orchid #da70d6
366
+ orchid1 #ff83fa
367
+ orchid2 #ee7ae9
368
+ orchid3 #cd69c9
369
+ orchid4 #8b4789
370
+ pale #db7093
371
+ PaleGoldenrod #eee8aa
372
+ PaleGreen #98fb98
373
+ PaleGreen1 #9aff9a
374
+ PaleGreen2 #90ee90
375
+ PaleGreen3 #7ccd7c
376
+ PaleGreen4 #548b54
377
+ PaleTurquoise #afeeee
378
+ PaleTurquoise1 #bbffff
379
+ PaleTurquoise2 #aeeeee
380
+ PaleTurquoise3 #96cdcd
381
+ PaleTurquoise4 #668b8b
382
+ PaleVioletRed #db7093
383
+ PaleVioletRed1 #ff82ab
384
+ PaleVioletRed2 #ee799f
385
+ PaleVioletRed3 #cd6889
386
+ PaleVioletRed4 #8b475d
387
+ PapayaWhip #ffefd5
388
+ PeachPuff1 #ffdab9
389
+ PeachPuff2 #eecbad
390
+ PeachPuff3 #cdaf95
391
+ PeachPuff4 #8b7765
392
+ pink #ffc0cb
393
+ pink1 #ffb5c5
394
+ pink2 #eea9b8
395
+ pink3 #cd919e
396
+ pink4 #8b636c
397
+ plum #dda0dd
398
+ plum1 #ffbbff
399
+ plum2 #eeaeee
400
+ plum3 #cd96cd
401
+ plum4 #8b668b
402
+ PowderBlue #b0e0e6
403
+ purple #a020f0
404
+ rebeccapurple #663399
405
+ purple1 #9b30ff
406
+ purple2 #912cee
407
+ purple3 #7d26cd
408
+ purple4 #551a8b
409
+ red1 #ff0000
410
+ red2 #ee0000
411
+ red3 #cd0000
412
+ red4 #8b0000
413
+ RosyBrown #bc8f8f
414
+ RosyBrown1 #ffc1c1
415
+ RosyBrown2 #eeb4b4
416
+ RosyBrown3 #cd9b9b
417
+ RosyBrown4 #8b6969
418
+ RoyalBlue #4169e1
419
+ RoyalBlue1 #4876ff
420
+ RoyalBlue2 #436eee
421
+ RoyalBlue3 #3a5fcd
422
+ RoyalBlue4 #27408b
423
+ SaddleBrown #8b4513
424
+ salmon #fa8072
425
+ salmon1 #ff8c69
426
+ salmon2 #ee8262
427
+ salmon3 #cd7054
428
+ salmon4 #8b4c39
429
+ SandyBrown #f4a460
430
+ SeaGreen1 #54ff9f
431
+ SeaGreen2 #4eee94
432
+ SeaGreen3 #43cd80
433
+ SeaGreen4 #2e8b57
434
+ seashell1 #fff5ee
435
+ seashell2 #eee5de
436
+ seashell3 #cdc5bf
437
+ seashell4 #8b8682
438
+ sienna #a0522d
439
+ sienna1 #ff8247
440
+ sienna2 #ee7942
441
+ sienna3 #cd6839
442
+ sienna4 #8b4726
443
+ SkyBlue #87ceeb
444
+ SkyBlue1 #87ceff
445
+ SkyBlue2 #7ec0ee
446
+ SkyBlue3 #6ca6cd
447
+ SkyBlue4 #4a708b
448
+ SlateBlue #6a5acd
449
+ SlateBlue1 #836fff
450
+ SlateBlue2 #7a67ee
451
+ SlateBlue3 #6959cd
452
+ SlateBlue4 #473c8b
453
+ SlateGray #708090
454
+ SlateGray1 #c6e2ff
455
+ SlateGray2 #b9d3ee
456
+ SlateGray3 #9fb6cd
457
+ SlateGray4 #6c7b8b
458
+ snow1 #fffafa
459
+ snow2 #eee9e9
460
+ snow3 #cdc9c9
461
+ snow4 #8b8989
462
+ SpringGreen1 #00ff7f
463
+ SpringGreen2 #00ee76
464
+ SpringGreen3 #00cd66
465
+ SpringGreen4 #008b45
466
+ SteelBlue #4682b4
467
+ SteelBlue1 #63b8ff
468
+ SteelBlue2 #5cacee
469
+ SteelBlue3 #4f94cd
470
+ SteelBlue4 #36648b
471
+ tan #d2b48c
472
+ tan1 #ffa54f
473
+ tan2 #ee9a49
474
+ tan3 #cd853f
475
+ tan4 #8b5a2b
476
+ thistle #d8bfd8
477
+ thistle1 #ffe1ff
478
+ thistle2 #eed2ee
479
+ thistle3 #cdb5cd
480
+ thistle4 #8b7b8b
481
+ tomato1 #ff6347
482
+ tomato2 #ee5c42
483
+ tomato3 #cd4f39
484
+ tomato4 #8b3626
485
+ turquoise #40e0d0
486
+ turquoise1 #00f5ff
487
+ turquoise2 #00e5ee
488
+ turquoise3 #00c5cd
489
+ turquoise4 #00868b
490
+ violet #ee82ee
491
+ VioletRed #d02090
492
+ VioletRed1 #ff3e96
493
+ VioletRed2 #ee3a8c
494
+ VioletRed3 #cd3278
495
+ VioletRed4 #8b2252
496
+ wheat #f5deb3
497
+ wheat1 #ffe7ba
498
+ wheat2 #eed8ae
499
+ wheat3 #cdba96
500
+ wheat4 #8b7e66
501
+ white #ffffff
502
+ WhiteSmoke #f5f5f5
503
+ yellow1 #ffff00
504
+ yellow2 #eeee00
505
+ yellow3 #cdcd00
506
+ yellow4 #8b8b00
507
+ YellowGreen #9acd32
@@ -0,0 +1,12 @@
1
+ #a6cee3
2
+ #1f78b4
3
+ #b2df8a
4
+ #33a02c
5
+ #fb9a99
6
+ #e31a1c
7
+ #fdbf6f
8
+ #ff7f00
9
+ #cab2d6
10
+ #6a3d9a
11
+ #ffff99
12
+ #b15928
File without changes
@@ -139,7 +139,7 @@ class TestOpenStream < Test::Unit::TestCase
139
139
 
140
140
  def test_tee_stream_save_error
141
141
  Log.with_severity 6 do
142
- 5.times do |i|
142
+ 50.times do |i|
143
143
  TmpFile.with_file do |tmp|
144
144
  Path.setup tmp
145
145
  assert_raise ScoutException do
@@ -0,0 +1,17 @@
1
+ require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
+ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
+
4
+ require 'scout/work_queue/worker'
5
+ class TestSemaphore < Test::Unit::TestCase
6
+
7
+ def test_simple
8
+ ScoutSemaphore.with_semaphore 1 do |sem|
9
+ 10.times do
10
+ ScoutSemaphore.synchronize(sem) do
11
+ assert true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,34 @@
1
+ require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
+ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
+
4
+ class TestTSV < Test::Unit::TestCase
5
+ def test_open_with_data
6
+ content =<<-'EOF'
7
+ #: :sep=/\s+/#:type=:double#:merge=:concat
8
+ #Id ValueA ValueB OtherID
9
+ row1 a|aa|aaa b Id1|Id2
10
+ row2 A B Id3
11
+ row2 a a id3
12
+ EOF
13
+
14
+ content2 =<<-'EOF'
15
+ #: :sep=/\s+/#:type=:double#:merge=:concat
16
+ #Id ValueA ValueB OtherID
17
+ row3 a|aa|aaa b Id1|Id2
18
+ row4 A B Id3
19
+ row4 a a id3
20
+ EOF
21
+
22
+ tsv = TmpFile.with_file(content) do |filename|
23
+ TSV.open(filename)
24
+ end
25
+
26
+ TmpFile.with_file(content2) do |filename|
27
+ TSV.open(filename, :data => tsv)
28
+ end
29
+
30
+ assert_include tsv.keys, 'row4'
31
+ assert_include tsv.keys, 'row1'
32
+ end
33
+ end
34
+
@@ -0,0 +1,121 @@
1
+ require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
+ require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
+
4
+ require 'scout/log'
5
+ class TestWorkQueue < Test::Unit::TestCase
6
+ def test_queue_remove_workers
7
+ num = 10
8
+ reps = 10_000
9
+ q = WorkQueue.new num do |obj|
10
+ [Process.pid, obj.inspect] * " "
11
+ end
12
+
13
+ output = []
14
+ q.process do |out|
15
+ output << out
16
+ end
17
+
18
+ reps.times do |i|
19
+ q.write i
20
+ end
21
+
22
+ num.times do q.remove_one_worker end
23
+
24
+ w = q.add_worker do |obj|
25
+ "HEY"
26
+ end
27
+
28
+ reps.times do |i|
29
+ q.write i + reps
30
+ end
31
+
32
+ q.close
33
+ q.join
34
+
35
+ assert_equal reps * 2, output.length
36
+ assert output.include?("HEY")
37
+ end
38
+
39
+ def test_queue
40
+ num = 10
41
+ reps = 10_000
42
+ q = WorkQueue.new num do |obj|
43
+ [Process.pid.to_s, obj.to_s] * " "
44
+ end
45
+
46
+ res = []
47
+ q.process do |out|
48
+ res << out
49
+ end
50
+
51
+ pid = Process.fork do
52
+ reps.times do |i|
53
+ q.write i
54
+ end
55
+ end
56
+
57
+ Process.wait pid
58
+
59
+ q.close
60
+ q.join
61
+
62
+ assert_equal reps, res.length
63
+ end
64
+
65
+ def test_queue_ignore_output
66
+ num = 10
67
+ reps = 10_000
68
+ q = WorkQueue.new num do |obj|
69
+ [Process.pid.to_s, obj.to_s] * " "
70
+ end
71
+
72
+ q.ignore_ouput
73
+
74
+ res = []
75
+ q.process do |out|
76
+ res << out
77
+ end
78
+
79
+ pid = Process.fork do
80
+ reps.times do |i|
81
+ q.write i
82
+ end
83
+ end
84
+
85
+ Process.wait pid
86
+
87
+ q.close
88
+ q.join
89
+
90
+ assert_equal 0, res.length
91
+ end
92
+
93
+ def test_queue_error
94
+ num = 10
95
+ reps = 10_000
96
+
97
+ q = WorkQueue.new num do |obj|
98
+ raise ScoutException if rand < 1
99
+ [Process.pid.to_s, obj.to_s] * " "
100
+ end
101
+
102
+ res = []
103
+ q.process do |out|
104
+ res << out
105
+ end
106
+
107
+ pid = Process.fork do
108
+ reps.times do |i|
109
+ q.write i
110
+ end
111
+ end
112
+
113
+ Process.wait pid
114
+
115
+ assert_raise ScoutException do
116
+ q.close
117
+ q.join
118
+ end
119
+ end
120
+ end
121
+