codin_rep 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,8 +25,8 @@
25
25
  <tbody>
26
26
  <tr>
27
27
  <td class="left_align"><a href="lib-codin_rep-mock_time_clock_rb.html">lib/codin_rep/mock_time_clock.rb</a></td>
28
- <td class='right_align'><tt>186</tt></td>
29
- <td class='right_align'><tt>186</tt></td>
28
+ <td class='right_align'><tt>194</tt></td>
29
+ <td class='right_align'><tt>194</tt></td>
30
30
  <td class="left_align"><div class="percent_graph_legend"><tt class=''>0.00%</tt></div>
31
31
  <div class="percent_graph">
32
32
  <div class="covered" style="width:0px"></div>
@@ -243,375 +243,399 @@
243
243
  <td><pre><a name="line65">65</a> end</pre></td>
244
244
  </tr>
245
245
  <tr class="uncovered">
246
- <td><pre><a name="line66">66</a> ensure</pre></td>
246
+ <td><pre><a name="line66">66</a> rescue EOFError =&gt; e</pre></td>
247
247
  </tr>
248
248
  <tr class="uncovered">
249
- <td><pre><a name="line67">67</a> socket.close unless socket.closed?</pre></td>
249
+ <td><pre><a name="line67">67</a> # Ignore EOF errors, as only the client should close connections.</pre></td>
250
250
  </tr>
251
251
  <tr class="uncovered">
252
- <td><pre><a name="line68">68</a> @threadsMutex.synchronize {</pre></td>
252
+ <td><pre><a name="line68">68</a> ensure</pre></td>
253
253
  </tr>
254
254
  <tr class="uncovered">
255
- <td><pre><a name="line69">69</a> @threads.delete(Thread.current)</pre></td>
255
+ <td><pre><a name="line69">69</a> socket.close unless socket.closed?</pre></td>
256
256
  </tr>
257
257
  <tr class="uncovered">
258
- <td><pre><a name="line70">70</a> }</pre></td>
258
+ <td><pre><a name="line70">70</a> @threadsMutex.synchronize {</pre></td>
259
259
  </tr>
260
260
  <tr class="uncovered">
261
- <td><pre><a name="line71">71</a> end</pre></td>
261
+ <td><pre><a name="line71">71</a> @threads.delete(Thread.current)</pre></td>
262
262
  </tr>
263
263
  <tr class="uncovered">
264
- <td><pre><a name="line72">72</a> end</pre></td>
264
+ <td><pre><a name="line72">72</a> }</pre></td>
265
265
  </tr>
266
266
  <tr class="uncovered">
267
- <td><pre><a name="line73">73</a> end</pre></td>
267
+ <td><pre><a name="line73">73</a> end</pre></td>
268
268
  </tr>
269
269
  <tr class="uncovered">
270
- <td><pre><a name="line74">74</a> </pre></td>
270
+ <td><pre><a name="line74">74</a> end</pre></td>
271
271
  </tr>
272
272
  <tr class="uncovered">
273
- <td><pre><a name="line75">75</a> def start</pre></td>
273
+ <td><pre><a name="line75">75</a> end</pre></td>
274
274
  </tr>
275
275
  <tr class="uncovered">
276
- <td><pre><a name="line76">76</a> @server_thread = Thread.new do</pre></td>
276
+ <td><pre><a name="line76">76</a> </pre></td>
277
277
  </tr>
278
278
  <tr class="uncovered">
279
- <td><pre><a name="line77">77</a> Thread.current.abort_on_exception = true</pre></td>
279
+ <td><pre><a name="line77">77</a> def start</pre></td>
280
280
  </tr>
281
281
  <tr class="uncovered">
282
- <td><pre><a name="line78">78</a> @running = true</pre></td>
282
+ <td><pre><a name="line78">78</a> @server_thread = Thread.new do</pre></td>
283
283
  </tr>
284
284
  <tr class="uncovered">
285
- <td><pre><a name="line79">79</a> while @running</pre></td>
285
+ <td><pre><a name="line79">79</a> Thread.current.abort_on_exception = true</pre></td>
286
286
  </tr>
287
287
  <tr class="uncovered">
288
- <td><pre><a name="line80">80</a> break if @server.closed?</pre></td>
288
+ <td><pre><a name="line80">80</a> @running = true</pre></td>
289
289
  </tr>
290
290
  <tr class="uncovered">
