sinatra-param 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/Gemfile +9 -1
  2. data/Gemfile.lock +7 -1
  3. data/README.md +4 -9
  4. data/Rakefile +0 -1
  5. data/coverage/assets/0.7.1/application.css +1110 -0
  6. data/coverage/assets/0.7.1/application.js +626 -0
  7. data/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
  8. data/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
  9. data/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
  10. data/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
  11. data/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
  12. data/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
  13. data/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
  14. data/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
  15. data/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
  16. data/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
  17. data/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
  18. data/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
  19. data/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
  20. data/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
  21. data/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
  22. data/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
  23. data/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
  24. data/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
  25. data/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
  26. data/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
  27. data/coverage/assets/0.7.1/favicon_green.png +0 -0
  28. data/coverage/assets/0.7.1/favicon_red.png +0 -0
  29. data/coverage/assets/0.7.1/favicon_yellow.png +0 -0
  30. data/coverage/assets/0.7.1/loading.gif +0 -0
  31. data/coverage/assets/0.7.1/magnify.png +0 -0
  32. data/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  33. data/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  34. data/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  35. data/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  36. data/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  37. data/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  38. data/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  39. data/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  40. data/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
  41. data/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  42. data/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
  43. data/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
  44. data/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  45. data/coverage/index.html +788 -0
  46. data/{lib/example → example}/Gemfile +0 -0
  47. data/{lib/example → example}/Gemfile.lock +0 -0
  48. data/{lib/example → example}/Procfile +0 -0
  49. data/{lib/example → example}/app.rb +7 -7
  50. data/{lib/example → example}/config.ru +0 -0
  51. data/lib/sinatra/param.rb +36 -32
  52. data/lib/sinatra/param/version.rb +1 -1
  53. data/sinatra-param.gemspec +3 -6
  54. data/spec/dummy/app.rb +146 -0
  55. data/spec/parameter_sets_spec.rb +33 -0
  56. data/spec/parameter_transformations_spec.rb +21 -0
  57. data/spec/parameter_type_coercion_spec.rb +90 -0
  58. data/spec/parameter_validations_spec.rb +174 -0
  59. data/spec/spec_helper.rb +19 -2
  60. metadata +65 -39
  61. data/sinatra-param-0.1.0.gem +0 -0
  62. data/spec/exclude_spec.rb +0 -36
