blackbox 3.2.0 → 3.3.0

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: 317095c5fb64f2f5345a6032e3e7336a1e3176b6
4
- data.tar.gz: e8b08beb86941881b40ee848144dea4536ad1c43
3
+ metadata.gz: fd439770497c284d17c5af5d41c66cb0cda688fc
4
+ data.tar.gz: 5a3324a00ff18c50f0fddbb8257cd9b5a476e8f8
5
5
  SHA512:
6
- metadata.gz: 75768cde97a26673c4ae774774330ade4afdff0649f30acc9aa66fc0503b2d57dff5852ac865fa9e33ee0a5b1c23b8a1c87a611ff6e6684f42ebb7b3c508da44
7
- data.tar.gz: 26880ff4d99d59e621f9d42fefea625e5274ca075c47035c7ef0ace9cb9fcafcb0a99f9fcaebb47f4763776a454c9535fde3d99a0847a48a445cd340db9c98b3
6
+ metadata.gz: 6dcfb05a55de1517900443519733259021b5cfc557e566606a7558ebc63cd92abfdb13b1ef8c792db6cb64c3756693da1c3261e15bdabcd779e79e5f2f521d8e
7
+ data.tar.gz: 8c4effdcc89b47fec5d38f22a155ed84777cfee55d827501b61cbdfcb1635df5a76e08193115087452b6a28645fb9a98fcc2898c5a3b3fb43db3bb84aa3be9d6
@@ -8,7 +8,7 @@ Metrics/CyclomaticComplexity:
8
8
  Max: 42
9
9
 
10
10
  Metrics/LineLength:
11
- Max: 133
11
+ Max: 200
12
12
 
13
13
  Metrics/MethodLength:
14
14
  Max: 100
@@ -32,7 +32,8 @@ Gem::Specification.new do |gem|
32
32
  gem.add_development_dependency 'timecop'
33
33
  gem.add_development_dependency 'rubocop'
34
34
 
35
- gem.add_dependency 'gem_update_checker'
36
- gem.add_dependency 'lolcat'
37
- gem.add_dependency 'rainbow'
35
+ gem.add_dependency 'gem_update_checker', '~> 0.2.0'
36
+ gem.add_dependency 'lolcat', '~> 42.1.43'
37
+ gem.add_dependency 'rainbow', '~> 2.1.0'
38
+ gem.add_dependency 'chronic_duration', '~> 0.10.6'
38
39
  end
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 81.07
3
+ "covered_percent": 82.06
4
4
  }
5
5
  }
@@ -5,6 +5,7 @@
5
5
  null,
6
6
  1,
7
7
  1,
8
+ 1,
8
9
  null,
9
10
  1,
10
11
  null,
@@ -19,12 +20,12 @@
19
20
  null,
20
21
  null,
21
22
  1,
22
- 697,
23
- 697,
24
- 697,
25
- 697,
26
- 328,
27
- 328,
23
+ 702,
24
+ 702,
25
+ 702,
26
+ 700,
27
+ 331,
28
+ 331,
28
29
  null,
29
30
  369,
30
31
  369,
@@ -39,16 +40,16 @@
39
40
  null,
40
41
  null,
41
42
  1,
42
- 369,
43
- 369,
44
- 369,
45
- 369,
46
- 246,
47
- 246,
43
+ 372,
44
+ 372,
45
+ 372,
46
+ 372,
47
+ 249,
48
+ 249,
48
49
  null,
49
50
  123,
50
51
  null,
51
- 369,
52
+ 372,
52
53
  null,
53
54
  null,
54
55
  null,
@@ -83,7 +84,7 @@
83
84
  null,
84
85
  null,
85
86
  1,
86
- 246,
87
+ 251,
87
88
  null,
88
89
  null,
89
90
  null,
@@ -94,7 +95,50 @@
94
95
  null,
95
96
  null,
96
97
  1,
97
- 123,
98
+ 126,
99
+ null,
100
+ null,
101
+ null,
102
+ null,
103
+ 1,
104
+ 1,
105
+ null,
106
+ null,
107
+ null,
108
+ null,
109
+ null,
110
+ null,
111
+ null,
112
+ null,
113
+ 1,
114
+ 6,
115
+ null,
116
+ 5,
117
+ 5,
118
+ 5,
119
+ null,
120
+ null,
121
+ null,
122
+ null,
123
+ null,
124
+ null,
125
+ null,
126
+ null,
127
+ null,
128
+ 1,
129
+ 3,
130
+ 3,
131
+ 3,
132
+ 3,
133
+ 3,
134
+ 3,
135
+ 1,
136
+ null,
137
+ null,
138
+ null,
139
+ null,
140
+ 2,
141
+ null,
98
142
  null,
99
143
  null,
100
144
  null,
@@ -134,7 +178,7 @@
134
178
  null,
135
179
  8,
136
180
  8,
137
- 64,
181
+ 80,
138
182
  null,
139
183
  null,
140
184
  8,
@@ -162,7 +206,7 @@
162
206
  7,
163
207
  7,
164
208
  null,
165
- 1,
209
+ 0,
166
210
  null,
167
211
  null,
168
212
  7,
@@ -324,7 +368,6 @@
324
368
  null,
325
369
  null,
326
370
  null,
327
- null,
328
371
  10,
329
372
  null,
330
373
  null,
@@ -565,6 +608,6 @@
565
608
  null
566
609
  ]
567
610
  },
568
- "timestamp": 1465776828
611
+ "timestamp": 1469891309
569
612
  }
570
613
  }
@@ -14,27 +14,27 @@
14
14
  <img src="./assets/0.10.0/loading.gif" alt="loading"/>
15
15
  </div>
16
16
  <div id="wrapper" style="display:none;">
17
- <div class="timestamp">Generated <abbr class="timeago" title="2016-06-13T02:13:48+02:00">2016-06-13T02:13:48+02:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2016-07-30T17:08:29+02:00">2016-07-30T17:08:29+02:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
21
21
  <div class="file_list_container" id="AllFiles">
22
22
  <h2>
23
23
  <span class="group_name">All Files</span>
