api_sketch 0.1.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 +7 -0
- data/.gitignore +14 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +404 -0
- data/Rakefile +8 -0
- data/api_sketch.gemspec +30 -0
- data/bin/api_sketch +10 -0
- data/lib/api_sketch/config.rb +7 -0
- data/lib/api_sketch/dsl.rb +213 -0
- data/lib/api_sketch/error.rb +2 -0
- data/lib/api_sketch/examples_server.rb +54 -0
- data/lib/api_sketch/generators.rb +87 -0
- data/lib/api_sketch/helpers.rb +21 -0
- data/lib/api_sketch/model.rb +227 -0
- data/lib/api_sketch/renderers.rb +48 -0
- data/lib/api_sketch/runner.rb +92 -0
- data/lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/api_sketch/templates/bootstrap/assets/images/favicon.ico +0 -0
- data/lib/api_sketch/templates/bootstrap/assets/javascripts/bootstrap.js +2114 -0
- data/lib/api_sketch/templates/bootstrap/assets/javascripts/bootstrap.min.js +6 -0
- data/lib/api_sketch/templates/bootstrap/assets/javascripts/docs.min.js +24 -0
- data/lib/api_sketch/templates/bootstrap/assets/javascripts/ie10-viewport-bug-workaround.js +22 -0
- data/lib/api_sketch/templates/bootstrap/assets/javascripts/jquery-1.11.1.min.js +4 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.css +442 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.css.map +1 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.min.css +5 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.css +6203 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.css.map +1 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.min.css +5 -0
- data/lib/api_sketch/templates/bootstrap/assets/stylesheets/dashboard.css +130 -0
- data/lib/api_sketch/templates/bootstrap/resource.html.erb +215 -0
- data/lib/api_sketch/version.rb +3 -0
- data/lib/api_sketch.rb +19 -0
- data/spec/lib/dsl_spec.rb +474 -0
- data/spec/spec_helper.rb +1 -0
- metadata +187 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe ApiSketch::DSL do
|
|
4
|
+
context "document" do
|
|
5
|
+
context "when all data has key names" do
|
|
6
|
+
before do
|
|
7
|
+
@block = lambda do
|
|
8
|
+
document do
|
|
9
|
+
content do
|
|
10
|
+
string "test_key" do
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "should successfully create objects" do
|
|
18
|
+
attributes = ApiSketch::DSL::Attributes.new(:array, &@block).to_a
|
|
19
|
+
attribute = attributes.first
|
|
20
|
+
expect(attribute.data_type).to eql :document
|
|
21
|
+
string_key = attribute.content.first
|
|
22
|
+
expect(string_key.data_type).to eql :string
|
|
23
|
+
expect(string_key.name).to eql "test_key"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context "when data doesn't have key name" do
|
|
28
|
+
before do
|
|
29
|
+
@invalid_block = lambda do
|
|
30
|
+
document do
|
|
31
|
+
content do
|
|
32
|
+
string do
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should return error" do
|
|
40
|
+
expect { ApiSketch::DSL::Attributes.new(:array, &@invalid_block) }.to raise_error(::ApiSketch::Error, "Key inside document should have name")
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
context "array" do
|
|
46
|
+
context "when elements don't have names" do
|
|
47
|
+
before do
|
|
48
|
+
@block = lambda do
|
|
49
|
+
array do
|
|
50
|
+
content do
|
|
51
|
+
string do
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
it "should successfully create objects" do
|
|
59
|
+
attributes = ApiSketch::DSL::Attributes.new(:array, &@block).to_a
|
|
60
|
+
attribute = attributes.first
|
|
61
|
+
expect(attribute.data_type).to eql :array
|
|
62
|
+
string_key = attribute.content.first
|
|
63
|
+
expect(string_key.data_type).to eql :string
|
|
64
|
+
expect(string_key.name).to be_nil
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
context "when elements have names" do
|
|
69
|
+
before do
|
|
70
|
+
@invalid_block = lambda do
|
|
71
|
+
array do
|
|
72
|
+
content do
|
|
73
|
+
string "some_name_here" do
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it "should return error" do
|
|
81
|
+
expect { ApiSketch::DSL::Attributes.new(:array, &@invalid_block) }.to raise_error(::ApiSketch::Error, "Array element can't have name")
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
context "resource" do
|
|
87
|
+
before do
|
|
88
|
+
# Ensure that we have empty resources set for each test
|
|
89
|
+
ApiSketch::Model::Resource.reset!
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
context "incorrect data" do
|
|
93
|
+
context "empty key name at root document" do
|
|
94
|
+
before do
|
|
95
|
+
@block = Proc.new do
|
|
96
|
+
resource "API endpoint name" do
|
|
97
|
+
action "show"
|
|
98
|
+
namespace "endpoints"
|
|
99
|
+
path "/api/endpoint/link.json"
|
|
100
|
+
http_method "GET"
|
|
101
|
+
|
|
102
|
+
parameters do
|
|
103
|
+
query :document do
|
|
104
|
+
string do
|
|
105
|
+
description "Nameless key. This should be an error"
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it "should return error" do
|
|
114
|
+
expect { ApiSketch::DSL.new.instance_eval(&@block) }.to raise_error(::ApiSketch::Error, "Key inside document should have name")
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
context "named key at root array" do
|
|
119
|
+
before do
|
|
120
|
+
@block = Proc.new do
|
|
121
|
+
resource "API endpoint name" do
|
|
122
|
+
action "show"
|
|
123
|
+
namespace "endpoints"
|
|
124
|
+
path "/api/endpoint/link.json"
|
|
125
|
+
http_method "GET"
|
|
126
|
+
|
|
127
|
+
parameters do
|
|
128
|
+
query :array do
|
|
129
|
+
string "some_name" do
|
|
130
|
+
description "Named key. This should be an error"
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
it "should return error" do
|
|
139
|
+
expect { ApiSketch::DSL.new.instance_eval(&@block) }.to raise_error(::ApiSketch::Error, "Array element can't have name")
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
context "correct data" do
|
|
145
|
+
before do
|
|
146
|
+
@block = Proc.new do
|
|
147
|
+
resource "API endpoint name" do
|
|
148
|
+
action "update"
|
|
149
|
+
namespace "endpoints"
|
|
150
|
+
description "API endpoint description"
|
|
151
|
+
path "/api/endpoint/link.json"
|
|
152
|
+
http_method "PUT"
|
|
153
|
+
format "json"
|
|
154
|
+
|
|
155
|
+
headers do
|
|
156
|
+
add "Authorization" do
|
|
157
|
+
value "Token token=:token_value"
|
|
158
|
+
description ":token_value - is an authorization token value"
|
|
159
|
+
example { "some_data_#{Time.now.hour}" }
|
|
160
|
+
required true
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
add "X-Test" do
|
|
164
|
+
value "Test=:perform_test"
|
|
165
|
+
description ":perform_test - test boolean value"
|
|
166
|
+
example true
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
parameters do
|
|
171
|
+
query :document do
|
|
172
|
+
integer "page" do
|
|
173
|
+
description "page number"
|
|
174
|
+
required false
|
|
175
|
+
default 1
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
string "name" do
|
|
179
|
+
description "place name"
|
|
180
|
+
required true
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
float "range" do
|
|
184
|
+
description "search range in km"
|
|
185
|
+
required false
|
|
186
|
+
example { rand(100) + rand.round(2) }
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
datetime "start_at" do
|
|
190
|
+
description "start at datetime"
|
|
191
|
+
required false
|
|
192
|
+
example { Time.at(1423179337).to_s }
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
timestamp "seconds" do
|
|
196
|
+
description "seconds today"
|
|
197
|
+
example { 1423179342 }
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
array "place_ids" do
|
|
201
|
+
description "user's places ids"
|
|
202
|
+
required false
|
|
203
|
+
content do
|
|
204
|
+
integer do
|
|
205
|
+
description "hello number"
|
|
206
|
+
end
|
|
207
|
+
string do
|
|
208
|
+
description "more text here"
|
|
209
|
+
end
|
|
210
|
+
document do
|
|
211
|
+
content do
|
|
212
|
+
boolean "is_it_true" do
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
body :document do
|
|
221
|
+
document "user" do
|
|
222
|
+
description "user's parameters fields"
|
|
223
|
+
required true
|
|
224
|
+
content do
|
|
225
|
+
string "email" do
|
|
226
|
+
description "user's email value"
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
document "stats" do
|
|
230
|
+
content do
|
|
231
|
+
timestamp "login_at" do
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
integer "login_count" do
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
responses do
|
|
244
|
+
context "Success" do
|
|
245
|
+
http_status :ok # 200
|
|
246
|
+
|
|
247
|
+
parameters do
|
|
248
|
+
body :document do
|
|
249
|
+
document "user" do
|
|
250
|
+
content do
|
|
251
|
+
string "email" do
|
|
252
|
+
description "user's email value"
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
context "Failure" do
|
|
261
|
+
http_status :bad_request # 400
|
|
262
|
+
|
|
263
|
+
parameters do
|
|
264
|
+
body :document do
|
|
265
|
+
document "error" do
|
|
266
|
+
content do
|
|
267
|
+
string "message" do
|
|
268
|
+
description "Error description"
|
|
269
|
+
example { "Epic fail at your parameters" }
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
ApiSketch::DSL.new.instance_eval(&@block)
|
|
281
|
+
@resource = ApiSketch::Model::Resource.all.find { |r| r.name == "API endpoint name" }
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
it "should successfully create correct resource object" do
|
|
285
|
+
expect(@resource.name).to eql "API endpoint name"
|
|
286
|
+
expect(@resource.description).to eql "API endpoint description"
|
|
287
|
+
expect(@resource.path).to eql "/api/endpoint/link.json"
|
|
288
|
+
expect(@resource.http_method).to eql "PUT"
|
|
289
|
+
expect(@resource.format).to eql "json"
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
it "should set proper request headers" do
|
|
293
|
+
headers = @resource.headers
|
|
294
|
+
expect(headers[0].name).to eql "Authorization"
|
|
295
|
+
expect(headers[0].value).to eql "Token token=:token_value"
|
|
296
|
+
expect(headers[0].description).to eql ":token_value - is an authorization token value"
|
|
297
|
+
expect(headers[0].example).to be_instance_of(Proc)
|
|
298
|
+
expect(headers[0].example_value).to eql "some_data_#{Time.now.hour}"
|
|
299
|
+
expect(headers[0].required).to be true
|
|
300
|
+
|
|
301
|
+
expect(headers[1].name).to eql "X-Test"
|
|
302
|
+
expect(headers[1].value).to eql "Test=:perform_test"
|
|
303
|
+
expect(headers[1].description).to eql ":perform_test - test boolean value"
|
|
304
|
+
expect(headers[1].example).to eql true
|
|
305
|
+
expect(!!headers[1].required).to eql false # Here this value is nil actually
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
it "should set proper request parameters" do
|
|
309
|
+
query = @resource.parameters.query
|
|
310
|
+
|
|
311
|
+
expect(query[0].name).to eql "page"
|
|
312
|
+
expect(query[0].data_type).to eql :integer
|
|
313
|
+
expect(query[0].description).to eql "page number"
|
|
314
|
+
expect(!!query[0].required).to eql false
|
|
315
|
+
expect(query[0].default).to eql 1
|
|
316
|
+
|
|
317
|
+
expect(query[1].name).to eql "name"
|
|
318
|
+
expect(query[1].data_type).to eql :string
|
|
319
|
+
expect(query[1].description).to eql "place name"
|
|
320
|
+
expect(query[1].required).to eql true
|
|
321
|
+
|
|
322
|
+
expect(query[2].name).to eql "range"
|
|
323
|
+
expect(query[2].data_type).to eql :float
|
|
324
|
+
expect(query[2].description).to eql "search range in km"
|
|
325
|
+
expect(query[2].example_value).to be_instance_of(Float)
|
|
326
|
+
|
|
327
|
+
expect(query[3].name).to eql "start_at"
|
|
328
|
+
expect(query[3].data_type).to eql :datetime
|
|
329
|
+
expect(query[3].description).to eql "start at datetime"
|
|
330
|
+
expect(query[3].example_value).to eql Time.at(1423179337).to_s
|
|
331
|
+
|
|
332
|
+
expect(query[4].name).to eql "seconds"
|
|
333
|
+
expect(query[4].data_type).to eql :timestamp
|
|
334
|
+
expect(query[4].description).to eql "seconds today"
|
|
335
|
+
expect(query[4].example_value).to eql 1423179342
|
|
336
|
+
|
|
337
|
+
expect(query[5].name).to eql "place_ids"
|
|
338
|
+
expect(query[5].data_type).to eql :array
|
|
339
|
+
expect(query[5].description).to eql "user's places ids"
|
|
340
|
+
|
|
341
|
+
array_content = query[5].content
|
|
342
|
+
expect(array_content[0].description).to eql "hello number"
|
|
343
|
+
expect(array_content[0].data_type).to eql :integer
|
|
344
|
+
expect(array_content[1].description).to eql "more text here"
|
|
345
|
+
expect(array_content[1].data_type).to eql :string
|
|
346
|
+
document = array_content[2]
|
|
347
|
+
expect(document.data_type).to eql :document
|
|
348
|
+
expect(document.content[0].name).to eql "is_it_true"
|
|
349
|
+
expect(document.content[0].data_type).to eql :boolean
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
it "should set proper body parameters" do
|
|
353
|
+
body = @resource.parameters.body
|
|
354
|
+
expect(body[0].data_type).to eql :document
|
|
355
|
+
expect(body[0].name).to eql "user"
|
|
356
|
+
expect(body[0].description).to eql "user's parameters fields"
|
|
357
|
+
expect(body[0].required).to eql true
|
|
358
|
+
|
|
359
|
+
document_content = body[0].content
|
|
360
|
+
expect(document_content[0].data_type).to eql :string
|
|
361
|
+
expect(document_content[0].name).to eql "email"
|
|
362
|
+
expect(document_content[0].description).to eql "user's email value"
|
|
363
|
+
expect(document_content[1].data_type).to eql :document
|
|
364
|
+
expect(document_content[1].name).to eql "stats"
|
|
365
|
+
|
|
366
|
+
inner_content = document_content[1].content
|
|
367
|
+
expect(inner_content[0].name).to eql "login_at"
|
|
368
|
+
expect(inner_content[0].data_type).to eql :timestamp
|
|
369
|
+
expect(inner_content[1].name).to eql "login_count"
|
|
370
|
+
expect(inner_content[1].data_type).to eql :integer
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
it "should set proper responses" do
|
|
374
|
+
responses = @resource.responses
|
|
375
|
+
# Success
|
|
376
|
+
expect(responses[0].format).to eql "json"
|
|
377
|
+
expect(responses[0].headers).to eql []
|
|
378
|
+
expect(responses[0].http_status).to eql :ok
|
|
379
|
+
expect(responses[0].name).to eql "Success"
|
|
380
|
+
expect(responses[0].parameters.body[0].data_type).to eql :document
|
|
381
|
+
document_content = responses[0].parameters.body[0].content
|
|
382
|
+
expect(document_content[0].name).to eql "email"
|
|
383
|
+
expect(document_content[0].description).to eql "user's email value"
|
|
384
|
+
expect(document_content[0].data_type).to eql :string
|
|
385
|
+
# Bad request
|
|
386
|
+
expect(responses[1].format).to eql "json"
|
|
387
|
+
expect(responses[1].headers).to eql []
|
|
388
|
+
expect(responses[1].http_status).to eql :bad_request
|
|
389
|
+
expect(responses[1].name).to eql "Failure"
|
|
390
|
+
expect(responses[1].parameters.body[0].name).to eql "error"
|
|
391
|
+
expect(responses[1].parameters.body[0].data_type).to eql :document
|
|
392
|
+
expect(responses[1].parameters.body[0].content[0].name).to eql "message"
|
|
393
|
+
expect(responses[1].parameters.body[0].content[0].description).to eql "Error description"
|
|
394
|
+
expect(responses[1].parameters.body[0].content[0].data_type).to eql :string
|
|
395
|
+
expect(responses[1].parameters.body[0].content[0].example_value).to eql "Epic fail at your parameters"
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
context "shared_block" do
|
|
401
|
+
context "definition" do
|
|
402
|
+
before do
|
|
403
|
+
definition = Proc.new do
|
|
404
|
+
string "username" do
|
|
405
|
+
description "unique user name"
|
|
406
|
+
end
|
|
407
|
+
integer "age" do
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
@definition_block = definition
|
|
412
|
+
|
|
413
|
+
@shared_block = Proc.new do
|
|
414
|
+
shared_block("short user data", definition)
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
it "should define and save shared_block code into predefined storage" do
|
|
419
|
+
ApiSketch::DSL.new.instance_eval(&@shared_block)
|
|
420
|
+
|
|
421
|
+
expect(ApiSketch::Model::SharedBlock.find("short user data")).to eql @definition_block
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
context "when this block is predefined" do
|
|
425
|
+
before do
|
|
426
|
+
@block = lambda do
|
|
427
|
+
document do
|
|
428
|
+
content do
|
|
429
|
+
string "test_key" do
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
shared "short user data"
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
it "should call this block and put it's data in the definition" do
|
|
439
|
+
attributes = ApiSketch::DSL::Attributes.new(:array, &@block).to_a
|
|
440
|
+
attribute = attributes.first
|
|
441
|
+
expect(attribute.data_type).to eql :document
|
|
442
|
+
string_key = attribute.content.first
|
|
443
|
+
expect(string_key.data_type).to eql :string
|
|
444
|
+
expect(string_key.name).to eql "test_key"
|
|
445
|
+
|
|
446
|
+
expect(attribute.content[1].name).to eql "username"
|
|
447
|
+
expect(attribute.content[1].data_type).to eql :string
|
|
448
|
+
expect(attribute.content[2].name).to eql "age"
|
|
449
|
+
expect(attribute.content[2].data_type).to eql :integer
|
|
450
|
+
end
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
context "when this block is not defined" do
|
|
454
|
+
before do
|
|
455
|
+
@invalid_block = lambda do
|
|
456
|
+
document do
|
|
457
|
+
content do
|
|
458
|
+
string "test_key" do
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
shared "non existing shared data"
|
|
462
|
+
end
|
|
463
|
+
end
|
|
464
|
+
end
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
it "should raise error" do
|
|
468
|
+
expect { ApiSketch::Model::SharedBlock.find("non existing shared data") }.to raise_error(::ApiSketch::Error, "Shared block 'non existing shared data' is not defined")
|
|
469
|
+
end
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
end
|
|
473
|
+
end
|
|
474
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "api_sketch"
|
metadata
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: api_sketch
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Alexey Suhoviy
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: mixlib-cli
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: mixlib-config
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rack
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rack-contrib
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: bundler
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rake
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rspec
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
description: Gem provides DSL for API documentation generation and API request examples
|
|
112
|
+
server
|
|
113
|
+
email:
|
|
114
|
+
- martinsilenn@gmail.com
|
|
115
|
+
executables:
|
|
116
|
+
- api_sketch
|
|
117
|
+
extensions: []
|
|
118
|
+
extra_rdoc_files: []
|
|
119
|
+
files:
|
|
120
|
+
- ".gitignore"
|
|
121
|
+
- ".ruby-gemset"
|
|
122
|
+
- ".ruby-version"
|
|
123
|
+
- CHANGELOG.md
|
|
124
|
+
- Gemfile
|
|
125
|
+
- LICENSE.txt
|
|
126
|
+
- README.md
|
|
127
|
+
- Rakefile
|
|
128
|
+
- api_sketch.gemspec
|
|
129
|
+
- bin/api_sketch
|
|
130
|
+
- lib/api_sketch.rb
|
|
131
|
+
- lib/api_sketch/config.rb
|
|
132
|
+
- lib/api_sketch/dsl.rb
|
|
133
|
+
- lib/api_sketch/error.rb
|
|
134
|
+
- lib/api_sketch/examples_server.rb
|
|
135
|
+
- lib/api_sketch/generators.rb
|
|
136
|
+
- lib/api_sketch/helpers.rb
|
|
137
|
+
- lib/api_sketch/model.rb
|
|
138
|
+
- lib/api_sketch/renderers.rb
|
|
139
|
+
- lib/api_sketch/runner.rb
|
|
140
|
+
- lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.eot
|
|
141
|
+
- lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.svg
|
|
142
|
+
- lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.ttf
|
|
143
|
+
- lib/api_sketch/templates/bootstrap/assets/fonts/glyphicons-halflings-regular.woff
|
|
144
|
+
- lib/api_sketch/templates/bootstrap/assets/images/favicon.ico
|
|
145
|
+
- lib/api_sketch/templates/bootstrap/assets/javascripts/bootstrap.js
|
|
146
|
+
- lib/api_sketch/templates/bootstrap/assets/javascripts/bootstrap.min.js
|
|
147
|
+
- lib/api_sketch/templates/bootstrap/assets/javascripts/docs.min.js
|
|
148
|
+
- lib/api_sketch/templates/bootstrap/assets/javascripts/ie10-viewport-bug-workaround.js
|
|
149
|
+
- lib/api_sketch/templates/bootstrap/assets/javascripts/jquery-1.11.1.min.js
|
|
150
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.css
|
|
151
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.css.map
|
|
152
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap-theme.min.css
|
|
153
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.css
|
|
154
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.css.map
|
|
155
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/bootstrap.min.css
|
|
156
|
+
- lib/api_sketch/templates/bootstrap/assets/stylesheets/dashboard.css
|
|
157
|
+
- lib/api_sketch/templates/bootstrap/resource.html.erb
|
|
158
|
+
- lib/api_sketch/version.rb
|
|
159
|
+
- spec/lib/dsl_spec.rb
|
|
160
|
+
- spec/spec_helper.rb
|
|
161
|
+
homepage: https://github.com/suhovius/api_sketch
|
|
162
|
+
licenses:
|
|
163
|
+
- MIT
|
|
164
|
+
metadata: {}
|
|
165
|
+
post_install_message: Thanks for installing!
|
|
166
|
+
rdoc_options: []
|
|
167
|
+
require_paths:
|
|
168
|
+
- lib
|
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
|
+
requirements:
|
|
176
|
+
- - ">="
|
|
177
|
+
- !ruby/object:Gem::Version
|
|
178
|
+
version: '0'
|
|
179
|
+
requirements: []
|
|
180
|
+
rubyforge_project:
|
|
181
|
+
rubygems_version: 2.2.2
|
|
182
|
+
signing_key:
|
|
183
|
+
specification_version: 4
|
|
184
|
+
summary: API Prototyping and API Documentation Tool
|
|
185
|
+
test_files:
|
|
186
|
+
- spec/lib/dsl_spec.rb
|
|
187
|
+
- spec/spec_helper.rb
|