291
- <td><pre><a name="line81">81</a> socket = @server.accept</pre></td>
291
+ <td><pre><a name="line81">81</a> while @running</pre></td>
292
292
  </tr>
293
293
  <tr class="uncovered">
294
- <td><pre><a name="line82">82</a> serve(socket)</pre></td>
294
+ <td><pre><a name="line82">82</a> break if @server.closed?</pre></td>
295
295
  </tr>
296
296
  <tr class="uncovered">
297
- <td><pre><a name="line83">83</a> end</pre></td>
297
+ <td><pre><a name="line83">83</a> socket = @server.accept</pre></td>
298
298
  </tr>
299
299
  <tr class="uncovered">
300
- <td><pre><a name="line84">84</a> end</pre></td>
300
+ <td><pre><a name="line84">84</a> serve(socket)</pre></td>
301
301
  </tr>
302
302
  <tr class="uncovered">
303
- <td><pre><a name="line85">85</a> self</pre></td>
303
+ <td><pre><a name="line85">85</a> end</pre></td>
304
304
  </tr>
305
305
  <tr class="uncovered">
306
- <td><pre><a name="line86">86</a> end</pre></td>
306
+ <td><pre><a name="line86">86</a> end</pre></td>
307
307
  </tr>
308
308
  <tr class="uncovered">
309
- <td><pre><a name="line87">87</a> </pre></td>
309
+ <td><pre><a name="line87">87</a> self</pre></td>
310
310
  </tr>
311
311
  <tr class="uncovered">
312
- <td><pre><a name="line88">88</a> def stop</pre></td>
312
+ <td><pre><a name="line88">88</a> end</pre></td>
313
313
  </tr>
314
314
  <tr class="uncovered">
315
- <td><pre><a name="line89">89</a> @threadsMutex.synchronize {</pre></td>
315
+ <td><pre><a name="line89">89</a> </pre></td>
316
316
  </tr>
317
317
  <tr class="uncovered">
318
- <td><pre><a name="line90">90</a> @threads.each{|thread| thread.kill}</pre></td>
318
+ <td><pre><a name="line90">90</a> def stop</pre></td>
319
319
  </tr>
320
320
  <tr class="uncovered">
321
- <td><pre><a name="line91">91</a> @threads = []</pre></td>
321
+ <td><pre><a name="line91">91</a> @threadsMutex.synchronize {</pre></td>
322
322
  </tr>
323
323
  <tr class="uncovered">
324
- <td><pre><a name="line92">92</a> }</pre></td>
324
+ <td><pre><a name="line92">92</a> @threads.each{|thread| thread.kill}</pre></td>
325
325
  </tr>
326
326
  <tr class="uncovered">
327
- <td><pre><a name="line93">93</a> @server_thread.kill if @server_thread</pre></td>
327
+ <td><pre><a name="line93">93</a> @threads = []</pre></td>
328
328
  </tr>
329
329
  <tr class="uncovered">
330
- <td><pre><a name="line94">94</a> @server.close unless @server.closed?</pre></td>
330
+ <td><pre><a name="line94">94</a> }</pre></td>
331
331
  </tr>
332
332
  <tr class="uncovered">
333
- <td><pre><a name="line95">95</a> @server_thread.join</pre></td>
333
+ <td><pre><a name="line95">95</a> @server_thread.kill if @server_thread</pre></td>
334
334
  </tr>
335
335
  <tr class="uncovered">
336
- <td><pre><a name="line96">96</a> @running = false</pre></td>
336
+ <td><pre><a name="line96">96</a> @server.close unless @server.closed?</pre></td>
337
337
  </tr>
338
338
  <tr class="uncovered">
339
- <td><pre><a name="line97">97</a> true</pre></td>
339
+ <td><pre><a name="line97">97</a> @server_thread.join</pre></td>
340
340
  </tr>
341
341
  <tr class="uncovered">
342
- <td><pre><a name="line98">98</a> end</pre></td>
342
+ <td><pre><a name="line98">98</a> @running = false</pre></td>
343
343
  </tr>
344
344
  <tr class="uncovered">
345
- <td><pre><a name="line99">99</a> </pre></td>
345
+ <td><pre><a name="line99">99</a> true</pre></td>
346
346
  </tr>
347
347
  <tr class="uncovered">
348
- <td><pre><a name="line100">100</a> def running?</pre></td>
348
+ <td><pre><a name="line100">100</a> end</pre></td>
349
349
  </tr>