24
- (<span class="covered_percent"><span class="yellow">81.07%</span></span>
24
+ (<span class="covered_percent"><span class="yellow">82.06%</span></span>
25
25
  covered at
26
26
  <span class="covered_strength">
27
27
  <span class="green">
28
- 40.95
28
+ 38.36
29
29
  </span>
30
30
  </span> hits/line)
31
31
  </h2>
32
32
  <a name="AllFiles"></a>
33
33
  <div>
34
34
  <b>6</b> files in total.
35
- <b>206</b> relevant lines.
36
- <span class="green"><b>167</b> lines covered</span> and
37
- <span class="red"><b>39</b> lines missed </span>
35
+ <b>223</b> relevant lines.
36
+ <span class="green"><b>183</b> lines covered</span> and
37
+ <span class="red"><b>40</b> lines missed </span>
38
38
  </div>
39
39
  <table class="file_list">
40
40
  <thead>
@@ -53,21 +53,21 @@
53
53
  <tr>
54
54
  <td class="strong"><a href="#f65d5c5fcad29642ef7df71c31f708bfebe1c731" class="src_link" title="lib/blackbox/crypto.rb">lib/blackbox/crypto.rb</a></td>
55
55
  <td class="green strong">100.0 %</td>
56
- <td>97</td>
57
- <td>31</td>
58
- <td>31</td>
56
+ <td>141</td>
57
+ <td>48</td>
58
+ <td>48</td>
59
59
  <td>0</td>
60
- <td>238.4</td>
60
+ <td>156.1</td>
61
61
  </tr>
62
62
 
63
63
  <tr>
64
64
  <td class="strong"><a href="#192e300fd7769b750c82567439ee016f85516f3d" class="src_link" title="lib/blackbox/gem.rb">lib/blackbox/gem.rb</a></td>
65
- <td class="green strong">100.0 %</td>
65
+ <td class="green strong">96.97 %</td>
66
66
  <td>93</td>
67
67
  <td>33</td>
68
- <td>33</td>
69
- <td>0</td>
70
- <td>7.3</td>
68
+ <td>32</td>
69
+ <td>1</td>
70
+ <td>7.8</td>
71
71
  </tr>
72
72
 
73
73
  <tr>
@@ -83,7 +83,7 @@
83
83
  <tr>
84
84
  <td class="strong"><a href="#09e4da465507022615e91e2292a827cde0e5535c" class="src_link" title="lib/blackbox/number.rb">lib/blackbox/number.rb</a></td>
85
85
  <td class="green strong">100.0 %</td>
86
- <td>182</td>
86
+ <td>181</td>
87
87
  <td>52</td>
88
88
  <td>52</td>
89
89
  <td>0</td>
@@ -131,8 +131,8 @@
131
131
  <h3>lib/blackbox/crypto.rb</h3>
132
132
  <h4><span class="green">100.0 %</span> covered</h4>
133
133
  <div>
134
- <b>31</b> relevant lines.
135
- <span class="green"><b>31</b> lines covered</span> and
134
+ <b>48</b> relevant lines.
135
+ <span class="green"><b>48</b> lines covered</span> and
136
136
  <span class="red"><b>0</b> lines missed.</span>
137
137
  </div>
138
138
  </div>
@@ -158,565 +158,829 @@
158
158
  <code class="ruby">require &#39;base64&#39;</code>
159
159
  </li>
160
160
 
161
- <li class="never" data-hits="" data-linenumber="4">
161
+ <li class="covered" data-hits="1" data-linenumber="4">
162
+ <span class="hits">1</span>
163
+
164
+ <code class="ruby">require &#39;chronic_duration&#39;</code>
165
+ </li>
166
+
167
+ <li class="never" data-hits="" data-linenumber="5">
162
168
 
163
169
 
164
170
  <code class="ruby"></code>
165
171
  </li>
166
172
 
167
- <li class="covered" data-hits="1" data-linenumber="5">
173
+ <li class="covered" data-hits="1" data-linenumber="6">
168
174
  <span class="hits">1</span>
169
175
 
170
176
  <code class="ruby">module BB</code>
171
177
  </li>
172
178
 
173
- <li class="never" data-hits="" data-linenumber="6">
179
+ <li class="never" data-hits="" data-linenumber="7">
174
180
 
175
181
 
176
182
  <code class="ruby"> # Crypto utilities.</code>
177
183
  </li>
178
184
 
179
- <li class="covered" data-hits="1" data-linenumber="7">
185
+ <li class="covered" data-hits="1" data-linenumber="8">
180
186
  <span class="hits">1</span>
181
187
 
182
188
  <code class="ruby"> module Crypto</code>
183
189
  </li>
184
190
 
185
- <li class="covered" data-hits="1" data-linenumber="8">
191
+ <li class="covered" data-hits="1" data-linenumber="9">
186
192
  <span class="hits">1</span>
187
193
 
188
194
  <code class="ruby"> class &lt;&lt; self</code>
189
195
  </li>
190
196
 
191
- <li class="never" data-hits="" data-linenumber="9">
197
+ <li class="never" data-hits="" data-linenumber="10">
192
198
 
193
199
 
194
200
  <code class="ruby"> # Encrypt a String.</code>
195
201
  </li>
196
202
 
197
- <li class="never" data-hits="" data-linenumber="10">
203
+ <li class="never" data-hits="" data-linenumber="11">
198
204
 
199
205
 
200
206
  <code class="ruby"> #</code>
201
207
  </li>
202
208
 
203
- <li class="never" data-hits="" data-linenumber="11">
209
+ <li class="never" data-hits="" data-linenumber="12">
204
210
 
205
211
 
206
212
  <code class="ruby"> # @param [String] plaintext Input String (plaintext)</code>
207
213
  </li>
208
214
 
209
- <li class="never" data-hits="" data-linenumber="12">
215
+ <li class="never" data-hits="" data-linenumber="13">
210
216
 
211
217
 
212
218
  <code class="ruby"> # @param [String] key Encryption key</code>
213
219
  </li>
214
220
 
215
- <li class="never" data-hits="" data-linenumber="13">
221
+ <li class="never" data-hits="" data-linenumber="14">
216
222
 
217
223
 
218
224
  <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
219
225
  </li>
220
226
 
221
- <li class="never" data-hits="" data-linenumber="14">
227
+ <li class="never" data-hits="" data-linenumber="15">
222
228
 
223
229
 
224
230
  <code class="ruby"> # @param [String] iv Initialization vector</code>
225
231
  </li>
226
232
 
227
- <li class="never" data-hits="" data-linenumber="15">
233
+ <li class="never" data-hits="" data-linenumber="16">
228
234
 
229
235
 
230
236
  <code class="ruby"> # @return [String] When iv == nil: iv_length+iv+ciphertext</code>
231
237
  </li>
232
238
 
233
- <li class="never" data-hits="" data-linenumber="16">
239
+ <li class="never" data-hits="" data-linenumber="17">
234
240
 
235
241
 
236
242
  <code class="ruby"> # @return [String] When iv != nil: ciphertext</code>
237
243
  </li>
238
244
 
239
- <li class="covered" data-hits="1" data-linenumber="17">
245
+ <li class="covered" data-hits="1" data-linenumber="18">
240
246
  <span class="hits">1</span>
241
247
 
242
248
  <code class="ruby"> def encrypt(plaintext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
243
249
  </li>
244
250
 
245
- <li class="covered" data-hits="697" data-linenumber="18">
246
- <span class="hits">697</span>
251
+ <li class="covered" data-hits="702" data-linenumber="19">
252
+ <span class="hits">702</span>
247
253
 
248
254
  <code class="ruby"> cipher = OpenSSL::Cipher::Cipher.new(cipher_type)</code>
249
255
  </li>
250
256
 
251
- <li class="covered" data-hits="697" data-linenumber="19">
252
- <span class="hits">697</span>
257
+ <li class="covered" data-hits="702" data-linenumber="20">
258
+ <span class="hits">702</span>
253
259
 
254
260
  <code class="ruby"> cipher.encrypt</code>
255
261
  </li>
256
262
 
257
- <li class="covered" data-hits="697" data-linenumber="20">
258
- <span class="hits">697</span>
263
+ <li class="covered" data-hits="702" data-linenumber="21">
264
+ <span class="hits">702</span>
259
265
 
260
266
  <code class="ruby"> cipher.key = key</code>
261
267
  </li>
262
268
 
263
- <li class="covered" data-hits="697" data-linenumber="21">
264
- <span class="hits">697</span>
269
+ <li class="covered" data-hits="700" data-linenumber="22">
270
+ <span class="hits">700</span>
265
271
 
266
272
  <code class="ruby"> if iv.nil?</code>
267
273
  </li>
268
274
 
269
- <li class="covered" data-hits="328" data-linenumber="22">
270
- <span class="hits">328</span>
275
+ <li class="covered" data-hits="331" data-linenumber="23">
276
+ <span class="hits">331</span>
271
277
 
272
278
  <code class="ruby"> iv = cipher.random_iv</code>
273
279
  </li>
274
280
 
275
- <li class="covered" data-hits="328" data-linenumber="23">
276
- <span class="hits">328</span>
281
+ <li class="covered" data-hits="331" data-linenumber="24">
282
+ <span class="hits">331</span>
277
283
 
278
284
  <code class="ruby"> [iv.length].pack(&#39;C&#39;) + iv + cipher.update(plaintext) + cipher.final</code>
279
285
  </li>
280
286
 
281
- <li class="never" data-hits="" data-linenumber="24">
287
+ <li class="never" data-hits="" data-linenumber="25">
282
288
 
283
289
 
284
290
  <code class="ruby"> else</code>
285
291
  </li>
286
292
 
287
- <li class="covered" data-hits="369" data-linenumber="25">
293
+ <li class="covered" data-hits="369" data-linenumber="26">
288
294
  <span class="hits">369</span>
289
295
 
290
296
  <code class="ruby"> cipher.iv = iv</code>
291
297
  </li>
292
298
 
293
- <li class="covered" data-hits="369" data-linenumber="26">
299
+ <li class="covered" data-hits="369" data-linenumber="27">
294
300
  <span class="hits">369</span>
295
301
 
296
302
  <code class="ruby"> cipher.update(plaintext) + cipher.final</code>
297
303
  </li>
298
304
 
299
- <li class="never" data-hits="" data-linenumber="27">
305
+ <li class="never" data-hits="" data-linenumber="28">
300
306
 
301
307
 
302
308
  <code class="ruby"> end</code>
303
309
  </li>
304
310
 
305
- <li class="never" data-hits="" data-linenumber="28">
311
+ <li class="never" data-hits="" data-linenumber="29">
306
312
 
307
313
 
308
314
  <code class="ruby"> end</code>
309
315
  </li>
310
316
 
311
- <li class="never" data-hits="" data-linenumber="29">
317
+ <li class="never" data-hits="" data-linenumber="30">
312
318
 
313
319
 
314
320
  <code class="ruby"></code>
315
321
  </li>
316
322
 
317
- <li class="never" data-hits="" data-linenumber="30">
323
+ <li class="never" data-hits="" data-linenumber="31">
318
324
 
319
325
 
320
326
  <code class="ruby"> # Decrypt a String.</code>
321
327
  </li>
322
328
 
323
- <li class="never" data-hits="" data-linenumber="31">
329
+ <li class="never" data-hits="" data-linenumber="32">
324
330
 
325
331
 
326
332
  <code class="ruby"> #</code>
327
333
  </li>
328
334
 
329
- <li class="never" data-hits="" data-linenumber="32">
335
+ <li class="never" data-hits="" data-linenumber="33">
330
336
 
331
337
 
332
338
  <code class="ruby"> # @param [String] ciphertext Input String (ciphertext)</code>
333
339
  </li>
334
340
 
335
- <li class="never" data-hits="" data-linenumber="33">
341
+ <li class="never" data-hits="" data-linenumber="34">
336
342
 
337
343
 
338
344
  <code class="ruby"> # @param [String] key Encryption key</code>
339
345
  </li>
340
346
 
341
- <li class="never" data-hits="" data-linenumber="34">
347
+ <li class="never" data-hits="" data-linenumber="35">
342
348
 
343
349
 
344
350
  <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
345
351
  </li>
346
352
 
347
- <li class="never" data-hits="" data-linenumber="35">
353
+ <li class="never" data-hits="" data-linenumber="36">
348
354
 
349
355
 
350
356
  <code class="ruby"> # @param [String] iv Initialization vector</code>
351
357
  </li>
352
358
 
353
- <li class="never" data-hits="" data-linenumber="36">
359
+ <li class="never" data-hits="" data-linenumber="37">
354
360
 
355
361
 
356
362
  <code class="ruby"> # @return [String] Plaintext</code>
357
363
  </li>
358
364
 
359
- <li class="covered" data-hits="1" data-linenumber="37">
365
+ <li class="covered" data-hits="1" data-linenumber="38">
360
366
  <span class="hits">1</span>
361
367
 
362
368
  <code class="ruby"> def decrypt(ciphertext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
363
369
  </li>
364
370
 
365
- <li class="covered" data-hits="369" data-linenumber="38">
366
- <span class="hits">369</span>
371
+ <li class="covered" data-hits="372" data-linenumber="39">
372
+ <span class="hits">372</span>
367
373
 
368
374
  <code class="ruby"> cipher = OpenSSL::Cipher::Cipher.new(cipher_type)</code>
369
375
  </li>
370
376
 
371
- <li class="covered" data-hits="369" data-linenumber="39">
372
- <span class="hits">369</span>
377
+ <li class="covered" data-hits="372" data-linenumber="40">
378
+ <span class="hits">372</span>
373
379
 
374
380
  <code class="ruby"> cipher.decrypt</code>
375
381
  </li>
376
382
 
377
- <li class="covered" data-hits="369" data-linenumber="40">
378
- <span class="hits">369</span>
383
+ <li class="covered" data-hits="372" data-linenumber="41">
384
+ <span class="hits">372</span>
379
385
 
380
386
  <code class="ruby"> cipher.key = key</code>
381
387
  </li>
382
388
 
383
- <li class="covered" data-hits="369" data-linenumber="41">
384
- <span class="hits">369</span>
389
+ <li class="covered" data-hits="372" data-linenumber="42">
390
+ <span class="hits">372</span>
385
391
 
386
392
  <code class="ruby"> if iv.nil?</code>
387
393
  </li>
388
394
 
389
- <li class="covered" data-hits="246" data-linenumber="42">
390
- <span class="hits">246</span>
395
+ <li class="covered" data-hits="249" data-linenumber="43">
396
+ <span class="hits">249</span>
391
397
 
392
398
  <code class="ruby"> iv_len = ciphertext.slice!(0).unpack(&#39;C&#39;)[0]</code>
393
399
  </li>
394
400
 
395
- <li class="covered" data-hits="246" data-linenumber="43">
396
- <span class="hits">246</span>
401
+ <li class="covered" data-hits="249" data-linenumber="44">
402
+ <span class="hits">249</span>
397
403
 
398
404
  <code class="ruby"> cipher.iv = ciphertext.slice!(0..iv_len - 1) unless 0 == iv_len</code>
399
405
  </li>
400
406
 
401
- <li class="never" data-hits="" data-linenumber="44">
407
+ <li class="never" data-hits="" data-linenumber="45">
402
408
 
403
409
 
404
410
  <code class="ruby"> else</code>
405
411
  </li>
406
412
 
407
- <li class="covered" data-hits="123" data-linenumber="45">
413
+ <li class="covered" data-hits="123" data-linenumber="46">
408
414
  <span class="hits">123</span>
409
415
 
410
416
  <code class="ruby"> cipher.iv = iv</code>
411
417
  </li>
412
418
 
413
- <li class="never" data-hits="" data-linenumber="46">
419
+ <li class="never" data-hits="" data-linenumber="47">
414
420
 
415
421
 
416
422
  <code class="ruby"> end</code>
417
423
  </li>
418
424
 
419
- <li class="covered" data-hits="369" data-linenumber="47">
420
- <span class="hits">369</span>
425
+ <li class="covered" data-hits="372" data-linenumber="48">
426
+ <span class="hits">372</span>
421
427
 
422
428
  <code class="ruby"> cipher.update(ciphertext) + cipher.final</code>
423
429
  </li>
424
430
 
425
- <li class="never" data-hits="" data-linenumber="48">
431
+ <li class="never" data-hits="" data-linenumber="49">
426
432
 
427
433
 
428
434
  <code class="ruby"> end</code>
429
435
  </li>
430
436
 
431
- <li class="never" data-hits="" data-linenumber="49">
437
+ <li class="never" data-hits="" data-linenumber="50">
432
438
 
433
439
 
434
440
  <code class="ruby"></code>
435
441
  </li>
436
442
 
437
- <li class="never" data-hits="" data-linenumber="50">
443
+ <li class="never" data-hits="" data-linenumber="51">
438
444
 
439
445
 
440
446
  <code class="ruby"> # Encrypt a String and encode the resulting ciphertext to Base64.</code>
441
447
  </li>
442
448
 
443
- <li class="never" data-hits="" data-linenumber="51">
449
+ <li class="never" data-hits="" data-linenumber="52">
444
450
 
445
451
 
446
452
  <code class="ruby"> #</code>
447
453
  </li>
448
454
 
449
- <li class="never" data-hits="" data-linenumber="52">
455
+ <li class="never" data-hits="" data-linenumber="53">
450
456
 
451
457
 
452
458
  <code class="ruby"> # @param [String] plaintext Input String (plaintext)</code>
453
459
  </li>
454
460
 
455
- <li class="never" data-hits="" data-linenumber="53">
461
+ <li class="never" data-hits="" data-linenumber="54">
456
462
 
457
463
 
458
464
  <code class="ruby"> # @param [String] key Encryption key</code>
459
465
  </li>
460
466
 
461
- <li class="never" data-hits="" data-linenumber="54">
467
+ <li class="never" data-hits="" data-linenumber="55">
462
468
 
463
469
 
464
470
  <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
465
471
  </li>
466
472
 
467
- <li class="never" data-hits="" data-linenumber="55">
473
+ <li class="never" data-hits="" data-linenumber="56">
468
474
 
469
475
 
470
476
  <code class="ruby"> # @param [String] iv Initialization vector</code>
471
477
  </li>
472
478
 
473
- <li class="never" data-hits="" data-linenumber="56">
479
+ <li class="never" data-hits="" data-linenumber="57">
474
480
 
475
481
 
476
482
  <code class="ruby"> # @return [String] When iv == nil: base64(iv_length+iv+ciphertext)</code>
477
483
  </li>
478
484
 
479
- <li class="never" data-hits="" data-linenumber="57">
485
+ <li class="never" data-hits="" data-linenumber="58">
480
486
 
481
487
 
482
488
  <code class="ruby"> # @return [String] When iv != nil: base64(ciphertext)</code>
483
489
  </li>
484
490
 
485
- <li class="covered" data-hits="1" data-linenumber="58">
491
+ <li class="covered" data-hits="1" data-linenumber="59">
486
492
  <span class="hits">1</span>
487
493
 
488
494
  <code class="ruby"> def encrypt_base64(plaintext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
489
495
  </li>
490
496
 
491
- <li class="covered" data-hits="246" data-linenumber="59">
497
+ <li class="covered" data-hits="246" data-linenumber="60">
492
498
  <span class="hits">246</span>
493
499
 
494
500
  <code class="ruby"> Base64.strict_encode64(encrypt(plaintext, key, cipher_type, iv))</code>
495
501
  </li>
496
502
 
497
- <li class="never" data-hits="" data-linenumber="60">
503
+ <li class="never" data-hits="" data-linenumber="61">
498
504
 
499
505
 
500
506
  <code class="ruby"> end</code>
501
507
  </li>
502
508
 
503
- <li class="never" data-hits="" data-linenumber="61">
509
+ <li class="never" data-hits="" data-linenumber="62">
504
510
 
505
511
 
506
512
  <code class="ruby"></code>
507
513
  </li>
508
514
 
509
- <li class="never" data-hits="" data-linenumber="62">
515
+ <li class="never" data-hits="" data-linenumber="63">
510
516
 
511
517
 
512
518
  <code class="ruby"> # Decode and Decrypt a Base64-String.</code>
513
519
  </li>
514
520
 
515
- <li class="never" data-hits="" data-linenumber="63">
521
+ <li class="never" data-hits="" data-linenumber="64">
516
522
 
517
523
 
518
524
  <code class="ruby"> #</code>
519
525
  </li>
520
526
 
521
- <li class="never" data-hits="" data-linenumber="64">
527
+ <li class="never" data-hits="" data-linenumber="65">
522
528
 
523
529
 
524
530
  <code class="ruby"> # @param [String] ciphertext Input String (base64(ciphertext))</code>
525
531
  </li>
526
532
 
527
- <li class="never" data-hits="" data-linenumber="65">
533
+ <li class="never" data-hits="" data-linenumber="66">
528
534
 
529
535
 
530
536
  <code class="ruby"> # @param [String] key Encryption key</code>
531
537
  </li>
532
538
 
533
- <li class="never" data-hits="" data-linenumber="66">
539
+ <li class="never" data-hits="" data-linenumber="67">
534
540
 
535
541
 
536
542
  <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
537
543
  </li>
538
544
 
539
- <li class="never" data-hits="" data-linenumber="67">
545
+ <li class="never" data-hits="" data-linenumber="68">
540
546
 
541
547
 
542
548
  <code class="ruby"> # @param [String] iv Initialization vector</code>
543
549
  </li>
544
550
 
545
- <li class="never" data-hits="" data-linenumber="68">
551
+ <li class="never" data-hits="" data-linenumber="69">
552
+
553
+
554
+ <code class="ruby"> # @return [String] Plaintext</code>
555
+ </li>
556
+
557
+ <li class="covered" data-hits="1" data-linenumber="70">
558
+ <span class="hits">1</span>
559
+
560
+ <code class="ruby"> def decrypt_base64(ciphertext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
561
+ </li>
562
+
563
+ <li class="covered" data-hits="123" data-linenumber="71">
564
+ <span class="hits">123</span>
565
+
566
+ <code class="ruby"> decrypt(Base64.decode64(ciphertext), key, cipher_type, iv)</code>
567
+ </li>
568
+
569
+ <li class="never" data-hits="" data-linenumber="72">
570
+
571
+
572
+ <code class="ruby"> end</code>
573
+ </li>
574
+
575
+ <li class="never" data-hits="" data-linenumber="73">
576
+
577
+
578
+ <code class="ruby"></code>
579
+ </li>
580
+
581
+ <li class="never" data-hits="" data-linenumber="74">
582
+
583
+
584
+ <code class="ruby"> # Encrypt a String and encode the resulting ciphertext to urlsafe Base64.</code>
585
+ </li>
586
+
587
+ <li class="never" data-hits="" data-linenumber="75">
588
+
589
+
590
+ <code class="ruby"> #</code>
591
+ </li>
592
+
593
+ <li class="never" data-hits="" data-linenumber="76">
594
+
595
+
596
+ <code class="ruby"> # @param [String] plaintext Input String (plaintext)</code>
597
+ </li>
598
+
599
+ <li class="never" data-hits="" data-linenumber="77">
600
+
601
+
602
+ <code class="ruby"> # @param [String] key Encryption key</code>
603
+ </li>
604
+
605
+ <li class="never" data-hits="" data-linenumber="78">
606
+
607
+
608
+ <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
609
+ </li>
610
+
611
+ <li class="never" data-hits="" data-linenumber="79">
612
+
613
+
614
+ <code class="ruby"> # @param [String] iv Initialization vector</code>
615
+ </li>
616
+
617
+ <li class="never" data-hits="" data-linenumber="80">
618
+
619
+
620
+ <code class="ruby"> # @return [String] When iv == nil: urlsafe_base64(iv_length+iv+ciphertext)</code>
621
+ </li>
622
+
623
+ <li class="never" data-hits="" data-linenumber="81">
624
+
625
+
626
+ <code class="ruby"> # @return [String] When iv != nil: urlsafe_base64(ciphertext)</code>
627
+ </li>
628
+
629
+ <li class="covered" data-hits="1" data-linenumber="82">
630
+ <span class="hits">1</span>
631
+
632
+ <code class="ruby"> def encrypt_urlsafe_base64(plaintext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
633
+ </li>
634
+
635
+ <li class="covered" data-hits="251" data-linenumber="83">
636
+ <span class="hits">251</span>
637
+
638
+ <code class="ruby"> Base64.urlsafe_encode64(encrypt(plaintext, key, cipher_type, iv))</code>
639
+ </li>
640
+
641
+ <li class="never" data-hits="" data-linenumber="84">
642
+
643
+
644
+ <code class="ruby"> end</code>
645
+ </li>
646
+
647
+ <li class="never" data-hits="" data-linenumber="85">
648
+
649
+
650
+ <code class="ruby"></code>
651
+ </li>
652
+
653
+ <li class="never" data-hits="" data-linenumber="86">
654
+
655
+
656
+ <code class="ruby"> # Decode and Decrypt an urlsafe Base64-String.</code>
657
+ </li>
658
+
659
+ <li class="never" data-hits="" data-linenumber="87">
660
+
661
+
662
+ <code class="ruby"> #</code>
663
+ </li>
664
+
665
+ <li class="never" data-hits="" data-linenumber="88">
666
+
667
+
668
+ <code class="ruby"> # @param [String] ciphertext Input String (urlsafe_base64(ciphertext))</code>
669
+ </li>
670
+
671
+ <li class="never" data-hits="" data-linenumber="89">
672
+
673
+
674
+ <code class="ruby"> # @param [String] key Encryption key</code>
675
+ </li>
676
+
677
+ <li class="never" data-hits="" data-linenumber="90">
678
+
679
+
680
+ <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
681
+ </li>
682
+
683
+ <li class="never" data-hits="" data-linenumber="91">
684
+
685
+
686
+ <code class="ruby"> # @param [String] iv Initialization vector</code>
687
+ </li>
688
+
689
+ <li class="never" data-hits="" data-linenumber="92">
690
+
691
+
692
+ <code class="ruby"> # @return [String] Plaintext</code>
693
+ </li>
694
+
695
+ <li class="covered" data-hits="1" data-linenumber="93">
696
+ <span class="hits">1</span>
697
+
698
+ <code class="ruby"> def decrypt_urlsafe_base64(ciphertext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
699
+ </li>
700
+
701
+ <li class="covered" data-hits="126" data-linenumber="94">
702
+ <span class="hits">126</span>
703
+
704
+ <code class="ruby"> decrypt(Base64.urlsafe_decode64(ciphertext), key, cipher_type, iv)</code>
705
+ </li>
706
+
707
+ <li class="never" data-hits="" data-linenumber="95">
708
+
709
+
710
+ <code class="ruby"> end</code>
711
+ </li>
712
+
713
+ <li class="never" data-hits="" data-linenumber="96">
714
+
715
+
716
+ <code class="ruby"> end</code>
717
+ </li>
718
+
719
+ <li class="never" data-hits="" data-linenumber="97">
720
+
721
+
722
+ <code class="ruby"></code>
723
+ </li>
724
+
725
+ <li class="never" data-hits="" data-linenumber="98">
726
+
727
+
728
+ <code class="ruby"> # Secure Control Token.</code>
729
+ </li>
730
+
731
+ <li class="covered" data-hits="1" data-linenumber="99">
732
+ <span class="hits">1</span>
733
+
734
+ <code class="ruby"> class ControlToken</code>
735
+ </li>
736
+
737
+ <li class="covered" data-hits="1" data-linenumber="100">
738
+ <span class="hits">1</span>
739
+
740
+ <code class="ruby"> class &lt;&lt; self</code>
741
+ </li>
742
+
743
+ <li class="never" data-hits="" data-linenumber="101">
744
+
745
+
746
+ <code class="ruby"> # Encode and encrypt an urlsafe ControlToken.</code>
747
+ </li>
748
+
749
+ <li class="never" data-hits="" data-linenumber="102">
750
+
751
+
752
+ <code class="ruby"> #</code>
753
+ </li>
754
+
755
+ <li class="never" data-hits="" data-linenumber="103">
756
+
757
+
758
+ <code class="ruby"> # @param [String] op Operation id</code>
759
+ </li>
760
+
761
+ <li class="never" data-hits="" data-linenumber="104">
762
+
763
+
764
+ <code class="ruby"> # @param [Array] args Arguments (Strings)</code>
765
+ </li>
766
+
767
+ <li class="never" data-hits="" data-linenumber="105">
768
+
769
+
770
+ <code class="ruby"> # @param [Fixnum] expire_in</code>
771
+ </li>
772
+
773
+ <li class="never" data-hits="" data-linenumber="106">
774
+
775
+
776
+ <code class="ruby"> # @param [String] key Encryption key</code>
777
+ </li>
778
+
779
+ <li class="never" data-hits="" data-linenumber="107">
780
+
781
+
782
+ <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
783
+ </li>
784
+
785
+ <li class="never" data-hits="" data-linenumber="108">
786
+
787
+
788
+ <code class="ruby"> # @return [String] ControlToken (urlsafe base64)</code>
789
+ </li>
790
+
791
+ <li class="covered" data-hits="1" data-linenumber="109">
792
+ <span class="hits">1</span>
793
+
794
+ <code class="ruby"> def create(op, args, expire_in = 900, key = ENV[&#39;CONTROLTOKEN_SECRET&#39;], cipher_type = &#39;aes-256-cbc&#39;)</code>
795
+ </li>
796
+
797
+ <li class="covered" data-hits="6" data-linenumber="110">
798
+ <span class="hits">6</span>
799
+
800
+ <code class="ruby"> raise ArgumentError, &#39;key can not be blank&#39; if key.nil? || key.empty?</code>
801
+ </li>
802
+
803
+ <li class="never" data-hits="" data-linenumber="111">
546
804
 
547
805
 
548
- <code class="ruby"> # @return [String] Plaintext</code>
806
+ <code class="ruby"> # If you&#39;re reading this in the year 2038: Hi there! :-)</code>
549
807
  </li>
550
808
 
551
- <li class="covered" data-hits="1" data-linenumber="69">
552
- <span class="hits">1</span>
809
+ <li class="covered" data-hits="5" data-linenumber="112">
810
+ <span class="hits">5</span>
553
811
 
554
- <code class="ruby"> def decrypt_base64(ciphertext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
812
+ <code class="ruby"> [Time.now.to_i + expire_in].pack(&#39;l&lt;&#39;)</code>
555
813
  </li>
556
814
 
557
- <li class="covered" data-hits="123" data-linenumber="70">
558
- <span class="hits">123</span>
815
+ <li class="covered" data-hits="5" data-linenumber="113">
816
+ <span class="hits">5</span>
559
817
 
560
- <code class="ruby"> decrypt(Base64.decode64(ciphertext), key, cipher_type, iv)</code>
818
+ <code class="ruby"> body = ([[Time.now.to_i + expire_in].pack(&#39;l&lt;&#39;), op] + args).join(&quot;\x00&quot;)</code>
561
819
  </li>
562
820
 
563
- <li class="never" data-hits="" data-linenumber="71">
564
-
821
+ <li class="covered" data-hits="5" data-linenumber="114">
822
+ <span class="hits">5</span>
565
823
 
566
- <code class="ruby"> end</code>
824
+ <code class="ruby"> BB::Crypto.encrypt_urlsafe_base64(body, key, cipher_type)</code>
567
825
  </li>
568
826
 
569
- <li class="never" data-hits="" data-linenumber="72">
827
+ <li class="never" data-hits="" data-linenumber="115">
570
828
 
571
829
 
572
- <code class="ruby"></code>
830
+ <code class="ruby"> end</code>
573
831
  </li>
574
832
 
575
- <li class="never" data-hits="" data-linenumber="73">
833
+ <li class="never" data-hits="" data-linenumber="116">
576
834
 
577
835
 
578
- <code class="ruby"> # Encrypt a String and encode the resulting ciphertext to urlsafe Base64.</code>
836
+ <code class="ruby"></code>
579
837
  </li>
580
838
 
581
- <li class="never" data-hits="" data-linenumber="74">
839
+ <li class="never" data-hits="" data-linenumber="117">
582
840
 
583
841
 
584
- <code class="ruby"> #</code>
842
+ <code class="ruby"> # Decrypt and parse an urlsafe ControlToken.</code>
585
843
  </li>
586
844
 
587
- <li class="never" data-hits="" data-linenumber="75">
845
+ <li class="never" data-hits="" data-linenumber="118">
588
846
 
589
847
 
590
- <code class="ruby"> # @param [String] plaintext Input String (plaintext)</code>
848
+ <code class="ruby"> #</code>
591
849
  </li>
592
850
 
593
- <li class="never" data-hits="" data-linenumber="76">
851
+ <li class="never" data-hits="" data-linenumber="119">
594
852
 
595
853
 
596
- <code class="ruby"> # @param [String] key Encryption key</code>
854
+ <code class="ruby"> # @param [String] token Input String (urlsafe base64)</code>
597
855
  </li>
598
856
 
599
- <li class="never" data-hits="" data-linenumber="77">
857
+ <li class="never" data-hits="" data-linenumber="120">
600
858
 
601
859
 
602
- <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
860
+ <code class="ruby"> # @param [String] key Encryption key</code>
603
861
  </li>
604
862
 
605
- <li class="never" data-hits="" data-linenumber="78">
863
+ <li class="never" data-hits="" data-linenumber="121">
606
864
 
607
865
 
608
- <code class="ruby"> # @param [String] iv Initialization vector</code>
866
+ <code class="ruby"> # @param [Boolean] force Decode expired token (suppress ArgumentError)</code>
609
867
  </li>
610
868
 
611
- <li class="never" data-hits="" data-linenumber="79">
869
+ <li class="never" data-hits="" data-linenumber="122">
612
870
 
613
871
 
614
- <code class="ruby"> # @return [String] When iv == nil: urlsafe_base64(iv_length+iv+ciphertext)</code>
872
+ <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
615
873
  </li>
616
874
 
617
- <li class="never" data-hits="" data-linenumber="80">
875
+ <li class="never" data-hits="" data-linenumber="123">
618
876
 
619
877
 
620
- <code class="ruby"> # @return [String] When iv != nil: urlsafe_base64(ciphertext)</code>
878
+ <code class="ruby"> # @return [Hash] Token payload</code>
621
879
  </li>
622
880
 
623
- <li class="covered" data-hits="1" data-linenumber="81">
881
+ <li class="covered" data-hits="1" data-linenumber="124">
624
882
  <span class="hits">1</span>
625
883
 
626
- <code class="ruby"> def encrypt_urlsafe_base64(plaintext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
884
+ <code class="ruby"> def parse(token, key = ENV[&#39;CONTROLTOKEN_SECRET&#39;], force = false, cipher_type = &#39;aes-256-cbc&#39;)</code>
627
885
  </li>
628
886
 
629
- <li class="covered" data-hits="246" data-linenumber="82">
630
- <span class="hits">246</span>
887
+ <li class="covered" data-hits="3" data-linenumber="125">
888
+ <span class="hits">3</span>
631
889
 
632
- <code class="ruby"> Base64.urlsafe_encode64(encrypt(plaintext, key, cipher_type, iv))</code>
890
+ <code class="ruby"> raise ArgumentError, &#39;key can not be blank&#39; if key.nil? || key.empty?</code>
633
891
  </li>
634
892
 
635
- <li class="never" data-hits="" data-linenumber="83">
636
-
893
+ <li class="covered" data-hits="3" data-linenumber="126">
894
+ <span class="hits">3</span>
637
895
 
638
- <code class="ruby"> end</code>
896
+ <code class="ruby"> body = BB::Crypto.decrypt_urlsafe_base64(token, key, cipher_type)</code>
639
897
  </li>
640
898
 
641
- <li class="never" data-hits="" data-linenumber="84">
642
-
899
+ <li class="covered" data-hits="3" data-linenumber="127">
900
+ <span class="hits">3</span>
643
901
 
644
- <code class="ruby"></code>
902
+ <code class="ruby"> valid_until, op, *args = body.split(&quot;\x00&quot;)</code>
645
903
  </li>
646
904
 
647
- <li class="never" data-hits="" data-linenumber="85">
648
-
905
+ <li class="covered" data-hits="3" data-linenumber="128">
906
+ <span class="hits">3</span>
649
907
 
650
- <code class="ruby"> # Decode and Decrypt an urlsafe Base64-String.</code>
908
+ <code class="ruby"> valid_until = valid_until.unpack(&#39;l&lt;&#39;)[0]</code>
651
909
  </li>
652
910
 
653
- <li class="never" data-hits="" data-linenumber="86">
654
-
911
+ <li class="covered" data-hits="3" data-linenumber="129">
912
+ <span class="hits">3</span>
655
913
 
656
- <code class="ruby"> #</code>
914
+ <code class="ruby"> expired = Time.now.to_i &gt; valid_until</code>
657
915
  </li>
658
916
 
659
- <li class="never" data-hits="" data-linenumber="87">
917
+ <li class="covered" data-hits="3" data-linenumber="130">
918
+ <span class="hits">3</span>
660
919
 
920
+ <code class="ruby"> if expired &amp;&amp; !force</code>
921
+ </li>
922
+
923
+ <li class="covered" data-hits="1" data-linenumber="131">
924
+ <span class="hits">1</span>
661
925
 
662
- <code class="ruby"> # @param [String] ciphertext Input String (urlsafe_base64(ciphertext))</code>
926
+ <code class="ruby"> raise ArgumentError, &quot;Token expired at #{Time.at(valid_until)} (#{ChronicDuration.output(Time.now.to_i - valid_until)} ago)&quot;</code>
663
927
  </li>
664
928
 
665
- <li class="never" data-hits="" data-linenumber="88">
929
+ <li class="never" data-hits="" data-linenumber="132">
666
930
 
667
931
 
668
- <code class="ruby"> # @param [String] key Encryption key</code>
932
+ <code class="ruby"> end</code>
669
933
  </li>
670
934
 
671
- <li class="never" data-hits="" data-linenumber="89">
935
+ <li class="never" data-hits="" data-linenumber="133">
672
936
 
673
937
 
674
- <code class="ruby"> # @param [String] cipher_type OpenSSL cipher</code>
938
+ <code class="ruby"> { valid_until: valid_until,</code>
675
939
  </li>
676
940
 
677
- <li class="never" data-hits="" data-linenumber="90">
941
+ <li class="never" data-hits="" data-linenumber="134">
678
942
 
679
943
 
680
- <code class="ruby"> # @param [String] iv Initialization vector</code>
944
+ <code class="ruby"> op: op,</code>
681
945
  </li>
682
946
 
683
- <li class="never" data-hits="" data-linenumber="91">
947
+ <li class="never" data-hits="" data-linenumber="135">
684
948
 
685
949
 
686
- <code class="ruby"> # @return [String] Plaintext</code>
950
+ <code class="ruby"> args: args,</code>
687
951
  </li>
688
952
 
689
- <li class="covered" data-hits="1" data-linenumber="92">
690
- <span class="hits">1</span>
953
+ <li class="covered" data-hits="2" data-linenumber="136">
954
+ <span class="hits">2</span>
691
955
 
692
- <code class="ruby"> def decrypt_urlsafe_base64(ciphertext, key, cipher_type = &#39;aes-256-cbc&#39;, iv = nil)</code>
956
+ <code class="ruby"> expired: expired }</code>
693
957
  </li>
694
958
 
695
- <li class="covered" data-hits="123" data-linenumber="93">
696
- <span class="hits">123</span>
959
+ <li class="never" data-hits="" data-linenumber="137">
697
960
 
698
- <code class="ruby"> decrypt(Base64.urlsafe_decode64(ciphertext), key, cipher_type, iv)</code>
961
+
962
+ <code class="ruby"> end</code>
699
963
  </li>
700
964
 
701
- <li class="never" data-hits="" data-linenumber="94">
965
+ <li class="never" data-hits="" data-linenumber="138">
702
966
 
703
967
 
704
968
  <code class="ruby"> end</code>
705
969
  </li>
706
970
 
707
- <li class="never" data-hits="" data-linenumber="95">
971
+ <li class="never" data-hits="" data-linenumber="139">
708
972
 
709
973
 
710
- <code class="ruby"> end</code>
974
+ <code class="ruby"> end # /BB::Crypto::Token</code>
711
975
  </li>
712
976
 
713
- <li class="never" data-hits="" data-linenumber="96">
977
+ <li class="never" data-hits="" data-linenumber="140">
714
978
 
715
979
 
716
- <code class="ruby"> end</code>
980
+ <code class="ruby"> end # /BB::Crypto</code>
717
981
  </li>
718
982
 
719
- <li class="never" data-hits="" data-linenumber="97">
983
+ <li class="never" data-hits="" data-linenumber="141">
720
984
 
721
985
 
722
986
  <code class="ruby">end</code>
@@ -729,11 +993,11 @@
729
993
  <div class="source_table" id="192e300fd7769b750c82567439ee016f85516f3d">
730
994
  <div class="header">
731
995
  <h3>lib/blackbox/gem.rb</h3>
732
- <h4><span class="green">100.0 %</span> covered</h4>
996
+ <h4><span class="green">96.97 %</span> covered</h4>
733
997
  <div>
734
998
  <b>33</b> relevant lines.
735
- <span class="green"><b>33</b> lines covered</span> and
736
- <span class="red"><b>0</b> lines missed.</span>
999
+ <span class="green"><b>32</b> lines covered</span> and
1000
+ <span class="red"><b>1</b> lines missed.</span>
737
1001
  </div>
738
1002
  </div>
739
1003
 
@@ -938,8 +1202,8 @@
938
1202
  <code class="ruby"> spec = ::Gem::Specification.find do |s|</code>
939
1203
  </li>
940
1204
 
941
- <li class="covered" data-hits="64" data-linenumber="34">
942
- <span class="hits">64</span>
1205
+ <li class="covered" data-hits="80" data-linenumber="34">
1206
+ <span class="hits">80</span>
943
1207
 
944
1208
  <code class="ruby"> File.fnmatch(File.join(s.full_gem_path, &#39;*&#39;), calling_file)</code>
945
1209
  </li>
@@ -1106,8 +1370,8 @@
1106
1370
  <code class="ruby"> rescue</code>
1107
1371
  </li>
1108
1372
 
1109
- <li class="covered" data-hits="1" data-linenumber="62">
1110
- <span class="hits">1</span>
1373
+ <li class="missed" data-hits="0" data-linenumber="62">
1374
+
1111
1375
 
1112
1376
  <code class="ruby"> last_check_at = Time.at(0)</code>
1113
1377
  </li>
@@ -2087,634 +2351,628 @@
2087
2351
  <li class="never" data-hits="" data-linenumber="77">
2088
2352
 
2089
2353
 
2090
- <code class="ruby"> delimiter: delimiter</code>
2354
+ <code class="ruby"> delimiter: delimiter).sub(/(#{escaped_separator})(\d*[1-9])?0+\z/, &#39;\1\2&#39;).sub(/#{escaped_separator}\z/, &#39;&#39;)</code>
2091
2355
  </li>
2092
2356
 
2093
- <li class="never" data-hits="" data-linenumber="78">
2094
-
2095
-
2096
- <code class="ruby"> ).sub(/(#{escaped_separator})(\d*[1-9])?0+\z/, &#39;\1\2&#39;).sub(/#{escaped_separator}\z/, &#39;&#39;)</code>
2097
- </li>
2098
-
2099
- <li class="covered" data-hits="10" data-linenumber="79">
2357
+ <li class="covered" data-hits="10" data-linenumber="78">
2100
2358
  <span class="hits">10</span>
2101
2359
 
2102
2360
  <code class="ruby"> storage_units_format.gsub(/%n/, formatted_number).gsub(/%u/, unit)</code>
2103
2361
  </li>
2104
2362
 
2105
- <li class="never" data-hits="" data-linenumber="80">
2363
+ <li class="never" data-hits="" data-linenumber="79">
2106
2364
 
2107
2365
 
2108
2366
  <code class="ruby"> end</code>
2109
2367
  </li>
2110
2368
 
2111
- <li class="never" data-hits="" data-linenumber="81">
2369
+ <li class="never" data-hits="" data-linenumber="80">
2112
2370
 
2113
2371
 
2114
2372
  <code class="ruby"> rescue</code>
2115
2373
  </li>
2116
2374
 
2117
- <li class="covered" data-hits="1" data-linenumber="82">
2375
+ <li class="covered" data-hits="1" data-linenumber="81">
2118
2376
  <span class="hits">1</span>
2119
2377
 
2120
2378
  <code class="ruby"> number</code>
2121
2379
  </li>
2122
2380
 
2123
- <li class="never" data-hits="" data-linenumber="83">
2381
+ <li class="never" data-hits="" data-linenumber="82">
2124
2382
 
2125
2383
 
2126
2384
  <code class="ruby"> end</code>
2127
2385
  </li>
2128
2386
 
2129
- <li class="never" data-hits="" data-linenumber="84">
2387
+ <li class="never" data-hits="" data-linenumber="83">
2130
2388
 
2131
2389
 
2132
2390
  <code class="ruby"> end</code>
2133
2391
  </li>
2134
2392
 
2135
- <li class="never" data-hits="" data-linenumber="85">
2393
+ <li class="never" data-hits="" data-linenumber="84">
2136
2394
 
2137
2395
 
2138
2396
  <code class="ruby"></code>
2139
2397
  </li>
2140
2398
 
2141
- <li class="never" data-hits="" data-linenumber="86">
2399
+ <li class="never" data-hits="" data-linenumber="85">
2142
2400
 
2143
2401
 
2144
2402
  <code class="ruby"> ##</code>
2145
2403
  </li>
2146
2404
 
2147
- <li class="never" data-hits="" data-linenumber="87">
2405
+ <li class="never" data-hits="" data-linenumber="86">
2148
2406
 
2149
2407
 
2150
2408
  <code class="ruby"> # Formats a +number+ with the specified level of &lt;tt&gt;:precision&lt;/tt&gt; (e.g., 112.32 has a precision of 2).</code>
2151
2409
  </li>
2152
2410
 
2153
- <li class="never" data-hits="" data-linenumber="88">
2411
+ <li class="never" data-hits="" data-linenumber="87">
2154
2412
 
2155
2413
 
2156
2414
  <code class="ruby"> # This method returns nil if +number+ cannot be converted into a number.</code>
2157
2415
  </li>
2158
2416
 
2159
- <li class="never" data-hits="" data-linenumber="89">
2417
+ <li class="never" data-hits="" data-linenumber="88">
2160
2418
 
2161
2419
 
2162
2420
  <code class="ruby"> # You can customize the format in the +options+ hash.</code>
2163
2421
  </li>
2164
2422
 
2165
- <li class="never" data-hits="" data-linenumber="90">
2423
+ <li class="never" data-hits="" data-linenumber="89">
2166
2424
 
2167
2425
 
2168
2426
  <code class="ruby"> #</code>
2169
2427
  </li>
2170
2428
 
2171
- <li class="never" data-hits="" data-linenumber="91">
2429
+ <li class="never" data-hits="" data-linenumber="90">
2172
2430
 
2173
2431
 
2174
2432
  <code class="ruby"> # @overload with_precision(number, options={})</code>
2175
2433
  </li>
2176
2434
 
2177
- <li class="never" data-hits="" data-linenumber="92">
2435
+ <li class="never" data-hits="" data-linenumber="91">
2178
2436
 
2179
2437
 
2180
2438
  <code class="ruby"> # @param [Fixnum, Float] number</code>
2181
2439
  </li>
2182
2440
 
2183
- <li class="never" data-hits="" data-linenumber="93">
2441
+ <li class="never" data-hits="" data-linenumber="92">
2184
2442
 
2185
2443
 
2186
2444
  <code class="ruby"> # Number value to format.</code>
2187
2445
  </li>
2188
2446
 
2189
- <li class="never" data-hits="" data-linenumber="94">
2447
+ <li class="never" data-hits="" data-linenumber="93">
2190
2448
 
2191
2449
 
2192
2450
  <code class="ruby"> # @param [Hash] options</code>
2193
2451
  </li>
2194
2452
 
2195
- <li class="never" data-hits="" data-linenumber="95">
2453
+ <li class="never" data-hits="" data-linenumber="94">
2196
2454
 
2197
2455
 
2198
2456
  <code class="ruby"> # Options for formatter.</code>
2199
2457
  </li>
2200
2458
 
2201
- <li class="never" data-hits="" data-linenumber="96">
2459
+ <li class="never" data-hits="" data-linenumber="95">
2202
2460
 
2203
2461
 
2204
2462
  <code class="ruby"> # @option options [Fixnum] :precision (3)</code>
2205
2463
  </li>
2206
2464
 
2207
- <li class="never" data-hits="" data-linenumber="97">
2465
+ <li class="never" data-hits="" data-linenumber="96">
2208
2466
 
2209
2467
 
2210
2468
  <code class="ruby"> # Sets the level of precision.</code>
2211
2469
  </li>
2212
2470
 
2213
- <li class="never" data-hits="" data-linenumber="98">
2471
+ <li class="never" data-hits="" data-linenumber="97">
2214
2472
 
2215
2473
 
2216
2474
  <code class="ruby"> # @option options [String] :separator (&quot;.&quot;)</code>
2217
2475
  </li>
2218
2476
 
2219
- <li class="never" data-hits="" data-linenumber="99">
2477
+ <li class="never" data-hits="" data-linenumber="98">
2220
2478
 
2221
2479
 
2222
2480
  <code class="ruby"> # Sets the separator between the units.</code>
2223
2481
  </li>
2224
2482
 
2225
- <li class="never" data-hits="" data-linenumber="100">
2483
+ <li class="never" data-hits="" data-linenumber="99">
2226
2484
 
2227
2485
 
2228
2486
  <code class="ruby"> # @option options [String] :delimiter (&quot;&quot;)</code>
2229
2487
  </li>
2230
2488
 
2231
- <li class="never" data-hits="" data-linenumber="101">
2489
+ <li class="never" data-hits="" data-linenumber="100">
2232
2490
 
2233
2491
 
2234
2492
  <code class="ruby"> # Sets the thousands delimiter.</code>
2235
2493
  </li>
2236
2494
 
2237
- <li class="never" data-hits="" data-linenumber="102">
2495
+ <li class="never" data-hits="" data-linenumber="101">
2238
2496
 
2239
2497
 
2240
2498
  <code class="ruby"> #</code>
2241
2499
  </li>
2242
2500
 
2243
- <li class="never" data-hits="" data-linenumber="103">
2501
+ <li class="never" data-hits="" data-linenumber="102">
2244
2502
 
2245
2503
 
2246
2504
  <code class="ruby"> # @return [String] The formatted representation of the number.</code>
2247
2505
  </li>
2248
2506
 
2249
- <li class="never" data-hits="" data-linenumber="104">
2507
+ <li class="never" data-hits="" data-linenumber="103">
2250
2508
 
2251
2509
 
2252
2510
  <code class="ruby"> #</code>
2253
2511
  </li>
2254
2512
 
2255
- <li class="never" data-hits="" data-linenumber="105">
2513
+ <li class="never" data-hits="" data-linenumber="104">
2256
2514
 
2257
2515
 
2258
2516
  <code class="ruby"> # @example</code>
2259
2517
  </li>
2260
2518
 
2261
- <li class="never" data-hits="" data-linenumber="106">
2519
+ <li class="never" data-hits="" data-linenumber="105">
2262
2520
 
2263
2521
 
2264
2522
  <code class="ruby"> # with_precision(111.2345) # =&gt; 111.235</code>
2265
2523
  </li>
2266
2524
 
2267
- <li class="never" data-hits="" data-linenumber="107">
2525
+ <li class="never" data-hits="" data-linenumber="106">
2268
2526
 
2269
2527
 
2270
2528
  <code class="ruby"> # with_precision(111.2345, :precision =&gt; 2) # =&gt; 111.23</code>
2271
2529
  </li>
2272
2530
 
2273
- <li class="never" data-hits="" data-linenumber="108">
2531
+ <li class="never" data-hits="" data-linenumber="107">
2274
2532
 
2275
2533
 
2276
2534
  <code class="ruby"> # with_precision(13, :precision =&gt; 5) # =&gt; 13.00000</code>
2277
2535
  </li>
2278
2536
 
2279
- <li class="never" data-hits="" data-linenumber="109">
2537
+ <li class="never" data-hits="" data-linenumber="108">
2280
2538
 
2281
2539
 
2282
2540
  <code class="ruby"> # with_precision(389.32314, :precision =&gt; 0) # =&gt; 389</code>
2283
2541
  </li>
2284
2542
 
2285
- <li class="never" data-hits="" data-linenumber="110">
2543
+ <li class="never" data-hits="" data-linenumber="109">
2286
2544
 
2287
2545
 
2288
2546
  <code class="ruby"> # with_precision(1111.2345, :precision =&gt; 2, :separator =&gt; &#39;,&#39;, :delimiter =&gt; &#39;.&#39;)</code>
2289
2547
  </li>
2290
2548
 
2291
- <li class="never" data-hits="" data-linenumber="111">
2549
+ <li class="never" data-hits="" data-linenumber="110">
2292
2550
 
2293
2551
 
2294
2552
  <code class="ruby"> # # =&gt; 1.111,23</code>
2295
2553
  </li>
2296
2554
 
2297
- <li class="never" data-hits="" data-linenumber="112">
2555
+ <li class="never" data-hits="" data-linenumber="111">
2298
2556
 
2299
2557
 
2300
2558
  <code class="ruby"> #</code>
2301
2559
  </li>
2302
2560
 
2303
- <li class="covered" data-hits="1" data-linenumber="113">
2561
+ <li class="covered" data-hits="1" data-linenumber="112">
2304
2562
  <span class="hits">1</span>
2305
2563
 
2306
2564
  <code class="ruby"> def with_precision(number, args)</code>
2307
2565
  </li>
2308
2566
 
2309
- <li class="covered" data-hits="14" data-linenumber="114">
2567
+ <li class="covered" data-hits="14" data-linenumber="113">
2310
2568
  <span class="hits">14</span>
2311
2569
 
2312
2570
  <code class="ruby"> begin</code>
2313
2571
  </li>
2314
2572
 
2315
- <li class="covered" data-hits="14" data-linenumber="115">
2573
+ <li class="covered" data-hits="14" data-linenumber="114">
2316
2574
  <span class="hits">14</span>
2317
2575
 
2318
2576
  <code class="ruby"> Float(number)</code>
2319
2577
  </li>
2320
2578
 
2321
- <li class="never" data-hits="" data-linenumber="116">
2579
+ <li class="never" data-hits="" data-linenumber="115">
2322
2580
 
2323
2581
 
2324
2582
  <code class="ruby"> rescue</code>
2325
2583
  </li>
2326
2584
 
2327
- <li class="covered" data-hits="1" data-linenumber="117">
2585
+ <li class="covered" data-hits="1" data-linenumber="116">
2328
2586
  <span class="hits">1</span>
2329
2587
 
2330
2588
  <code class="ruby"> return nil</code>
2331
2589
  </li>
2332
2590
 
2333
- <li class="never" data-hits="" data-linenumber="118">
2591
+ <li class="never" data-hits="" data-linenumber="117">
2334
2592
 
2335
2593
 
2336
2594
  <code class="ruby"> end</code>
2337
2595
  </li>
2338
2596
 
2339
- <li class="never" data-hits="" data-linenumber="119">
2597
+ <li class="never" data-hits="" data-linenumber="118">
2340
2598
 
2341
2599
 
2342
2600
  <code class="ruby"></code>
2343
2601
  </li>
2344
2602
 
2345
- <li class="covered" data-hits="13" data-linenumber="120">
2603
+ <li class="covered" data-hits="13" data-linenumber="119">
2346
2604
  <span class="hits">13</span>
2347
2605
 
2348
2606
  <code class="ruby"> options = BB::Hash.symbolize_keys(args)</code>
2349
2607
  </li>
2350
2608
 
2351
- <li class="never" data-hits="" data-linenumber="121">
2609
+ <li class="never" data-hits="" data-linenumber="120">
2352
2610
 
2353
2611
 
2354
2612
  <code class="ruby"></code>
2355
2613
  </li>
2356
2614
 
2357
- <li class="covered" data-hits="13" data-linenumber="122">
2615
+ <li class="covered" data-hits="13" data-linenumber="121">
2358
2616
  <span class="hits">13</span>
2359
2617
 
2360
2618
  <code class="ruby"> precision ||= (options[:precision] || 3)</code>
2361
2619
  </li>
2362
2620
 
2363
- <li class="covered" data-hits="13" data-linenumber="123">
2621
+ <li class="covered" data-hits="13" data-linenumber="122">
2364
2622
  <span class="hits">13</span>
2365
2623
 
2366
2624
  <code class="ruby"> separator ||= (options[:separator] || &#39;.&#39;)</code>
2367
2625
  </li>
2368
2626
 
2369
- <li class="covered" data-hits="13" data-linenumber="124">
2627
+ <li class="covered" data-hits="13" data-linenumber="123">
2370
2628
  <span class="hits">13</span>
2371
2629
 
2372
2630
  <code class="ruby"> delimiter ||= (options[:delimiter] || &#39;&#39;)</code>
2373
2631
  </li>
2374
2632
 
2375
- <li class="never" data-hits="" data-linenumber="125">
2633
+ <li class="never" data-hits="" data-linenumber="124">
2376
2634
 
2377
2635
 
2378
2636
  <code class="ruby"></code>
2379
2637
  </li>
2380
2638
 
2381
- <li class="covered" data-hits="13" data-linenumber="126">
2639
+ <li class="covered" data-hits="13" data-linenumber="125">
2382
2640
  <span class="hits">13</span>
2383
2641
 
2384
2642
  <code class="ruby"> begin</code>
2385
2643
  </li>
2386
2644
 
2387
- <li class="covered" data-hits="13" data-linenumber="127">
2645
+ <li class="covered" data-hits="13" data-linenumber="126">
2388
2646
  <span class="hits">13</span>
2389
2647
 
2390
2648
  <code class="ruby"> rounded_number = (Float(number) * (10**precision)).round.to_f / 10**precision</code>
2391
2649
  </li>
2392
2650
 
2393
- <li class="covered" data-hits="12" data-linenumber="128">
2651
+ <li class="covered" data-hits="12" data-linenumber="127">
2394
2652
  <span class="hits">12</span>
2395
2653
 
2396
2654
  <code class="ruby"> with_delimiter(&quot;%01.#{precision}f&quot; % rounded_number,</code>
2397
2655
  </li>
2398
2656
 
2399
- <li class="never" data-hits="" data-linenumber="129">
2657
+ <li class="never" data-hits="" data-linenumber="128">
2400
2658
 
2401
2659
 
2402
2660
  <code class="ruby"> separator: separator,</code>
2403
2661
  </li>
2404
2662
 
2405
- <li class="never" data-hits="" data-linenumber="130">
2663
+ <li class="never" data-hits="" data-linenumber="129">
2406
2664
 
2407
2665
 
2408
2666
  <code class="ruby"> delimiter: delimiter)</code>
2409
2667
  </li>
2410
2668
 
2411
- <li class="never" data-hits="" data-linenumber="131">
2669
+ <li class="never" data-hits="" data-linenumber="130">
2412
2670
 
2413
2671
 
2414
2672
  <code class="ruby"> rescue</code>
2415
2673
  </li>
2416
2674
 
2417
- <li class="covered" data-hits="1" data-linenumber="132">
2675
+ <li class="covered" data-hits="1" data-linenumber="131">
2418
2676
  <span class="hits">1</span>
2419
2677
 
2420
2678
  <code class="ruby"> number</code>
2421
2679
  </li>
2422
2680
 
2423
- <li class="never" data-hits="" data-linenumber="133">
2681
+ <li class="never" data-hits="" data-linenumber="132">
2424
2682
 
2425
2683
 
2426
2684
  <code class="ruby"> end</code>
2427
2685
  </li>
2428
2686
 
2429
- <li class="never" data-hits="" data-linenumber="134">
2687
+ <li class="never" data-hits="" data-linenumber="133">
2430
2688
 
2431
2689
 
2432
2690
  <code class="ruby"> end</code>
2433
2691
  </li>
2434
2692
 
2435
- <li class="never" data-hits="" data-linenumber="135">
2693
+ <li class="never" data-hits="" data-linenumber="134">
2436
2694
 
2437
2695
 
2438
2696
  <code class="ruby"></code>
2439
2697
  </li>
2440
2698
 
2441
- <li class="never" data-hits="" data-linenumber="136">
2699
+ <li class="never" data-hits="" data-linenumber="135">
2442
2700
 
2443
2701
 
2444
2702
  <code class="ruby"> ##</code>
2445
2703
  </li>
2446
2704
 
2447
- <li class="never" data-hits="" data-linenumber="137">
2705
+ <li class="never" data-hits="" data-linenumber="136">
2448
2706
 
2449
2707
 
2450
2708
  <code class="ruby"> # Formats a +number+ with grouped thousands using +delimiter+ (e.g., 12,324).</code>
2451
2709
  </li>
2452
2710
 
2453
- <li class="never" data-hits="" data-linenumber="138">
2711
+ <li class="never" data-hits="" data-linenumber="137">
2454
2712
 
2455
2713
 
2456
2714
  <code class="ruby"> # This method returns nil if +number+ cannot be converted into a number.</code>
2457
2715
  </li>
2458
2716
 
2459
- <li class="never" data-hits="" data-linenumber="139">
2717
+ <li class="never" data-hits="" data-linenumber="138">
2460
2718
 
2461
2719
 
2462
2720
  <code class="ruby"> # You can customize the format in the +options+ hash.</code>
2463
2721
  </li>
2464
2722
 
2465
- <li class="never" data-hits="" data-linenumber="140">
2723
+ <li class="never" data-hits="" data-linenumber="139">
2466
2724
 
2467
2725
 
2468
2726
  <code class="ruby"> #</code>
2469
2727
  </li>
2470
2728
 
2471
- <li class="never" data-hits="" data-linenumber="141">
2729
+ <li class="never" data-hits="" data-linenumber="140">
2472
2730
 
2473
2731
 
2474
2732
  <code class="ruby"> # @overload with_delimiter(number, options={})</code>
2475
2733
  </li>
2476
2734
 
2477
- <li class="never" data-hits="" data-linenumber="142">
2735
+ <li class="never" data-hits="" data-linenumber="141">
2478
2736
 
2479
2737
 
2480
2738
  <code class="ruby"> # @param [Fixnum, Float] number</code>
2481
2739
  </li>
2482
2740
 
2483
- <li class="never" data-hits="" data-linenumber="143">
2741
+ <li class="never" data-hits="" data-linenumber="142">
2484
2742
 
2485
2743
 
2486
2744
  <code class="ruby"> # Number value to format.</code>
2487
2745
  </li>
2488
2746
 
2489
- <li class="never" data-hits="" data-linenumber="144">
2747
+ <li class="never" data-hits="" data-linenumber="143">
2490
2748
 
2491
2749
 
2492
2750
  <code class="ruby"> # @param [Hash] options</code>
2493
2751
  </li>
2494
2752
 
2495
- <li class="never" data-hits="" data-linenumber="145">
2753
+ <li class="never" data-hits="" data-linenumber="144">
2496
2754
 
2497
2755
 
2498
2756
  <code class="ruby"> # Options for formatter.</code>
2499
2757
  </li>
2500
2758
 
2501
- <li class="never" data-hits="" data-linenumber="146">
2759
+ <li class="never" data-hits="" data-linenumber="145">
2502
2760
 
2503
2761
 
2504
2762
  <code class="ruby"> # @option options [String] :delimiter (&quot;, &quot;)</code>
2505
2763
  </li>
2506
2764
 
2507
- <li class="never" data-hits="" data-linenumber="147">
2765
+ <li class="never" data-hits="" data-linenumber="146">
2508
2766
 
2509
2767
 
2510
2768
  <code class="ruby"> # Sets the thousands delimiter.</code>
2511
2769
  </li>
2512
2770
 
2513
- <li class="never" data-hits="" data-linenumber="148">
2771
+ <li class="never" data-hits="" data-linenumber="147">
2514
2772
 
2515
2773
 
2516
2774
  <code class="ruby"> # @option options [String] :separator (&quot;.&quot;)</code>
2517
2775
  </li>
2518
2776
 
2519
- <li class="never" data-hits="" data-linenumber="149">
2777
+ <li class="never" data-hits="" data-linenumber="148">
2520
2778
 
2521
2779
 
2522
2780
  <code class="ruby"> # Sets the separator between the units.</code>
2523
2781
  </li>
2524
2782
 
2525
- <li class="never" data-hits="" data-linenumber="150">
2783
+ <li class="never" data-hits="" data-linenumber="149">
2526
2784
 
2527
2785
 
2528
2786
  <code class="ruby"> #</code>
2529
2787
  </li>
2530
2788
 
2531
- <li class="never" data-hits="" data-linenumber="151">
2789
+ <li class="never" data-hits="" data-linenumber="150">
2532
2790
 
2533
2791
 
2534
2792
  <code class="ruby"> # @return [String] The formatted representation of the number.</code>
2535
2793
  </li>
2536
2794
 
2537
- <li class="never" data-hits="" data-linenumber="152">
2795
+ <li class="never" data-hits="" data-linenumber="151">
2538
2796
 
2539
2797
 
2540
2798
  <code class="ruby"> #</code>
2541
2799
  </li>
2542
2800
 
2543
- <li class="never" data-hits="" data-linenumber="153">
2801
+ <li class="never" data-hits="" data-linenumber="152">
2544
2802
 
2545
2803
 
2546
2804
  <code class="ruby"> # @example</code>
2547
2805
  </li>
2548
2806
 
2549
- <li class="never" data-hits="" data-linenumber="154">
2807
+ <li class="never" data-hits="" data-linenumber="153">
2550
2808
 
2551
2809
 
2552
2810
  <code class="ruby"> # with_delimiter(12345678) # =&gt; 12,345,678</code>
2553
2811
  </li>
2554
2812
 
2555
- <li class="never" data-hits="" data-linenumber="155">
2813
+ <li class="never" data-hits="" data-linenumber="154">
2556
2814
 
2557
2815
 
2558
2816
  <code class="ruby"> # with_delimiter(12345678.05) # =&gt; 12,345,678.05</code>
2559
2817
  </li>
2560
2818
 
2561
- <li class="never" data-hits="" data-linenumber="156">
2819
+ <li class="never" data-hits="" data-linenumber="155">
2562
2820
 
2563
2821
 
2564
2822
  <code class="ruby"> # with_delimiter(12345678, :delimiter =&gt; &quot;.&quot;) # =&gt; 12.345.678</code>
2565
2823
  </li>
2566
2824
 
2567
- <li class="never" data-hits="" data-linenumber="157">
2825
+ <li class="never" data-hits="" data-linenumber="156">
2568
2826
 
2569
2827
 
2570
2828
  <code class="ruby"> # with_delimiter(12345678, :separator =&gt; &quot;,&quot;) # =&gt; 12,345,678</code>
2571
2829
  </li>
2572
2830
 
2573
- <li class="never" data-hits="" data-linenumber="158">
2831
+ <li class="never" data-hits="" data-linenumber="157">
2574
2832
 
2575
2833
 
2576
2834
  <code class="ruby"> # with_delimiter(98765432.98, :delimiter =&gt; &quot; &quot;, :separator =&gt; &quot;,&quot;)</code>
2577
2835
  </li>
2578
2836
 
2579
- <li class="never" data-hits="" data-linenumber="159">
2837
+ <li class="never" data-hits="" data-linenumber="158">
2580
2838
 
2581
2839
 
2582
2840
  <code class="ruby"> # # =&gt; 98 765 432,98</code>
2583
2841
  </li>
2584
2842
 
2585
- <li class="never" data-hits="" data-linenumber="160">
2843
+ <li class="never" data-hits="" data-linenumber="159">
2586
2844
 
2587
2845
 
2588
2846
  <code class="ruby"> #</code>
2589
2847
  </li>
2590
2848
 
2591
- <li class="covered" data-hits="1" data-linenumber="161">
2849
+ <li class="covered" data-hits="1" data-linenumber="160">
2592
2850
  <span class="hits">1</span>
2593
2851
 
2594
2852
  <code class="ruby"> def with_delimiter(number, args = {})</code>
2595
2853
  </li>
2596
2854
 
2597
- <li class="covered" data-hits="17" data-linenumber="162">
2855
+ <li class="covered" data-hits="17" data-linenumber="161">
2598
2856
  <span class="hits">17</span>
2599
2857
 
2600
2858
  <code class="ruby"> begin</code>
2601
2859
  </li>
2602
2860
 
2603
- <li class="covered" data-hits="17" data-linenumber="163">
2861
+ <li class="covered" data-hits="17" data-linenumber="162">
2604
2862
  <span class="hits">17</span>
2605
2863
 
2606
2864
  <code class="ruby"> Float(number)</code>
2607
2865
  </li>
2608
2866
 
2609
- <li class="never" data-hits="" data-linenumber="164">
2867
+ <li class="never" data-hits="" data-linenumber="163">
2610
2868
 
2611
2869
 
2612
2870
  <code class="ruby"> rescue</code>
2613
2871
  </li>
2614
2872
 
2615
- <li class="covered" data-hits="1" data-linenumber="165">
2873
+ <li class="covered" data-hits="1" data-linenumber="164">
2616
2874
  <span class="hits">1</span>
2617
2875
 
2618
2876
  <code class="ruby"> return nil</code>
2619
2877
  </li>
2620
2878
 
2621
- <li class="never" data-hits="" data-linenumber="166">
2879
+ <li class="never" data-hits="" data-linenumber="165">
2622
2880
 
2623
2881
 
2624
2882
  <code class="ruby"> end</code>
2625
2883
  </li>
2626
2884
 
2627
- <li class="covered" data-hits="16" data-linenumber="167">
2885
+ <li class="covered" data-hits="16" data-linenumber="166">
2628
2886
  <span class="hits">16</span>
2629
2887
 
2630
2888
  <code class="ruby"> options = BB::Hash.symbolize_keys(args)</code>
2631
2889
  </li>
2632
2890
 
2633
- <li class="never" data-hits="" data-linenumber="168">
2891
+ <li class="never" data-hits="" data-linenumber="167">
2634
2892
 
2635
2893
 
2636
2894
  <code class="ruby"></code>
2637
2895
  </li>
2638
2896
 
2639
- <li class="covered" data-hits="16" data-linenumber="169">
2897
+ <li class="covered" data-hits="16" data-linenumber="168">
2640
2898
  <span class="hits">16</span>
2641
2899
 
2642
2900
  <code class="ruby"> delimiter ||= (options[:delimiter] || &#39;,&#39;)</code>
2643
2901
  </li>
2644
2902
 
2645
- <li class="covered" data-hits="16" data-linenumber="170">
2903
+ <li class="covered" data-hits="16" data-linenumber="169">
2646
2904
  <span class="hits">16</span>
2647
2905
 
2648
2906
  <code class="ruby"> separator ||= (options[:separator] || &#39;.&#39;)</code>
2649
2907
  </li>
2650
2908
 
2651
- <li class="never" data-hits="" data-linenumber="171">
2909
+ <li class="never" data-hits="" data-linenumber="170">
2652
2910
 
2653
2911
 
2654
2912
  <code class="ruby"></code>
2655
2913
  </li>
2656
2914
 
2657
- <li class="covered" data-hits="16" data-linenumber="172">
2915
+ <li class="covered" data-hits="16" data-linenumber="171">
2658
2916
  <span class="hits">16</span>
2659
2917
 
2660
2918
  <code class="ruby"> begin</code>
2661
2919
  </li>
2662
2920
 
2663
- <li class="covered" data-hits="16" data-linenumber="173">
2921
+ <li class="covered" data-hits="16" data-linenumber="172">
2664
2922
  <span class="hits">16</span>
2665
2923
 
2666
2924
  <code class="ruby"> parts = number.to_s.split(&#39;.&#39;)</code>
2667
2925
  </li>
2668
2926
 
2669
- <li class="covered" data-hits="16" data-linenumber="174">
2927
+ <li class="covered" data-hits="16" data-linenumber="173">
2670
2928
  <span class="hits">16</span>
2671
2929
 
2672
2930
  <code class="ruby"> parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, &quot;\\1#{delimiter}&quot;)</code>
2673
2931
  </li>
2674
2932
 
2675
- <li class="covered" data-hits="16" data-linenumber="175">
2933
+ <li class="covered" data-hits="16" data-linenumber="174">
2676
2934
  <span class="hits">16</span>
2677
2935
 
2678
2936
  <code class="ruby"> parts.join(separator)</code>
2679
2937
  </li>
2680
2938
 
2681
- <li class="never" data-hits="" data-linenumber="176">
2939
+ <li class="never" data-hits="" data-linenumber="175">
2682
2940
 
2683
2941
 
2684
2942
  <code class="ruby"> rescue</code>
2685
2943
  </li>
2686
2944
 
2687
- <li class="covered" data-hits="1" data-linenumber="177">
2945
+ <li class="covered" data-hits="1" data-linenumber="176">
2688
2946
  <span class="hits">1</span>
2689
2947
 
2690
2948
  <code class="ruby"> number</code>
2691
2949
  </li>
2692
2950
 
2693
- <li class="never" data-hits="" data-linenumber="178">
2951
+ <li class="never" data-hits="" data-linenumber="177">
2694
2952
 
2695
2953
 
2696
2954
  <code class="ruby"> end</code>
2697
2955
  </li>
2698
2956
 
2699
- <li class="never" data-hits="" data-linenumber="179">
2957
+ <li class="never" data-hits="" data-linenumber="178">
2700
2958
 
2701
2959
 
2702
2960
  <code class="ruby"> end</code>
2703
2961
  </li>
2704
2962
 
2705
- <li class="never" data-hits="" data-linenumber="180">
2963
+ <li class="never" data-hits="" data-linenumber="179">
2706
2964
 
2707
2965
 
2708
2966
  <code class="ruby"> end</code>
2709
2967
  </li>
2710
2968
 
2711
- <li class="never" data-hits="" data-linenumber="181">
2969
+ <li class="never" data-hits="" data-linenumber="180">
2712
2970
 
2713
2971
 
2714
2972
  <code class="ruby"> end</code>
2715
2973
  </li>
2716
2974
 
2717
- <li class="never" data-hits="" data-linenumber="182">
2975
+ <li class="never" data-hits="" data-linenumber="181">
2718
2976
 
2719
2977
 
2720
2978
  <code class="ruby">end</code>