sinatra-docdsl 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/docdsl.rb +8 -22
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWY4NjBmZDg4ZGEzODliNTdlNmNlNzMxNTVkNDI1YTg2OThkYmQ1ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWNlYzA5OGYzZDkzNGQ5MDVhZmYxZGYyMDEyYjM5MDQ1NWVmY2JkMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjQ4MmExYWM3ZDExZTZjMWFkNGEyYTU3N2MxZmRjYjQ1MGJiMTI0YTM0MzJi
|
10
|
+
ZTRlMGU0ZDA0M2ZmNWYyODA0M2NhN2QwZTU5OGQ2NmRjZmEyMTkxODljYzI2
|
11
|
+
YzkwYzA5M2I4Mjc1ODRhZWNhZmVmZDQ2NTlhZjUzNTNkYjRhYzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTllMmM0MGIxYzY1ZDhkMThkMTRjMzFhNTc2MmI1NGE0OGZkZDRjMTZmYTlk
|
14
|
+
NDg4ZmI4ZThmZjQ1MzYwNzUxYzQzMTI0NzQ1Y2I0NGRiZGRjNjUxNjE2NDg5
|
15
|
+
M2U1YjIxYzFkMDJkY2IyNDlkYzNmZmRjZTdkOTU1ZDRhN2IzNDY=
|
data/lib/docdsl.rb
CHANGED
@@ -113,16 +113,6 @@ HTML
|
|
113
113
|
#{@the_introduction}
|
114
114
|
|
115
115
|
"
|
116
|
-
# :description=>@desc,
|
117
|
-
# :url_parameters=>@params,
|
118
|
-
# :paths=>@paths,
|
119
|
-
# :query_parameters=>@query_params,
|
120
|
-
# :headers=>@headers,
|
121
|
-
# :payload=>@the_payload,
|
122
|
-
# :sample_request=>@sample_request,
|
123
|
-
# :response=>@the_response,
|
124
|
-
# :status_codes=>@status_codes,
|
125
|
-
# :sample_response=>@sample_response
|
126
116
|
markdown = @entries.inject(markdown) do | md, entry |
|
127
117
|
path = entry.paths.join(', ')
|
128
118
|
params = definition_list("Url Parameters", entry.params)
|
@@ -410,23 +400,21 @@ HTML
|
|
410
400
|
}
|
411
401
|
end
|
412
402
|
end
|
413
|
-
|
414
|
-
def
|
415
|
-
|
403
|
+
|
404
|
+
def doc_endpoint(path)
|
405
|
+
page_doc=@page_doc
|
406
|
+
get path do
|
416
407
|
begin
|
417
|
-
|
418
|
-
@page_doc ||= PageDoc.new
|
419
|
-
@page_doc.render
|
420
|
-
}
|
408
|
+
page_doc.render
|
421
409
|
rescue Exception=>e
|
422
410
|
puts e.message, e.backtrace.inspect
|
423
411
|
[500,@page_doc.render]
|
424
412
|
end
|
425
413
|
end
|
426
414
|
end
|
427
|
-
|
415
|
+
|
428
416
|
def page(&block)
|
429
|
-
@page_doc
|
417
|
+
@page_doc = PageDoc.new(&block)
|
430
418
|
end
|
431
419
|
|
432
420
|
def documentation(description,&block)
|
@@ -436,10 +424,8 @@ HTML
|
|
436
424
|
end
|
437
425
|
|
438
426
|
def method_added(method)
|
439
|
-
# don't document /doc
|
440
|
-
return if method.to_s =~ /(^(GET|HEAD) \/doc\z)/
|
441
427
|
# document the method and nullify last_doc so that a new one gets created for the next method
|
442
|
-
if
|
428
|
+
if @last_doc
|
443
429
|
@last_doc << method
|
444
430
|
@last_doc = nil
|
445
431
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-docdsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jilles van Gurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version: '0'
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
27
|
-
description: A simple DSL for
|
27
|
+
description: A simple DSL for generating documentation for Sinatra REST applications
|
28
28
|
email: incoming@jillesvangurp.xom
|
29
29
|
executables: []
|
30
30
|
extensions: []
|