350
350
  <tr class="uncovered">
351
- <td><pre><a name="line101">101</a> @running</pre></td>
351
+ <td><pre><a name="line101">101</a> </pre></td>
352
352
  </tr>
353
353
  <tr class="uncovered">
354
- <td><pre><a name="line102">102</a> end</pre></td>
354
+ <td><pre><a name="line102">102</a> def running?</pre></td>
355
355
  </tr>
356
356
  <tr class="uncovered">
357
- <td><pre><a name="line103">103</a> </pre></td>
357
+ <td><pre><a name="line103">103</a> @running</pre></td>
358
358
  </tr>
359
359
  <tr class="uncovered">
360
- <td><pre><a name="line104">104</a> private</pre></td>
360
+ <td><pre><a name="line104">104</a> end</pre></td>
361
361
  </tr>
362
362
  <tr class="uncovered">
363
- <td><pre><a name="line105">105</a> def process_command(raw_command, socket)</pre></td>
363
+ <td><pre><a name="line105">105</a> </pre></td>
364
364
  </tr>
365
365
  <tr class="uncovered">
366
- <td><pre><a name="line106">106</a> case raw_command</pre></td>
366
+ <td><pre><a name="line106">106</a> private</pre></td>
367
367
  </tr>
368
368
  <tr class="uncovered">
369
- <td><pre><a name="line107">107</a> when &quot;PGREP009b&quot; # Get time</pre></td>
369
+ <td><pre><a name="line107">107</a> def process_command(raw_command, socket)</pre></td>
370
370
  </tr>
371
371
  <tr class="uncovered">
372
- <td><pre><a name="line108">108</a> response = &#39;REP008b&#39; + get_timeclock_time</pre></td>
372
+ <td><pre><a name="line108">108</a> case raw_command</pre></td>
373
373
  </tr>
374
374
  <tr class="uncovered">
375
- <td><pre><a name="line109">109</a> when &quot;PGREP016A&quot; # Set time</pre></td>
375
+ <td><pre><a name="line109">109</a> when &quot;PGREP009b&quot; # Get time</pre></td>
376
376
  </tr>
377
377
  <tr class="uncovered">
378
- <td><pre><a name="line110">110</a> payload = read_from_socket_with_timeout(socket, 7)</pre></td>
378
+ <td><pre><a name="line110">110</a> response = &#39;REP008b&#39; + get_timeclock_time</pre></td>
379
379
  </tr>
380
380
  <tr class="uncovered">
381
- <td><pre><a name="line111">111</a> response = &#39;REP008A&#39; + payload</pre></td>
381
+ <td><pre><a name="line111">111</a> when &quot;PGREP016A&quot; # Set time</pre></td>
382
382
  </tr>
383
383
  <tr class="uncovered">
384
- <td><pre><a name="line112">112</a> set_timeclock_time(payload)</pre></td>
384
+ <td><pre><a name="line112">112</a> payload = read_from_socket_with_timeout(socket, 7)</pre></td>
385
385
  </tr>
386
386
  <tr class="uncovered">
387
- <td><pre><a name="line113">113</a> when &quot;PGREP009Z&quot;</pre></td>
387
+ <td><pre><a name="line113">113</a> response = &#39;REP008A&#39; + payload</pre></td>
388
388
  </tr>
389
389
  <tr class="uncovered">
390
- <td><pre><a name="line114">114</a> response = &#39;REP2359&#39; + @data.afd.header.export + &quot;\r\n&quot;</pre></td>
390
+ <td><pre><a name="line114">114</a> set_timeclock_time(payload)</pre></td>
391
391
  </tr>
392
392
  <tr class="uncovered">
393
- <td><pre><a name="line115">115</a> @keep_connected = false</pre></td>
393
+ <td><pre><a name="line115">115</a> when &quot;PGREP009Z&quot;</pre></td>
394
394
  </tr>
395
395
  <tr class="uncovered">
396
- <td><pre><a name="line116">116</a> when &quot;PGREP0289&quot;</pre></td>
396
+ <td><pre><a name="line116">116</a> response = &#39;REP2359&#39; + @data.afd.header.export + &quot;\r\n&quot;</pre></td>
397
397
  </tr>
398
398
  <tr class="uncovered">
399
- <td><pre><a name="line117">117</a> @afd_read_start_id = read_from_socket_with_timeout(socket, 9).to_i</pre></td>
399
+ <td><pre><a name="line117">117</a> @keep_connected = false</pre></td>
400
400
  </tr>
