sinatra-docdsl 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/docdsl.rb +50 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yzc0MmUwOTQwMzQxMjY0MDkzN2Y2ZDE5OGMzYzc2NmFmMDA0OGE4NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmUzOTBhMWJlYjIzZTA5MmI5MjVkYTg4YTM0OTk3MjczN2QyYWZmMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODhlNDMzNjYwYTk1NmZhYjI1OTRjZDY4MTU3M2UzZjg5MzhlYTQyNmFmNDAw
|
10
|
+
MTc2NzVkMTU4ZjVkN2M3ZGRlZmMwMTRkNDM4NmY0ZjY4OGEyYjA3MTNhN2Ji
|
11
|
+
YWZkYjk2MTM5OTJjZDEwMDYzOTE2MDMzNGNjYTc2ZWVmZWZhMTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjE5Mzc5MDhkMGUzYmVlOThmMTgwMDZiMjY0MmFjMDkyNDEwNzZmOGY2YWU5
|
14
|
+
NjRmOGI0YjJiMjMxMWZmMWY2NDQ5ZTFjMmUwNzgxZmY0MTJiZjRkMmNmOWNm
|
15
|
+
Zjg1YjdlOTcyYTlhYTkzZTNiM2Q1MWMxNGZhNWEwNjNhMDAwZWY=
|
data/lib/docdsl.rb
CHANGED
@@ -210,8 +210,56 @@ module Sinatra
|
|
210
210
|
@query_params[name]=desc
|
211
211
|
end
|
212
212
|
|
213
|
-
def status(code,meaning)
|
214
|
-
|
213
|
+
def status(code,meaning=nil)
|
214
|
+
official_meaning=status_codes_map[code]
|
215
|
+
if meaning
|
216
|
+
@status_codes[code]="#{official_meaning} - #{meaning}"
|
217
|
+
else
|
218
|
+
@status_codes[code]=official_meaning
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def status_codes_map
|
223
|
+
{
|
224
|
+
100=> 'Continue',
|
225
|
+
101=> 'Switching Protocols',
|
226
|
+
102=> 'Processing',
|
227
|
+
200=> 'OK',
|
228
|
+
201=> 'Created',
|
229
|
+
202=> 'Accepted',
|
230
|
+
203=> 'Non Authoritative Information',
|
231
|
+
204=> 'No Content',
|
232
|
+
205=> 'Reset Content',
|
233
|
+
206=> 'Partial Content',
|
234
|
+
207=> 'Multi-Status',
|
235
|
+
300=> 'Mutliple Choices',
|
236
|
+
301=> 'Moved Permanently',
|
237
|
+
302=> 'Moved Temporarily',
|
238
|
+
303=> 'See Other',
|
239
|
+
304=> 'Not Modified',
|
240
|
+
305=> 'Use Proxy',
|
241
|
+
307=> 'Temporary Redirect',
|
242
|
+
400=> 'Bad Request',
|
243
|
+
401=> 'Unauthorized',
|
244
|
+
402=> 'Payment Required',
|
245
|
+
403=> 'Forbidden',
|
246
|
+
404=> 'Not Found',
|
247
|
+
405=> 'Method Not Allowed',
|
248
|
+
406=> 'Not Acceptable',
|
249
|
+
407=> 'Proxy Authentication Required',
|
250
|
+
408=> 'Request Timeout',
|
251
|
+
409=> 'Conflict',
|
252
|
+
410=> 'Gone',
|
253
|
+
411=> 'Length Required',
|
254
|
+
412=> 'Precondition Failed',
|
255
|
+
413=> 'Request Entity Too Large',
|
256
|
+
414=> 'Request-URI Too Long',
|
257
|
+
415=> 'Unsupported Media Type',
|
258
|
+
416=> 'Requested Range Not Satisfiable',
|
259
|
+
417=> 'Expectation Failed',
|
260
|
+
500=> 'Internal Server Error',
|
261
|
+
503=> 'Temporarily Unavailable'
|
262
|
+
}
|
215
263
|
end
|
216
264
|
|
217
265
|
def json
|