Binary file
Binary file
@@ -0,0 +1,788 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>Code coverage for Sinatra-param</title>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <script src='./assets/0.7.1/application.js' type='text/javascript'></script>
7
+ <link href='./assets/0.7.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
8
+ <link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_red.png" />
9
+ <link rel="icon" type="image/png" href="./assets/0.7.1/favicon.png" />
10
+ </head>
11
+
12
+ <body>
13
+ <div id="loading">
14
+ <img src="./assets/0.7.1/loading.gif" alt="loading"/>
15
+ </div>
16
+ <div id="wrapper" style="display:none;">
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2013-01-20T22:57:14-08:00">2013-01-20T22:57:14-08:00</abbr></div>
18
+ <ul class="group_tabs"></ul>
19
+
20
+ <div id="content">
21
+ <div class="file_list_container" id="AllFiles">
22
+ <h2>
23
+ <span class="group_name">All Files</span>
24
+ (<span class="covered_percent"><span class="red">28.57%</span></span>
25
+ covered at
26
+ <span class="covered_strength">
27
+ <span class="red">
28
+ 0.65
29
+ </span>
30
+ </span> hits/line)
31
+ </h2>
32
+ <a name="AllFiles"></a>
33
+ <div>
34
+ <b>2</b> files in total.
35
+ <b>63</b> relevant lines.
36
+ <span class="green"><b>18</b> lines covered</span> and
37
+ <span class="red"><b>45</b> lines missed </span>
38
+ </div>
39
+ <table class="file_list">
40
+ <thead>
41
+ <tr>
42
+ <th>File</th>
43
+ <th>% covered</th>
44
+ <th>Lines</th>
45
+ <th>Relevant Lines</th>
46
+ <th>Lines covered</th>
47
+ <th>Lines missed</th>
48
+ <th>Avg. Hits / Line</th>
49
+ </tr>
50
+ </thead>
51
+ <tbody>
52
+
53
+ <tr>
54
+ <td class="strong"><a href="#0f7926ededdfd8418773c107837b6dc4182659b8" class="src_link" title="lib/sinatra/param.rb">lib/sinatra/param.rb</a></td>
55
+ <td class="red strong">25.0 %</td>
56
+ <td>105</td>
57
+ <td>60</td>
58
+ <td>15</td>
59
+ <td>45</td>
60
+ <td>0.3</td>
61
+ </tr>
62
+
63
+ <tr>
64
+ <td class="strong"><a href="#95bc1568394aeedcc2389ae1301b3fd7e08bf109" class="src_link" title="lib/sinatra/param/version.rb">lib/sinatra/param/version.rb</a></td>
65
+ <td class="green strong">100.0 %</td>
66
+ <td>5</td>
67
+ <td>3</td>
68
+ <td>3</td>
69
+ <td>0</td>
70
+ <td>1.0</td>
71
+ </tr>
72
+
73
+ </tbody>
74
+ </table>
75
+ </div>
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <div id="footer">
82
+ Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
83
+ and simplecov-html v0.7.1<br/>
84
+ using RSpec
85
+ </div>
86
+
87
+ <div class="source_files">
88
+
89
+ <div class="source_table" id="0f7926ededdfd8418773c107837b6dc4182659b8">
90
+ <div class="header">
91
+ <h3>lib/sinatra/param.rb</h3>
92
+ <h4><span class="red">25.0 %</span> covered</h4>
93
+ <div>
94
+ <b>60</b> relevant lines.
95
+ <span class="green"><b>15</b> lines covered</span> and
96
+ <span class="red"><b>45</b> lines missed.</span>
97
+ </div>
98
+ </div>
99
+
100
+ <pre>
101
+ <ol>
102
+
103
+ <li class="covered" data-hits="1" data-linenumber="1">
104
+ <span class="hits">1</span>
105
+
106
+ <code class="ruby">require 'sinatra/base'</code>
107
+ </li>
108
+
109
+ <li class="covered" data-hits="1" data-linenumber="2">
110
+ <span class="hits">1</span>
111
+
112
+ <code class="ruby">require 'sinatra/param/version'</code>
113
+ </li>
114
+
115
+ <li class="covered" data-hits="1" data-linenumber="3">
116
+ <span class="hits">1</span>
117
+
118
+ <code class="ruby">require 'time'</code>
119
+ </li>
120
+
121
+ <li class="covered" data-hits="1" data-linenumber="4">
122
+ <span class="hits">1</span>
123
+
124
+ <code class="ruby">require 'date'</code>
125
+ </li>
126
+
127
+ <li class="never" data-hits="" data-linenumber="5">
128
+
129
+
130
+ <code class="ruby"></code>
131
+ </li>
132
+
133
+ <li class="covered" data-hits="1" data-linenumber="6">
134
+ <span class="hits">1</span>
135
+
136
+ <code class="ruby">module Sinatra</code>
137
+ </li>
138
+
139
+ <li class="covered" data-hits="1" data-linenumber="7">
140
+ <span class="hits">1</span>
141
+
142
+ <code class="ruby"> module Param</code>
143
+ </li>
144
+
145
+ <li class="covered" data-hits="1" data-linenumber="8">
146
+ <span class="hits">1</span>
147
+
148
+ <code class="ruby"> class InvalidParameterError &lt; StandardError; end</code>
149
+ </li>
150
+
151
+ <li class="never" data-hits="" data-linenumber="9">
152
+
153
+
154
+ <code class="ruby"></code>
155
+ </li>
156
+
157
+ <li class="covered" data-hits="1" data-linenumber="10">
158
+ <span class="hits">1</span>
159
+
160
+ <code class="ruby"> def param(name, type, options = {})</code>
161
+ </li>
162
+
163
+ <li class="missed" data-hits="0" data-linenumber="11">
164
+
165
+
166
+ <code class="ruby"> begin</code>
167
+ </li>
168
+
169
+ <li class="missed" data-hits="0" data-linenumber="12">
170
+
171
+
172
+ <code class="ruby"> params[name] = coerce(params[name], type, options) || options[:default]</code>
173
+ </li>
174
+
175
+ <li class="missed" data-hits="0" data-linenumber="13">
176
+
177
+
178
+ <code class="ruby"> params[name] = options[:transform].to_proc.call(params[name]) if options[:transform]</code>
179
+ </li>
180
+
181
+ <li class="missed" data-hits="0" data-linenumber="14">
182
+
183
+
184
+ <code class="ruby"> validate!(params[name], options)</code>
185
+ </li>
186
+
187
+ <li class="never" data-hits="" data-linenumber="15">
188
+
189
+
190
+ <code class="ruby"> rescue</code>
191
+ </li>
192
+
193
+ <li class="missed" data-hits="0" data-linenumber="16">
194
+
195
+
196
+ <code class="ruby"> error = &quot;Invalid parameter, #{name}&quot;</code>
197
+ </li>
198
+
199
+ <li class="missed" data-hits="0" data-linenumber="17">
200
+
201
+
202
+ <code class="ruby"> if content_type and content_type.match(mime_type(:json))</code>
203
+ </li>
204
+
205
+ <li class="missed" data-hits="0" data-linenumber="18">
206
+
207
+
208
+ <code class="ruby"> error = {message: error}.to_json</code>
209
+ </li>
210
+
211
+ <li class="never" data-hits="" data-linenumber="19">
212
+
213
+
214
+ <code class="ruby"> end</code>
215
+ </li>
216
+
217
+ <li class="never" data-hits="" data-linenumber="20">
218
+
219
+
220
+ <code class="ruby"></code>
221
+ </li>
222
+
223
+ <li class="missed" data-hits="0" data-linenumber="21">
224
+
225
+
226
+ <code class="ruby"> halt 406, error</code>
227
+ </li>
228
+
229
+ <li class="never" data-hits="" data-linenumber="22">
230
+
231
+
232
+ <code class="ruby"> end</code>
233
+ </li>
234
+
235
+ <li class="never" data-hits="" data-linenumber="23">
236
+
237
+
238
+ <code class="ruby"> end</code>
239
+ </li>
240
+
241
+ <li class="never" data-hits="" data-linenumber="24">
242
+
243
+
244
+ <code class="ruby"></code>
245
+ </li>
246
+
247
+ <li class="covered" data-hits="1" data-linenumber="25">
248
+ <span class="hits">1</span>
249
+
250
+ <code class="ruby"> def one_of(*names)</code>
251
+ </li>
252
+
253
+ <li class="missed" data-hits="0" data-linenumber="26">
254
+
255
+
256
+ <code class="ruby"> count = 0</code>
257
+ </li>
258
+
259
+ <li class="missed" data-hits="0" data-linenumber="27">
260
+
261
+
262
+ <code class="ruby"> names.each do |name|</code>
263
+ </li>
264
+
265
+ <li class="missed" data-hits="0" data-linenumber="28">
266
+
267
+
268
+ <code class="ruby"> if params[name] and present?(params[name])</code>
269
+ </li>
270
+
271
+ <li class="missed" data-hits="0" data-linenumber="29">
272
+
273
+
274
+ <code class="ruby"> count += 1</code>
275
+ </li>
276
+
277
+ <li class="missed" data-hits="0" data-linenumber="30">
278
+
279
+
280
+ <code class="ruby"> next unless count &gt; 1</code>
281
+ </li>
282
+
283
+ <li class="never" data-hits="" data-linenumber="31">
284
+
285
+
286
+ <code class="ruby"></code>
287
+ </li>
288
+
289
+ <li class="missed" data-hits="0" data-linenumber="32">
290
+
291
+
292
+ <code class="ruby"> error = &quot;Parameters #{names.join(', ')} are mutually exclusive&quot;</code>
293
+ </li>
294
+
295
+ <li class="missed" data-hits="0" data-linenumber="33">
296
+
297
+
298
+ <code class="ruby"> if content_type and content_type.match(mime_type(:json))</code>
299
+ </li>
300
+
301
+ <li class="missed" data-hits="0" data-linenumber="34">
302
+
303
+
304
+ <code class="ruby"> error = {message: error}.to_json</code>
305
+ </li>
306
+
307
+ <li class="never" data-hits="" data-linenumber="35">
308
+
309
+
310
+ <code class="ruby"> end</code>
311
+ </li>
312
+
313
+ <li class="never" data-hits="" data-linenumber="36">
314
+
315
+
316
+ <code class="ruby"></code>
317
+ </li>
318
+
319
+ <li class="missed" data-hits="0" data-linenumber="37">
320
+
321
+
322
+ <code class="ruby"> halt 406, error</code>
323
+ </li>
324
+
325
+ <li class="never" data-hits="" data-linenumber="38">
326
+
327
+
328
+ <code class="ruby"> end</code>
329
+ </li>
330
+
331
+ <li class="never" data-hits="" data-linenumber="39">
332
+
333
+
334
+ <code class="ruby"> end</code>
335
+ </li>
336
+
337
+ <li class="never" data-hits="" data-linenumber="40">
338
+
339
+
340
+ <code class="ruby"> end</code>
341
+ </li>
342
+
343
+ <li class="never" data-hits="" data-linenumber="41">
344
+
345
+
346
+ <code class="ruby"></code>
347
+ </li>
348
+
349
+ <li class="covered" data-hits="1" data-linenumber="42">
350
+ <span class="hits">1</span>
351
+
352
+ <code class="ruby"> private</code>
353
+ </li>
354
+
355
+ <li class="never" data-hits="" data-linenumber="43">
356
+
357
+
358
+ <code class="ruby"></code>
359
+ </li>
360
+
361
+ <li class="covered" data-hits="1" data-linenumber="44">
362
+ <span class="hits">1</span>
363
+
364
+ <code class="ruby"> def coerce(param, type, options = {})</code>
365
+ </li>
366
+
367
+ <li class="missed" data-hits="0" data-linenumber="45">
368
+
369
+
370
+ <code class="ruby"> return nil if param.nil?</code>
371
+ </li>
372
+
373
+ <li class="missed" data-hits="0" data-linenumber="46">
374
+
375
+
376
+ <code class="ruby"> return param if (param.is_a?(type) rescue false)</code>
377
+ </li>
378
+
379
+ <li class="missed" data-hits="0" data-linenumber="47">
380
+
381
+
382
+ <code class="ruby"> return Integer(param) if type == Integer</code>
383
+ </li>
384
+
385
+ <li class="missed" data-hits="0" data-linenumber="48">
386
+
387
+
388
+ <code class="ruby"> return Float(param) if type == Float</code>
389
+ </li>
390
+
391
+ <li class="missed" data-hits="0" data-linenumber="49">
392
+
393
+
394
+ <code class="ruby"> return String(param) if type == String</code>
395
+ </li>
396
+
397
+ <li class="missed" data-hits="0" data-linenumber="50">
398
+
399
+
400
+ <code class="ruby"> return Time.parse(param) if type == Time</code>
401
+ </li>
402
+
403
+ <li class="missed" data-hits="0" data-linenumber="51">
404
+
405
+
406
+ <code class="ruby"> return Date.parse(param) if type == Date</code>
407
+ </li>
408
+
409
+ <li class="missed" data-hits="0" data-linenumber="52">
410
+
411
+
412
+ <code class="ruby"> return DateTime.parse(param) if type == DateTime</code>
413
+ </li>
414
+
415
+ <li class="missed" data-hits="0" data-linenumber="53">
416
+
417
+
418
+ <code class="ruby"> return Array(param.split(options[:delimiter] || &quot;,&quot;)) if type == Array</code>
419
+ </li>
420
+
421
+ <li class="missed" data-hits="0" data-linenumber="54">
422
+
423
+
424
+ <code class="ruby"> return Hash[param.split(options[:delimiter] || &quot;,&quot;).map{|c| c.split(options[:separator] || &quot;:&quot;)}] if type == Hash</code>
425
+ </li>
426
+
427
+ <li class="missed" data-hits="0" data-linenumber="55">
428
+
429
+
430
+ <code class="ruby"> return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == :boolean</code>
431
+ </li>
432
+
433
+ <li class="never" data-hits="" data-linenumber="56">
434
+
435
+
436
+ <code class="ruby"> return nil</code>
437
+ </li>
438
+
439
+ <li class="never" data-hits="" data-linenumber="57">
440
+
441
+
442
+ <code class="ruby"> end</code>
443
+ </li>
444
+
445
+ <li class="never" data-hits="" data-linenumber="58">
446
+
447
+
448
+ <code class="ruby"></code>
449
+ </li>
450
+
451
+ <li class="covered" data-hits="1" data-linenumber="59">
452
+ <span class="hits">1</span>
453
+
454
+ <code class="ruby"> def validate!(param, options)</code>
455
+ </li>
456
+
457
+ <li class="missed" data-hits="0" data-linenumber="60">
458
+
459
+
460
+ <code class="ruby"> options.each do |key, value|</code>
461
+ </li>
462
+
463
+ <li class="missed" data-hits="0" data-linenumber="61">
464
+
465
+
466
+ <code class="ruby"> case key</code>
467
+ </li>
468
+
469
+ <li class="never" data-hits="" data-linenumber="62">
470
+
471
+
472
+ <code class="ruby"> when :required</code>
473
+ </li>
474
+
475
+ <li class="missed" data-hits="0" data-linenumber="63">
476
+
477
+
478
+ <code class="ruby"> raise InvalidParameterError if value &amp;&amp; param.nil?</code>
479
+ </li>
480
+
481
+ <li class="never" data-hits="" data-linenumber="64">
482
+
483
+
484
+ <code class="ruby"> when :blank</code>
485
+ </li>
486
+
487
+ <li class="never" data-hits="" data-linenumber="65">
488
+
489
+
490
+ <code class="ruby"> raise InvalidParameterError if !value &amp;&amp; case param</code>
491
+ </li>
492
+
493
+ <li class="never" data-hits="" data-linenumber="66">
494
+
495
+
496
+ <code class="ruby"> when String</code>
497
+ </li>
498
+
499
+ <li class="missed" data-hits="0" data-linenumber="67">
500
+
501
+
502
+ <code class="ruby"> !(/\S/ === param)</code>
503
+ </li>
504
+
505
+ <li class="never" data-hits="" data-linenumber="68">
506
+
507
+
508
+ <code class="ruby"> when Array, Hash</code>
509
+ </li>
510
+
511
+ <li class="missed" data-hits="0" data-linenumber="69">
512
+
513
+
514
+ <code class="ruby"> param.empty?</code>
515
+ </li>
516
+
517
+ <li class="never" data-hits="" data-linenumber="70">
518
+
519
+
520
+ <code class="ruby"> else</code>
521
+ </li>
522
+
523
+ <li class="missed" data-hits="0" data-linenumber="71">
524
+
525
+
526
+ <code class="ruby"> param.nil?</code>
527
+ </li>
528
+
529
+ <li class="missed" data-hits="0" data-linenumber="72">
530
+
531
+
532
+ <code class="ruby"> end</code>
533
+ </li>
534
+
535
+ <li class="never" data-hits="" data-linenumber="73">
536
+
537
+
538
+ <code class="ruby"> when :is</code>
539
+ </li>
540
+
541
+ <li class="missed" data-hits="0" data-linenumber="74">
542
+
543
+
544
+ <code class="ruby"> raise InvalidParameterError unless value === param</code>
545
+ </li>
546
+
547
+ <li class="never" data-hits="" data-linenumber="75">
548
+
549
+
550
+ <code class="ruby"> when :in, :within, :range</code>
551
+ </li>
552
+
553
+ <li class="never" data-hits="" data-linenumber="76">
554
+
555
+
556
+ <code class="ruby"> raise InvalidParameterError unless param.nil? || case value</code>
557
+ </li>
558
+
559
+ <li class="never" data-hits="" data-linenumber="77">
560
+
561
+
562
+ <code class="ruby"> when Range</code>
563
+ </li>
564
+
565
+ <li class="missed" data-hits="0" data-linenumber="78">
566
+
567
+
568
+ <code class="ruby"> value.include?(param)</code>
569
+ </li>
570
+
571
+ <li class="never" data-hits="" data-linenumber="79">
572
+
573
+
574
+ <code class="ruby"> else</code>
575
+ </li>
576
+
577
+ <li class="missed" data-hits="0" data-linenumber="80">
578
+
579
+
580
+ <code class="ruby"> Array(value).include?(param)</code>
581
+ </li>
582
+
583
+ <li class="missed" data-hits="0" data-linenumber="81">
584
+
585
+
586
+ <code class="ruby"> end</code>
587
+ </li>
588
+
589
+ <li class="never" data-hits="" data-linenumber="82">
590
+
591
+
592
+ <code class="ruby"> when :min</code>
593
+ </li>
594
+
595
+ <li class="missed" data-hits="0" data-linenumber="83">
596
+
597
+
598
+ <code class="ruby"> raise InvalidParameterError unless param.nil? || value &lt;= param</code>
599
+ </li>
600
+
601
+ <li class="never" data-hits="" data-linenumber="84">
602
+
603
+
604
+ <code class="ruby"> when :max</code>
605
+ </li>
606
+
607
+ <li class="missed" data-hits="0" data-linenumber="85">
608
+
609
+
610
+ <code class="ruby"> raise InvalidParameterError unless param.nil? || value &gt;= param</code>
611
+ </li>
612
+
613
+ <li class="never" data-hits="" data-linenumber="86">
614
+
615
+
616
+ <code class="ruby"> when :min_length</code>
617
+ </li>
618
+
619
+ <li class="missed" data-hits="0" data-linenumber="87">
620
+
621
+
622
+ <code class="ruby"> raise InvalidParameterError unless param.nil? || value &lt;= param.length</code>
623
+ </li>
624
+
625
+ <li class="never" data-hits="" data-linenumber="88">
626
+
627
+
628
+ <code class="ruby"> when :max_length</code>
629
+ </li>
630
+
631
+ <li class="missed" data-hits="0" data-linenumber="89">
632
+
633
+
634
+ <code class="ruby"> raise InvalidParameterError unless param.nil? || value &gt;= param.length</code>
635
+ </li>
636
+
637
+ <li class="never" data-hits="" data-linenumber="90">
638
+
639
+
640
+ <code class="ruby"> end</code>
641
+ </li>
642
+
643
+ <li class="never" data-hits="" data-linenumber="91">
644
+
645
+
646
+ <code class="ruby"> end</code>
647
+ </li>
648
+
649
+ <li class="never" data-hits="" data-linenumber="92">
650
+
651
+
652
+ <code class="ruby"> end</code>
653
+ </li>
654
+
655
+ <li class="never" data-hits="" data-linenumber="93">
656
+
657
+
658
+ <code class="ruby"></code>
659
+ </li>
660
+
661
+ <li class="never" data-hits="" data-linenumber="94">
662
+
663
+
664
+ <code class="ruby"> # ActiveSupport #present? and #blank? without patching Object</code>
665
+ </li>
666
+
667
+ <li class="covered" data-hits="1" data-linenumber="95">
668
+ <span class="hits">1</span>
669
+
670
+ <code class="ruby"> def present?(object)</code>
671
+ </li>
672
+
673
+ <li class="missed" data-hits="0" data-linenumber="96">
674
+
675
+
676
+ <code class="ruby"> !blank?(object)</code>
677
+ </li>
678
+
679
+ <li class="never" data-hits="" data-linenumber="97">
680
+
681
+
682
+ <code class="ruby"> end</code>
683
+ </li>
684
+
685
+ <li class="never" data-hits="" data-linenumber="98">
686
+
687
+
688
+ <code class="ruby"></code>
689
+ </li>
690
+
691
+ <li class="covered" data-hits="1" data-linenumber="99">
692
+ <span class="hits">1</span>
693
+
694
+ <code class="ruby"> def blank?(object)</code>
695
+ </li>
696
+
697
+ <li class="missed" data-hits="0" data-linenumber="100">
698
+
699
+
700
+ <code class="ruby"> object.respond_to?(:empty?) ? object.empty? : !object</code>
701
+ </li>
702
+
703
+ <li class="never" data-hits="" data-linenumber="101">
704
+
705
+
706
+ <code class="ruby"> end</code>
707
+ </li>
708
+
709
+ <li class="never" data-hits="" data-linenumber="102">
710
+
711
+
712
+ <code class="ruby"> end</code>
713
+ </li>
714
+
715
+ <li class="never" data-hits="" data-linenumber="103">
716
+
717
+
718
+ <code class="ruby"></code>
719
+ </li>
720
+
721
+ <li class="covered" data-hits="1" data-linenumber="104">
722
+ <span class="hits">1</span>
723
+
724
+ <code class="ruby"> helpers Param</code>
725
+ </li>
726
+
727
+ <li class="never" data-hits="" data-linenumber="105">
728
+
729
+
730
+ <code class="ruby">end</code>
731
+ </li>
732
+
733
+ </ol>
734
+ </pre>
735
+ </div>
736
+
737
+ <div class="source_table" id="95bc1568394aeedcc2389ae1301b3fd7e08bf109">
738
+ <div class="header">
739
+ <h3>lib/sinatra/param/version.rb</h3>
740
+ <h4><span class="green">100.0 %</span> covered</h4>
741
+ <div>
742
+ <b>3</b> relevant lines.
743
+ <span class="green"><b>3</b> lines covered</span> and
744
+ <span class="red"><b>0</b> lines missed.</span>
745
+ </div>
746
+ </div>
747
+
748
+ <pre>
749
+ <ol>
750
+
751
+ <li class="covered" data-hits="1" data-linenumber="1">
752
+ <span class="hits">1</span>
753
+
754
+ <code class="ruby">module Sinatra</code>
755
+ </li>
756
+
757
+ <li class="covered" data-hits="1" data-linenumber="2">
758
+ <span class="hits">1</span>
759
+
760
+ <code class="ruby"> module Param</code>
761
+ </li>
762
+
763
+ <li class="covered" data-hits="1" data-linenumber="3">
764
+ <span class="hits">1</span>
765
+
766
+ <code class="ruby"> VERSION = &quot;0.1.1&quot;</code>
767
+ </li>
768
+
769
+ <li class="never" data-hits="" data-linenumber="4">
770
+
771
+
772
+ <code class="ruby"> end</code>
773
+ </li>
774
+
775
+ <li class="never" data-hits="" data-linenumber="5">
776
+
777
+
778
+ <code class="ruby">end</code>
779
+ </li>
780
+
781
+ </ol>
782
+ </pre>
783
+ </div>
784
+
785
+ </div>
786
+ </div>
787
+ </body>
788
+ </html>