401
401
  <tr class="uncovered">
402
- <td><pre><a name="line118">118</a> @afd_read_end_id = read_from_socket_with_timeout(socket, 9).to_i</pre></td>
402
+ <td><pre><a name="line118">118</a> when &quot;PGREP0289&quot;</pre></td>
403
403
  </tr>
404
404
  <tr class="uncovered">
405
- <td><pre><a name="line119">119</a> @afd_read_current_id = nil</pre></td>
405
+ <td><pre><a name="line119">119</a> byte = read_from_socket_with_timeout(socket, 1)</pre></td>
406
406
  </tr>
407
407
  <tr class="uncovered">
408
- <td><pre><a name="line120">120</a> @afd_read_finished = false</pre></td>
408
+ <td><pre><a name="line120">120</a> if byte == &quot;0&quot;</pre></td>
409
409
  </tr>
410
410
  <tr class="uncovered">
411
- <td><pre><a name="line121">121</a> response = &quot;REP0029[&quot;</pre></td>
411
+ <td><pre><a name="line121">121</a> @afd_read_start_id = read_from_socket_with_timeout(socket, 9).to_i</pre></td>
412
412
  </tr>
413
413
  <tr class="uncovered">
414
- <td><pre><a name="line122">122</a> when &quot;PGREP009,&quot;</pre></td>
414
+ <td><pre><a name="line122">122</a> @afd_read_end_id = read_from_socket_with_timeout(socket, 9).to_i</pre></td>
415
415
  </tr>
416
416
  <tr class="uncovered">
417
- <td><pre><a name="line123">123</a> if @afd_read_finished</pre></td>
417
+ <td><pre><a name="line123">123</a> @afd_read_current_id = nil</pre></td>
418
418
  </tr>
419
419
  <tr class="uncovered">
420
- <td><pre><a name="line124">124</a> response = &quot;REP0029]&quot;</pre></td>
420
+ <td><pre><a name="line124">124</a> @afd_read_finished = false</pre></td>
421
421
  </tr>
422
422
  <tr class="uncovered">
