sinatra-param 0.1.2 → 0.1.3

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