rspec_api_documentation 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/lib/rspec_api_documentation.rb +1 -1
  2. data/lib/rspec_api_documentation/api_documentation.rb +1 -0
  3. data/lib/rspec_api_documentation/client_base.rb +9 -14
  4. data/lib/rspec_api_documentation/curl.rb +4 -4
  5. data/lib/rspec_api_documentation/html_writer.rb +15 -0
  6. data/lib/rspec_api_documentation/oauth2_mac_client.rb +5 -1
  7. data/lib/rspec_api_documentation/rack_test_client.rb +5 -1
  8. data/lib/rspec_api_documentation/test_server.rb +3 -4
  9. data/lib/rspec_api_documentation/wurl_writer.rb +105 -0
  10. data/templates/assets/img/glyphicons-halflings-white.png +0 -0
  11. data/templates/assets/img/glyphicons-halflings.png +0 -0
  12. data/templates/assets/javascripts/application.js +250 -0
  13. data/templates/assets/javascripts/codemirror.js +3636 -0
  14. data/templates/assets/javascripts/jquery-1-7-2.js +9401 -0
  15. data/templates/assets/javascripts/jquery-base64.js +189 -0
  16. data/templates/assets/javascripts/jquery-livequery.js +226 -0
  17. data/templates/assets/javascripts/jquery-ui-1-8-16-min.js +791 -0
  18. data/templates/assets/javascripts/mode/css/css.js +124 -0
  19. data/templates/assets/javascripts/mode/htmlmixed/htmlmixed.js +85 -0
  20. data/templates/assets/javascripts/mode/javascript/javascript.js +361 -0
  21. data/templates/assets/javascripts/mode/xml/xml.js +325 -0
  22. data/templates/assets/stylesheets/application.css +68 -0
  23. data/templates/assets/stylesheets/bootstrap.css +4960 -0
  24. data/templates/assets/stylesheets/codemirror.css +230 -0
  25. data/templates/rspec_api_documentation/html_example.mustache +52 -9
  26. data/templates/rspec_api_documentation/html_index.mustache +22 -21
  27. data/templates/rspec_api_documentation/wurl_example.mustache +241 -0
  28. data/templates/rspec_api_documentation/wurl_index.mustache +26 -0
  29. metadata +47 -111
  30. data/lib/rspec_api_documentation/syntax.rb +0 -33
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>API Documentation</title>
5
+ <link rel="stylesheet" href="/{{ url_prefix }}/assets/stylesheets/bootstrap.css"/>
6
+ </head>
7
+ <body>
8
+ <div class="container">
9
+ <h1>API Documentation</h1>
10
+
11
+ {{# sections }}
12
+ <div class="article">
13
+ <h2>{{ resource_name }}</h2>
14
+
15
+ <ul>
16
+ {{# examples }}
17
+ <li>
18
+ <a href="/{{ url_prefix }}{{ dirname }}/{{ filename }}">{{ description }}</a>
19
+ </li>
20
+ {{/ examples }}
21
+ </ul>
22
+ </div>
23
+ {{/ sections }}
24
+ </div>
25
+ </body>
26
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_api_documentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-05-14 00:00:00.000000000 Z
14
+ date: 2012-05-21 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec
18
- requirement: !ruby/object:Gem::Requirement
18
+ requirement: &70239312431960 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,15 +23,10 @@ dependencies:
23
23
  version: 2.6.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ! '>='
30
- - !ruby/object:Gem::Version
31
- version: 2.6.0
26
+ version_requirements: *70239312431960
32
27
  - !ruby/object:Gem::Dependency
33
28
  name: activesupport
34
- requirement: !ruby/object:Gem::Requirement
29
+ requirement: &70239312430760 !ruby/object:Gem::Requirement
35
30
  none: false
36
31
  requirements:
37
32
  - - ! '>='
@@ -39,15 +34,10 @@ dependencies:
39
34
  version: 3.0.0
40
35
  type: :runtime
41
36
  prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: 3.0.0
37
+ version_requirements: *70239312430760
48
38
  - !ruby/object:Gem::Dependency
49
39
  name: i18n
50
- requirement: !ruby/object:Gem::Requirement
40
+ requirement: &70239312429680 !ruby/object:Gem::Requirement
51
41
  none: false
52
42
  requirements:
53
43
  - - ! '>='
@@ -55,15 +45,10 @@ dependencies:
55
45
  version: 0.1.0
56
46
  type: :runtime
57
47
  prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
- requirements:
61
- - - ! '>='
62
- - !ruby/object:Gem::Version
63
- version: 0.1.0
48
+ version_requirements: *70239312429680
64
49
  - !ruby/object:Gem::Dependency
65
50
  name: mustache
66
- requirement: !ruby/object:Gem::Requirement
51
+ requirement: &70239312428600 !ruby/object:Gem::Requirement
67
52
  none: false
68
53
  requirements:
69
54
  - - ! '>='
@@ -71,15 +56,10 @@ dependencies:
71
56
  version: 0.99.4
72
57
  type: :runtime
73
58
  prerelease: false
74
- version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ! '>='
78
- - !ruby/object:Gem::Version
79
- version: 0.99.4
59
+ version_requirements: *70239312428600
80
60
  - !ruby/object:Gem::Dependency
81
61
  name: webmock
82
- requirement: !ruby/object:Gem::Requirement
62
+ requirement: &70239312427680 !ruby/object:Gem::Requirement
83
63
  none: false
84
64
  requirements:
85
65
  - - ! '>='
@@ -87,15 +67,10 @@ dependencies:
87
67
  version: 1.7.0
88
68
  type: :runtime
89
69
  prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
- requirements:
93
- - - ! '>='
94
- - !ruby/object:Gem::Version
95
- version: 1.7.0
70
+ version_requirements: *70239312427680
96
71
  - !ruby/object:Gem::Dependency
97
72
  name: json
98
- requirement: !ruby/object:Gem::Requirement
73
+ requirement: &70239312426980 !ruby/object:Gem::Requirement
99
74
  none: false
100
75
  requirements:
101
76
  - - ! '>='
@@ -103,31 +78,10 @@ dependencies:
103
78
  version: 1.4.6
104
79
  type: :runtime
105
80
  prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ! '>='
110
- - !ruby/object:Gem::Version
111
- version: 1.4.6
112
- - !ruby/object:Gem::Dependency
113
- name: coderay
114
- requirement: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ! '>='
118
- - !ruby/object:Gem::Version
119
- version: 1.0.7.rc1
120
- type: :runtime
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
- requirements:
125
- - - ! '>='
126
- - !ruby/object:Gem::Version
127
- version: 1.0.7.rc1
81
+ version_requirements: *70239312426980
128
82
  - !ruby/object:Gem::Dependency
129
83
  name: fakefs
130
- requirement: !ruby/object:Gem::Requirement
84
+ requirement: &70239312426260 !ruby/object:Gem::Requirement
131
85
  none: false
132
86
  requirements:
133
87
  - - ! '>='
@@ -135,15 +89,10 @@ dependencies:
135
89
  version: '0'
136
90
  type: :development
137
91
  prerelease: false
138
- version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
- requirements:
141
- - - ! '>='
142
- - !ruby/object:Gem::Version
143
- version: '0'
92
+ version_requirements: *70239312426260
144
93
  - !ruby/object:Gem::Dependency
145
94
  name: sinatra
146
- requirement: !ruby/object:Gem::Requirement
95
+ requirement: &70239312425460 !ruby/object:Gem::Requirement
147
96
  none: false
148
97
  requirements:
149
98
  - - ! '>='
@@ -151,15 +100,10 @@ dependencies:
151
100
  version: '0'
152
101
  type: :development
153
102
  prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- none: false
156
- requirements:
157
- - - ! '>='
158
- - !ruby/object:Gem::Version
159
- version: '0'
103
+ version_requirements: *70239312425460
160
104
  - !ruby/object:Gem::Dependency
161
105
  name: aruba
162
- requirement: !ruby/object:Gem::Requirement
106
+ requirement: &70239312424480 !ruby/object:Gem::Requirement
163
107
  none: false
164
108
  requirements:
165
109
  - - ! '>='
@@ -167,15 +111,10 @@ dependencies:
167
111
  version: '0'
168
112
  type: :development
169
113
  prerelease: false
170
- version_requirements: !ruby/object:Gem::Requirement
171
- none: false
172
- requirements:
173
- - - ! '>='
174
- - !ruby/object:Gem::Version
175
- version: '0'
114
+ version_requirements: *70239312424480
176
115
  - !ruby/object:Gem::Dependency
177
116
  name: capybara
178
- requirement: !ruby/object:Gem::Requirement
117
+ requirement: &70239312411060 !ruby/object:Gem::Requirement
179
118
  none: false
180
119
  requirements:
181
120
  - - ! '>='
@@ -183,15 +122,10 @@ dependencies:
183
122
  version: '0'
184
123
  type: :development
185
124
  prerelease: false
186
- version_requirements: !ruby/object:Gem::Requirement
187
- none: false
188
- requirements:
189
- - - ! '>='
190
- - !ruby/object:Gem::Version
191
- version: '0'
125
+ version_requirements: *70239312411060
192
126
  - !ruby/object:Gem::Dependency
193
127
  name: rake
194
- requirement: !ruby/object:Gem::Requirement
128
+ requirement: &70239312410480 !ruby/object:Gem::Requirement
195
129
  none: false
196
130
  requirements:
197
131
  - - ! '>='
@@ -199,15 +133,10 @@ dependencies:
199
133
  version: '0'
200
134
  type: :development
201
135
  prerelease: false
202
- version_requirements: !ruby/object:Gem::Requirement
203
- none: false
204
- requirements:
205
- - - ! '>='
206
- - !ruby/object:Gem::Version
207
- version: '0'
136
+ version_requirements: *70239312410480
208
137
  - !ruby/object:Gem::Dependency
209
138
  name: rack-test
210
- requirement: !ruby/object:Gem::Requirement
139
+ requirement: &70239312409580 !ruby/object:Gem::Requirement
211
140
  none: false
212
141
  requirements:
213
142
  - - ! '>='
@@ -215,15 +144,10 @@ dependencies:
215
144
  version: 0.5.5
216
145
  type: :development
217
146
  prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- none: false
220
- requirements:
221
- - - ! '>='
222
- - !ruby/object:Gem::Version
223
- version: 0.5.5
147
+ version_requirements: *70239312409580
224
148
  - !ruby/object:Gem::Dependency
225
149
  name: rack-oauth2
226
- requirement: !ruby/object:Gem::Requirement
150
+ requirement: &70239312408200 !ruby/object:Gem::Requirement
227
151
  none: false
228
152
  requirements:
229
153
  - - ! '>='
@@ -231,12 +155,7 @@ dependencies:
231
155
  version: 0.14.4
232
156
  type: :development
233
157
  prerelease: false
234
- version_requirements: !ruby/object:Gem::Requirement
235
- none: false
236
- requirements:
237
- - - ! '>='
238
- - !ruby/object:Gem::Version
239
- version: 0.14.4
158
+ version_requirements: *70239312408200
240
159
  description: Generate API docs from your test suite
241
160
  email:
242
161
  - chris@smartlogicsolutions.com
@@ -264,14 +183,31 @@ files:
264
183
  - lib/rspec_api_documentation/oauth2_mac_client.rb
265
184
  - lib/rspec_api_documentation/rack_test_client.rb
266
185
  - lib/rspec_api_documentation/railtie.rb
267
- - lib/rspec_api_documentation/syntax.rb
268
186
  - lib/rspec_api_documentation/test_server.rb
187
+ - lib/rspec_api_documentation/wurl_writer.rb
269
188
  - lib/rspec_api_documentation.rb
270
189
  - lib/tasks/docs.rake
190
+ - templates/assets/img/glyphicons-halflings-white.png
191
+ - templates/assets/img/glyphicons-halflings.png
192
+ - templates/assets/javascripts/application.js
193
+ - templates/assets/javascripts/codemirror.js
194
+ - templates/assets/javascripts/jquery-1-7-2.js
195
+ - templates/assets/javascripts/jquery-base64.js
196
+ - templates/assets/javascripts/jquery-livequery.js
197
+ - templates/assets/javascripts/jquery-ui-1-8-16-min.js
198
+ - templates/assets/javascripts/mode/css/css.js
199
+ - templates/assets/javascripts/mode/htmlmixed/htmlmixed.js
200
+ - templates/assets/javascripts/mode/javascript/javascript.js
201
+ - templates/assets/javascripts/mode/xml/xml.js
202
+ - templates/assets/stylesheets/application.css
203
+ - templates/assets/stylesheets/bootstrap.css
204
+ - templates/assets/stylesheets/codemirror.css
271
205
  - templates/rspec_api_documentation/example.json
272
206
  - templates/rspec_api_documentation/html_example.mustache
273
207
  - templates/rspec_api_documentation/html_index.mustache
274
208
  - templates/rspec_api_documentation/index.json
209
+ - templates/rspec_api_documentation/wurl_example.mustache
210
+ - templates/rspec_api_documentation/wurl_index.mustache
275
211
  homepage: http://smartlogicsolutions.com
276
212
  licenses: []
277
213
  post_install_message:
@@ -292,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
228
  version: 1.3.6
293
229
  requirements: []
294
230
  rubyforge_project:
295
- rubygems_version: 1.8.22
231
+ rubygems_version: 1.8.10
296
232
  signing_key:
297
233
  specification_version: 3
298
234
  summary: A double black belt for your docs
@@ -1,33 +0,0 @@
1
- require "coderay"
2
-
3
- module RspecApiDocumentation
4
- module Syntax
5
- private
6
-
7
- def highlight_syntax(body, content_type, is_query_string = false)
8
- return if body.blank?
9
- begin
10
- case content_type
11
- when /json/
12
- CodeRay.scan(JSON.pretty_generate(JSON.parse(body)), :json).div
13
- when /html/
14
- CodeRay.scan(body, :html).div
15
- when /javascript/
16
- CodeRay.scan(body, :java_script).div
17
- when /xml/
18
- CodeRay.scan(body, :xml).div
19
- else
20
- body = prettify_request_body(body) if is_query_string
21
- "<pre>#{body}</pre>"
22
- end
23
- rescue Exception => e
24
- "<pre>#{e.inspect}</pre>"
25
- end
26
- end
27
-
28
- def prettify_request_body(string)
29
- return if string.blank?
30
- CGI.unescape(string.split("&").join("\n"))
31
- end
32
- end
33
- end