423
- <td><pre><a name="line125">125</a> @keep_connected = false</pre></td>
423
+ <td><pre><a name="line125">125</a> response = &quot;REP0029[&quot;</pre></td>
424
424
  </tr>
425
425
  <tr class="uncovered">
426
426
  <td><pre><a name="line126">126</a> else</pre></td>
427
427
  </tr>
428
428
  <tr class="uncovered">
429
- <td><pre><a name="line127">127</a> if @afd_read_current_id.nil?</pre></td>
429
+ <td><pre><a name="line127">127</a> raw_command += byte</pre></td>
430
430
  </tr>
431
431
  <tr class="uncovered">
432
- <td><pre><a name="line128">128</a> @afd_read_current_id = @afd_read_start_id</pre></td>
432
+ <td><pre><a name="line128">128</a> raise StandardError.new(&quot;Unknown command \&quot;#{raw_command}\&quot;!&quot;)</pre></td>
433
433
  </tr>
434
434
  <tr class="uncovered">
435
- <td><pre><a name="line129">129</a> response = &#39;REP3029&#39;</pre></td>
435
+ <td><pre><a name="line129">129</a> end</pre></td>
436
436
  </tr>
437
437
  <tr class="uncovered">
438
- <td><pre><a name="line130">130</a> elsif @afd_read_current_id == @afd_read_end_id or @afd_read_current_id &gt;= @data.afd.records.size</pre></td>
438
+ <td><pre><a name="line130">130</a> when &quot;PGREP009,&quot;</pre></td>
439
439
  </tr>
440
440
  <tr class="uncovered">
441
- <td><pre><a name="line131">131</a> response = &#39;REP0909&#39;</pre></td>
441
+ <td><pre><a name="line131">131</a> if @afd_read_finished</pre></td>
442
442
  </tr>
443
443
  <tr class="uncovered">
444
- <td><pre><a name="line132">132</a> @afd_read_finished = true</pre></td>
444
+ <td><pre><a name="line132">132</a> response = &quot;REP0029]&quot;</pre></td>
445
445
  </tr>
446
446
  <tr class="uncovered">
447
- <td><pre><a name="line133">133</a> else</pre></td>
447
+ <td><pre><a name="line133">133</a> @keep_connected = false</pre></td>
448
448
  </tr>
449
449
  <tr class="uncovered">
450
- <td><pre><a name="line134">134</a> response = &#39;REP0379&#39;</pre></td>
450
+ <td><pre><a name="line134">134</a> else</pre></td>
451
451
  </tr>
452
452
  <tr class="uncovered">
453
- <td><pre><a name="line135">135</a> end</pre></td>
453
+ <td><pre><a name="line135">135</a> if @afd_read_current_id.nil?</pre></td>
454
454
  </tr>
455
455
  <tr class="uncovered">
456
- <td><pre><a name="line136">136</a> afd_records = ([@data.afd.header] + @data.afd.records)</pre></td>
456
+ <td><pre><a name="line136">136</a> @afd_read_current_id = @afd_read_start_id</pre></td>
457
457
  </tr>
458
458
  <tr class="uncovered">
459
- <td><pre><a name="line137">137</a> response += afd_records[@afd_read_current_id].export + &quot;\r\n&quot;</pre></td>
459
+ <td><pre><a name="line137">137</a> response = &#39;REP3029&#39;</pre></td>
460
460
  </tr>
461
461
  <tr class="uncovered">
462
- <td><pre><a name="line138">138</a> end</pre></td>
462
+ <td><pre><a name="line138">138</a> elsif @afd_read_current_id == @afd_read_end_id or @afd_read_current_id &gt;= @data.afd.records.size</pre></td>
463
463
  </tr>
464
464
  <tr class="uncovered">
465
- <td><pre><a name="line139">139</a> @afd_read_current_id += 1</pre></td>
465
+ <td><pre><a name="line139">139</a> response = &#39;REP0909&#39;</pre></td>
466
466
  </tr>
467
467
  <tr class="uncovered">
468
- <td><pre><a name="line140">140</a> when &quot;PGREP075h&quot;</pre></td>
468
+ <td><pre><a name="line140">140</a> @afd_read_finished = true</pre></td>
469
469
  </tr>
470
470
  <tr class="uncovered">
471
- <td><pre><a name="line141">141</a> payload = read_from_socket_with_timeout(socket, 66)</pre></td>
471
+ <td><pre><a name="line141">141</a> else</pre></td>
472
472
  </tr>
473
473
  <tr class="uncovered">
474
- <td><pre><a name="line142">142</a> raw_registration, raw_pis, raw_name = payload.scan(/.(.{6})(.{6})(.+)/).flatten</pre></td>
474
+ <td><pre><a name="line142">142</a> response = &#39;REP0379&#39;</pre></td>
475
475
  </tr>
476
476
  <tr class="uncovered">
477
- <td><pre><a name="line143">143</a> registration = convert_bytes_to_string(raw_registration)</pre></td>
477
+ <td><pre><a name="line143">143</a> end</pre></td>
478
478
  </tr>
479
479
  <tr class="uncovered">
480
- <td><pre><a name="line144">144</a> pis = convert_bytes_to_string(raw_pis)</pre></td>
480
+ <td><pre><a name="line144">144</a> afd_records = ([@data.afd.header] + @data.afd.records)</pre></td>
481
481
  </tr>
482
482
  <tr class="uncovered">
483
- <td><pre><a name="line145">145</a> name = raw_name.strip</pre></td>
483
+ <td><pre><a name="line145">145</a> response += afd_records[@afd_read_current_id].export + &quot;\r\n&quot;</pre></td>
484
484
  </tr>
485
485
  <tr class="uncovered">
486
- <td><pre><a name="line146">146</a> @data.employees &lt;&lt; {name: name, pis: pis, registration: registration}</pre></td>
486
+ <td><pre><a name="line146">146</a> end</pre></td>
487
487
  </tr>
488
488
  <tr class="uncovered">
489
- <td><pre><a name="line147">147</a> response = &quot;REP003h1\0&quot;</pre></td>
489
+ <td><pre><a name="line147">147</a> @afd_read_current_id += 1</pre></td>
490
490
  </tr>
491
491
  <tr class="uncovered">
492
- <td><pre><a name="line148">148</a> when &quot;PGREP016j&quot;</pre></td>
492
+ <td><pre><a name="line148">148</a> when &quot;PGREP075h&quot;</pre></td>
493
493
  </tr>
494
494
  <tr class="uncovered">
495
- <td><pre><a name="line149">149</a> payload = read_from_socket_with_timeout(socket, 7)</pre></td>
495
+ <td><pre><a name="line149">149</a> payload = read_from_socket_with_timeout(socket, 66)</pre></td>
496
496
  </tr>
497
497
  <tr class="uncovered">
498
- <td><pre><a name="line150">150</a> raw_registration = payload.scan(/.(.{6})/).flatten[0]</pre></td>
498
+ <td><pre><a name="line150">150</a> raw_registration, raw_pis, raw_name = payload.scan(/.(.{6})(.{6})(.+)/).flatten</pre></td>
499
499
  </tr>
500
500
  <tr class="uncovered">
501
501
  <td><pre><a name="line151">151</a> registration = convert_bytes_to_string(raw_registration)</pre></td>
502
502
  </tr>
503
503
  <tr class="uncovered">
504
- <td><pre><a name="line152">152</a> @data.employees.delete_if{|employee| employee[:registration] == registration}</pre></td>
504
+ <td><pre><a name="line152">152</a> pis = convert_bytes_to_string(raw_pis)</pre></td>
505
505
  </tr>
506
506
  <tr class="uncovered">
507
- <td><pre><a name="line153">153</a> response = &quot;REP003j1\0&quot;</pre></td>
507
+ <td><pre><a name="line153">153</a> name = raw_name.strip</pre></td>
508
508
  </tr>
509
509
  <tr class="uncovered">
510
- <td><pre><a name="line154">154</a> when &#39;PGREP010h&#39;, &#39;PGREP010j&#39;</pre></td>
510
+ <td><pre><a name="line154">154</a> @data.employees &lt;&lt; {name: name, pis: pis, registration: registration}</pre></td>
511
511
  </tr>
512
512
  <tr class="uncovered">
513
- <td><pre><a name="line155">155</a> # Don&#39;t care for the result of these comands, just disconnect when</pre></td>
513
+ <td><pre><a name="line155">155</a> response = &quot;REP003h1\0&quot;</pre></td>
514
514
  </tr>
515
515
  <tr class="uncovered">
516
- <td><pre><a name="line156">156</a> # possible.</pre></td>
516
+ <td><pre><a name="line156">156</a> when &quot;PGREP016j&quot;</pre></td>
517
517
  </tr>
518
518
  <tr class="uncovered">
519
- <td><pre><a name="line157">157</a> @keep_connected = false</pre></td>
519
+ <td><pre><a name="line157">157</a> payload = read_from_socket_with_timeout(socket, 7)</pre></td>
520
520
  </tr>
521
521
  <tr class="uncovered">
522
- <td><pre><a name="line158">158</a> response = &quot;&quot;</pre></td>
522
+ <td><pre><a name="line158">158</a> raw_registration = payload.scan(/.(.{6})/).flatten[0]</pre></td>
523
523
  </tr>
524
524
  <tr class="uncovered">
525
- <td><pre><a name="line159">159</a> else</pre></td>
525
+ <td><pre><a name="line159">159</a> registration = convert_bytes_to_string(raw_registration)</pre></td>
526
526
  </tr>
527
527
  <tr class="uncovered">
528
- <td><pre><a name="line160">160</a> raise StandardError.new(&quot;Unknown command \&quot;#{raw_command}\&quot;!&quot;)</pre></td>
528
+ <td><pre><a name="line160">160</a> @data.employees.delete_if{|employee| employee[:registration] == registration}</pre></td>
529
529
  </tr>
530
530
  <tr class="uncovered">
531
- <td><pre><a name="line161">161</a> end</pre></td>
531
+ <td><pre><a name="line161">161</a> response = &quot;REP003j1\0&quot;</pre></td>
532
532
  </tr>
533
533
  <tr class="uncovered">
534
- <td><pre><a name="line162">162</a> response</pre></td>
534
+ <td><pre><a name="line162">162</a> when &#39;PGREP010h&#39;, &#39;PGREP010j&#39;</pre></td>
535
535
  </tr>
536
536
  <tr class="uncovered">
537
- <td><pre><a name="line163">163</a> end</pre></td>
537
+ <td><pre><a name="line163">163</a> # Don&#39;t care for the result of these comands, just disconnect when</pre></td>
538
538
  </tr>
539
539
  <tr class="uncovered">
540
- <td><pre><a name="line164">164</a> </pre></td>
540
+ <td><pre><a name="line164">164</a> # possible.</pre></td>
541
541
  </tr>
542
542
  <tr class="uncovered">
543
- <td><pre><a name="line165">165</a> def read_from_socket_with_timeout(socket, bytes_to_be_read, timeout_value=5)</pre></td>
543
+ <td><pre><a name="line165">165</a> @keep_connected = false</pre></td>
544
544
  </tr>
545
545
  <tr class="uncovered">
546
- <td><pre><a name="line166">166</a> data_to_receive = nil</pre></td>
546
+ <td><pre><a name="line166">166</a> response = &quot;&quot;</pre></td>
547
547
  </tr>
548
548
  <tr class="uncovered">
549
- <td><pre><a name="line167">167</a> timeout_value = 600 if @first_connection # use a large timeout on first connection</pre></td>
549
+ <td><pre><a name="line167">167</a> else</pre></td>
550
550
  </tr>
551
551
  <tr class="uncovered">
552
- <td><pre><a name="line168">168</a> timeout(timeout_value) { data_to_receive = socket.readpartial( bytes_to_be_read ) }</pre></td>
552
+ <td><pre><a name="line168">168</a> raise StandardError.new(&quot;Unknown command \&quot;#{raw_command}\&quot;!&quot;)</pre></td>
553
553
  </tr>
554
554
  <tr class="uncovered">
555
- <td><pre><a name="line169">169</a> return data_to_receive</pre></td>
555
+ <td><pre><a name="line169">169</a> end</pre></td>
556
556
  </tr>
557
557
  <tr class="uncovered">
558
- <td><pre><a name="line170">170</a> end</pre></td>
558
+ <td><pre><a name="line170">170</a> response</pre></td>
559
559
  </tr>
560
560
  <tr class="uncovered">
561
- <td><pre><a name="line171">171</a> </pre></td>
561
+ <td><pre><a name="line171">171</a> end</pre></td>
562
562
  </tr>
563
563
  <tr class="uncovered">
564
- <td><pre><a name="line172">172</a> def get_timeclock_time(current_time=nil)</pre></td>
564
+ <td><pre><a name="line172">172</a> </pre></td>
565
565
  </tr>
566
566
  <tr class="uncovered">
567
- <td><pre><a name="line173">173</a> current_time ||= @data.time</pre></td>
567
+ <td><pre><a name="line173">173</a> def read_from_socket_with_timeout(socket, bytes_to_be_read, timeout_value=5)</pre></td>
568
568
  </tr>
569
569
  <tr class="uncovered">
570
- <td><pre><a name="line174">174</a> CodinRep::TimeUtil.pack current_time</pre></td>
570
+ <td><pre><a name="line174">174</a> data_to_receive = nil</pre></td>
571
571
  </tr>
572
572
  <tr class="uncovered">
573
- <td><pre><a name="line175">175</a> end</pre></td>
573
+ <td><pre><a name="line175">175</a> timeout_value = 600 if @first_connection # use a large timeout on first connection</pre></td>
574
574
  </tr>
575
575
  <tr class="uncovered">
576
- <td><pre><a name="line176">176</a> </pre></td>
576
+ <td><pre><a name="line176">176</a> timeout(timeout_value) { data_to_receive = socket.readpartial( bytes_to_be_read ) }</pre></td>
577
577
  </tr>
578
578
  <tr class="uncovered">
579
- <td><pre><a name="line177">177</a> def set_timeclock_time(payload)</pre></td>
579
+ <td><pre><a name="line177">177</a> return data_to_receive</pre></td>
580
580
  </tr>
581
581
  <tr class="uncovered">
582
- <td><pre><a name="line178">178</a> time = CodinRep::TimeUtil.unpack payload</pre></td>
582
+ <td><pre><a name="line178">178</a> end</pre></td>
583
583
  </tr>
584
584
  <tr class="uncovered">
585
- <td><pre><a name="line179">179</a> @data.time = time</pre></td>
585
+ <td><pre><a name="line179">179</a> </pre></td>
586
586
  </tr>
587
587
  <tr class="uncovered">
588
- <td><pre><a name="line180">180</a> return time</pre></td>
588
+ <td><pre><a name="line180">180</a> def get_timeclock_time(current_time=nil)</pre></td>
589
589
  </tr>
590
590
  <tr class="uncovered">
591
- <td><pre><a name="line181">181</a> end</pre></td>
591
+ <td><pre><a name="line181">181</a> current_time ||= @data.time</pre></td>
592
592
  </tr>
593
593
  <tr class="uncovered">
594
- <td><pre><a name="line182">182</a> </pre></td>
594
+ <td><pre><a name="line182">182</a> CodinRep::TimeUtil.pack current_time</pre></td>
595
595
  </tr>
596
596
  <tr class="uncovered">
597
- <td><pre><a name="line183">183</a> def convert_bytes_to_string(bytes)</pre></td>
597
+ <td><pre><a name="line183">183</a> end</pre></td>
598
598
  </tr>
599
599
  <tr class="uncovered">
600
- <td><pre><a name="line184">184</a> bytes.unpack(&#39;H*&#39;)[0]</pre></td>
600
+ <td><pre><a name="line184">184</a> </pre></td>
601
601
  </tr>
602
602
  <tr class="uncovered">
603
- <td><pre><a name="line185">185</a> end</pre></td>
603
+ <td><pre><a name="line185">185</a> def set_timeclock_time(payload)</pre></td>
604
604
  </tr>
605
605
  <tr class="uncovered">
606
- <td><pre><a name="line186">186</a> end</pre></td>
606
+ <td><pre><a name="line186">186</a> time = CodinRep::TimeUtil.unpack payload</pre></td>
607
607
  </tr>
608
608
  <tr class="uncovered">
609
- <td><pre><a name="line187">187</a> end</pre></td>
609
+ <td><pre><a name="line187">187</a> @data.time = time</pre></td>
610
+ </tr>
611
+ <tr class="uncovered">
612
+ <td><pre><a name="line188">188</a> return time</pre></td>
613
+ </tr>
614
+ <tr class="uncovered">
615
+ <td><pre><a name="line189">189</a> end</pre></td>
616
+ </tr>
617
+ <tr class="uncovered">
618
+ <td><pre><a name="line190">190</a> </pre></td>
619
+ </tr>
620
+ <tr class="uncovered">
621
+ <td><pre><a name="line191">191</a> def convert_bytes_to_string(bytes)</pre></td>
622
+ </tr>
623
+ <tr class="uncovered">
624
+ <td><pre><a name="line192">192</a> bytes.unpack(&#39;H*&#39;)[0]</pre></td>
625
+ </tr>
626
+ <tr class="uncovered">
627
+ <td><pre><a name="line193">193</a> end</pre></td>
628
+ </tr>
629
+ <tr class="uncovered">
630
+ <td><pre><a name="line194">194</a> end</pre></td>
631
+ </tr>
632
+ <tr class="uncovered">
633
+ <td><pre><a name="line195">195</a> end</pre></td>
610
634
  </tr>
611
635
  </tbody>
612
636
  </table>
613
637
 
614
- <p>Generated on 2017-01-31 16:03:32 -0200 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
638
+ <p>Generated on 2017-02-21 09:19:39 -0300 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
615
639
 
616
640
  </body>
617
641
  </html>
@@ -236,7 +236,7 @@
236
236
  </tbody>
237
237
  </table>
238
238
 
239
- <p>Generated on 2017-01-31 16:03:32 -0200 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
239
+ <p>Generated on 2017-02-21 09:19:39 -0300 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
240
240
 
241
241
  </body>
242
242
  </html>
@@ -206,7 +206,7 @@
206
206
  </tbody>
207
207
  </table>
208
208
 
209
- <p>Generated on 2017-01-31 16:03:32 -0200 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
209
+ <p>Generated on 2017-02-21 09:19:39 -0300 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
210
210
 
211
211
  </body>
212
212
  </html>
@@ -114,7 +114,7 @@
114
114
  <td><pre><a name="line22">22</a> module CodinRep</pre></td>
115
115
  </tr>
116
116
  <tr class="marked">
117
- <td><pre><a name="line23">23</a> VERSION = &quot;0.2.3&quot;.freeze</pre></td>
117
+ <td><pre><a name="line23">23</a> VERSION = &quot;0.2.5&quot;.freeze</pre></td>
118
118
  </tr>
119
119
  <tr class="inferred">
120
120
  <td><pre><a name="line24">24</a> end</pre></td>
@@ -122,7 +122,7 @@
122
122
  </tbody>
123
123
  </table>
124
124
 
125
- <p>Generated on 2017-01-31 16:03:32 -0200 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
125
+ <p>Generated on 2017-02-21 09:19:39 -0300 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
126
126
 
127
127
  </body>
128
128
  </html>