apiaryio 0.1.1 → 0.2.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.
Files changed (50) hide show
  1. data/.gitignore +34 -12
  2. data/.travis.yml +1 -0
  3. data/Rakefile +8 -0
  4. data/apiary.gemspec +5 -2
  5. data/circle.yml +4 -0
  6. data/features/fetch.feature +7 -0
  7. data/features/fixtures/apiary.apib +48 -0
  8. data/features/preview.feature +7 -0
  9. data/features/publish.feature +7 -0
  10. data/features/step_definitions/file_content_step.rb +19 -0
  11. data/features/support/env.rb +7 -0
  12. data/features/support/setup.rb +1 -0
  13. data/features/version.feature +10 -0
  14. data/lib/apiary/cli.rb +37 -74
  15. data/lib/apiary/command/fetch.rb +2 -2
  16. data/lib/apiary/command/preview.rb +16 -5
  17. data/lib/apiary/command/publish.rb +3 -2
  18. data/lib/apiary/version.rb +1 -1
  19. data/spec/cli_spec.rb +1 -1
  20. data/spec/command/fetch_spec.rb +11 -9
  21. data/spec/spec_helper.rb +7 -0
  22. data/spec/support/aruba.rb +11 -0
  23. metadata +108 -52
  24. checksums.yaml +0 -7
  25. data/doc/Apiary.html +0 -131
  26. data/doc/Apiary/CLI.html +0 -528
  27. data/doc/Apiary/Command.html +0 -117
  28. data/doc/Apiary/Command/Fetch.html +0 -652
  29. data/doc/Apiary/Command/Help.html +0 -338
  30. data/doc/Apiary/Command/Preview.html +0 -1089
  31. data/doc/Apiary/Command/Publish.html +0 -658
  32. data/doc/Apiary/Command/Runner.html +0 -200
  33. data/doc/Apiary/Command/Version.html +0 -200
  34. data/doc/_index.html +0 -214
  35. data/doc/class_list.html +0 -54
  36. data/doc/css/common.css +0 -1
  37. data/doc/css/full_list.css +0 -57
  38. data/doc/css/style.css +0 -339
  39. data/doc/file.README.html +0 -169
  40. data/doc/file_list.html +0 -56
  41. data/doc/frames.html +0 -26
  42. data/doc/index.html +0 -169
  43. data/doc/js/app.js +0 -219
  44. data/doc/js/full_list.js +0 -178
  45. data/doc/js/jquery.js +0 -4
  46. data/doc/method_list.html +0 -281
  47. data/doc/top-level-namespace.html +0 -112
  48. data/lib/apiary/command/help.rb +0 -38
  49. data/lib/apiary/command/runner.rb +0 -13
  50. data/lib/apiary/command/version.rb +0 -13
@@ -1,117 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: Apiary::Command
8
-
9
- &mdash; Documentation by YARD 0.8.7.4
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../';
20
- framesUrl = "../frames.html#!Apiary/Command.html";
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../_index.html">Index (C)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Apiary.html" title="Apiary (module)">Apiary</a></span></span>
36
- &raquo;
37
- <span class="title">Command</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: Apiary::Command
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/apiary/command/help.rb<span class="defines">,<br />
83
- lib/apiary/command/fetch.rb,<br /> lib/apiary/command/runner.rb,<br /> lib/apiary/command/preview.rb,<br /> lib/apiary/command/publish.rb,<br /> lib/apiary/command/version.rb</span>
84
- </dd>
85
-
86
- </dl>
87
- <div class="clear"></div>
88
-
89
- <h2>Defined Under Namespace</h2>
90
- <p class="children">
91
-
92
-
93
-
94
-
95
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Command/Fetch.html" title="Apiary::Command::Fetch (class)">Fetch</a></span>, <span class='object_link'><a href="Command/Help.html" title="Apiary::Command::Help (class)">Help</a></span>, <span class='object_link'><a href="Command/Preview.html" title="Apiary::Command::Preview (class)">Preview</a></span>, <span class='object_link'><a href="Command/Publish.html" title="Apiary::Command::Publish (class)">Publish</a></span>, <span class='object_link'><a href="Command/Runner.html" title="Apiary::Command::Runner (class)">Runner</a></span>, <span class='object_link'><a href="Command/Version.html" title="Apiary::Command::Version (class)">Version</a></span>
96
-
97
-
98
- </p>
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
- </div>
109
-
110
- <div id="footer">
111
- Generated on Mon May 12 13:32:43 2014 by
112
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
- 0.8.7.4 (ruby-2.0.0).
114
- </div>
115
-
116
- </body>
117
- </html>
@@ -1,652 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Class: Apiary::Command::Fetch
8
-
9
- &mdash; Documentation by YARD 0.8.7.4
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../../';
20
- framesUrl = "../../frames.html#!Apiary/Command/Fetch.html";
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../../_index.html">Index (F)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../../Apiary.html" title="Apiary (module)">Apiary</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Command.html" title="Apiary::Command (module)">Command</a></span></span>
36
- &raquo;
37
- <span class="title">Fetch</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Class: Apiary::Command::Fetch
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Object</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">Apiary::Command::Fetch</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/apiary/command/fetch.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>Retrieve blueprint from apiary</p>
106
-
107
-
108
- </div>
109
- </div>
110
- <div class="tags">
111
-
112
-
113
- </div>
114
-
115
-
116
-
117
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
118
- <ul class="summary">
119
-
120
- <li class="public ">
121
- <span class="summary_signature">
122
-
123
- <a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
124
-
125
-
126
-
127
- </span>
128
-
129
-
130
-
131
-
132
- <span class="note title readonly">readonly</span>
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- <span class="summary_desc"><div class='inline'>
143
- <p>Returns the value of attribute options.</p>
144
- </div></span>
145
-
146
- </li>
147
-
148
-
149
- </ul>
150
-
151
-
152
-
153
-
154
-
155
- <h2>
156
- Class Method Summary
157
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
158
- </h2>
159
-
160
- <ul class="summary">
161
-
162
- <li class="public ">
163
- <span class="summary_signature">
164
-
165
- <a href="#execute-class_method" title="execute (class method)">+ (Object) <strong>execute</strong>(args) </a>
166
-
167
-
168
-
169
- </span>
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
- <span class="summary_desc"><div class='inline'></div></span>
180
-
181
- </li>
182
-
183
-
184
- </ul>
185
-
186
- <h2>
187
- Instance Method Summary
188
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
189
- </h2>
190
-
191
- <ul class="summary">
192
-
193
- <li class="public ">
194
- <span class="summary_signature">
195
-
196
- <a href="#fetch_from_apiary-instance_method" title="#fetch_from_apiary (instance method)">- (Object) <strong>fetch_from_apiary</strong> </a>
197
-
198
-
199
-
200
- </span>
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
- <span class="summary_desc"><div class='inline'></div></span>
211
-
212
- </li>
213
-
214
-
215
- <li class="public ">
216
- <span class="summary_signature">
217
-
218
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Fetch) <strong>initialize</strong>(opts) </a>
219
-
220
-
221
-
222
- </span>
223
-
224
-
225
- <span class="note title constructor">constructor</span>
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
- <span class="summary_desc"><div class='inline'>
235
- <p>TODO: use OpenStruct to store @options.</p>
236
- </div></span>
237
-
238
- </li>
239
-
240
-
241
- <li class="public ">
242
- <span class="summary_signature">
243
-
244
- <a href="#path-instance_method" title="#path (instance method)">- (Object) <strong>path</strong> </a>
245
-
246
-
247
-
248
- </span>
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
- <span class="summary_desc"><div class='inline'></div></span>
259
-
260
- </li>
261
-
262
-
263
- <li class="public ">
264
- <span class="summary_signature">
265
-
266
- <a href="#query_apiary-instance_method" title="#query_apiary (instance method)">- (Object) <strong>query_apiary</strong>(host, path) </a>
267
-
268
-
269
-
270
- </span>
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
- <span class="summary_desc"><div class='inline'></div></span>
281
-
282
- </li>
283
-
284
-
285
- <li class="public ">
286
- <span class="summary_signature">
287
-
288
- <a href="#write_generated_path-instance_method" title="#write_generated_path (instance method)">- (Object) <strong>write_generated_path</strong>(data, outfile) </a>
289
-
290
-
291
-
292
- </span>
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
- <span class="summary_desc"><div class='inline'></div></span>
303
-
304
- </li>
305
-
306
-
307
- </ul>
308
-
309
-
310
- <div id="constructor_details" class="method_details_list">
311
- <h2>Constructor Details</h2>
312
-
313
- <div class="method_details first">
314
- <h3 class="signature first" id="initialize-instance_method">
315
-
316
- - (<tt><span class='object_link'><a href="" title="Apiary::Command::Fetch (class)">Fetch</a></span></tt>) <strong>initialize</strong>(opts)
317
-
318
-
319
-
320
-
321
-
322
- </h3><div class="docstring">
323
- <div class="discussion">
324
-
325
- <p>TODO: use OpenStruct to store @options</p>
326
-
327
-
328
- </div>
329
- </div>
330
- <div class="tags">
331
-
332
-
333
- </div><table class="source_code">
334
- <tr>
335
- <td>
336
- <pre class="lines">
337
-
338
-
339
- 15
340
- 16
341
- 17
342
- 18
343
- 19
344
- 20
345
- 21
346
- 22
347
- 23
348
- 24
349
- 25
350
- 26
351
- 27
352
- 28</pre>
353
- </td>
354
- <td>
355
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 15</span>
356
-
357
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
358
- <span class='ivar'>@options</span> <span class='op'>=</span> <span class='const'>OpenStruct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
359
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>apiary.apib</span><span class='tstring_end'>&quot;</span></span>
360
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_host'>api_host</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>api.apiary.io</span><span class='tstring_end'>&quot;</span></span>
361
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span> <span class='op'>||=</span> <span class='int'>8080</span>
362
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_name'>api_name</span> <span class='op'>||=</span> <span class='kw'>false</span>
363
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span> <span class='op'>||=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>APIARY_API_KEY</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
364
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_proxy'>proxy</span> <span class='op'>||=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>http_proxy</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
365
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='op'>||=</span> <span class='lbrace'>{</span>
366
- <span class='symbol'>:accept</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/html</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
367
- <span class='symbol'>:content_type</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
368
- <span class='symbol'>:authentication</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Token </span><span class='embexpr_beg'>#{</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
369
- <span class='rbrace'>}</span>
370
- <span class='kw'>end</span></pre>
371
- </td>
372
- </tr>
373
- </table>
374
- </div>
375
-
376
- </div>
377
-
378
- <div id="instance_attr_details" class="attr_details">
379
- <h2>Instance Attribute Details</h2>
380
-
381
-
382
- <span id=""></span>
383
- <div class="method_details first">
384
- <h3 class="signature first" id="options-instance_method">
385
-
386
- - (<tt>Object</tt>) <strong>options</strong> <span class="extras">(readonly)</span>
387
-
388
-
389
-
390
-
391
-
392
- </h3><div class="docstring">
393
- <div class="discussion">
394
-
395
- <p>Returns the value of attribute options</p>
396
-
397
-
398
- </div>
399
- </div>
400
- <div class="tags">
401
-
402
-
403
- </div><table class="source_code">
404
- <tr>
405
- <td>
406
- <pre class="lines">
407
-
408
-
409
- 12
410
- 13
411
- 14</pre>
412
- </td>
413
- <td>
414
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 12</span>
415
-
416
- <span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
417
- <span class='ivar'>@options</span>
418
- <span class='kw'>end</span></pre>
419
- </td>
420
- </tr>
421
- </table>
422
- </div>
423
-
424
- </div>
425
-
426
-
427
- <div id="class_method_details" class="method_details_list">
428
- <h2>Class Method Details</h2>
429
-
430
-
431
- <div class="method_details first">
432
- <h3 class="signature first" id="execute-class_method">
433
-
434
- + (<tt>Object</tt>) <strong>execute</strong>(args)
435
-
436
-
437
-
438
-
439
-
440
- </h3><table class="source_code">
441
- <tr>
442
- <td>
443
- <pre class="lines">
444
-
445
-
446
- 30
447
- 31
448
- 32
449
- 33
450
- 34
451
- 35</pre>
452
- </td>
453
- <td>
454
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 30</span>
455
-
456
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
457
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_fetch_from_apiary'>fetch_from_apiary</span>
458
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span> <span class='const'>String</span>
459
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_response'>response</span>
460
- <span class='kw'>end</span>
461
- <span class='kw'>end</span></pre>
462
- </td>
463
- </tr>
464
- </table>
465
- </div>
466
-
467
- </div>
468
-
469
- <div id="instance_method_details" class="method_details_list">
470
- <h2>Instance Method Details</h2>
471
-
472
-
473
- <div class="method_details first">
474
- <h3 class="signature first" id="fetch_from_apiary-instance_method">
475
-
476
- - (<tt>Object</tt>) <strong>fetch_from_apiary</strong>
477
-
478
-
479
-
480
-
481
-
482
- </h3><table class="source_code">
483
- <tr>
484
- <td>
485
- <pre class="lines">
486
-
487
-
488
- 37
489
- 38
490
- 39
491
- 40
492
- 41
493
- 42
494
- 43
495
- 44
496
- 45
497
- 46
498
- 47
499
- 48
500
- 49
501
- 50
502
- 51
503
- 52</pre>
504
- </td>
505
- <td>
506
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 37</span>
507
-
508
- <span class='kw'>def</span> <span class='id identifier rubyid_fetch_from_apiary'>fetch_from_apiary</span>
509
- <span class='kw'>unless</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_name'>api_name</span>
510
- <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please provide an api-name option (subdomain part from your http://docs.&lt;api-name&gt;.apiary.io/)</span><span class='tstring_end'>&quot;</span></span>
511
- <span class='kw'>end</span>
512
-
513
- <span class='kw'>unless</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span>
514
- <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>API key must be provided through environment variable APIARY_API_KEY. Please go to https://login.apiary.io/tokens to obtain it.</span><span class='tstring_end'>&quot;</span></span>
515
- <span class='kw'>end</span>
516
-
517
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_query_apiary'>query_apiary</span><span class='lparen'>(</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_host'>api_host</span><span class='comma'>,</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
518
- <span class='kw'>unless</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_output'>output</span>
519
- <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>code</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
520
- <span class='kw'>else</span>
521
- <span class='id identifier rubyid_write_generated_path'>write_generated_path</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>code</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
522
- <span class='kw'>end</span>
523
- <span class='kw'>end</span></pre>
524
- </td>
525
- </tr>
526
- </table>
527
- </div>
528
-
529
- <div class="method_details ">
530
- <h3 class="signature " id="path-instance_method">
531
-
532
- - (<tt>Object</tt>) <strong>path</strong>
533
-
534
-
535
-
536
-
537
-
538
- </h3><table class="source_code">
539
- <tr>
540
- <td>
541
- <pre class="lines">
542
-
543
-
544
- 54
545
- 55
546
- 56</pre>
547
- </td>
548
- <td>
549
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 54</span>
550
-
551
- <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
552
- <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>.apib</span><span class='tstring_end'>&quot;</span></span>
553
- <span class='kw'>end</span></pre>
554
- </td>
555
- </tr>
556
- </table>
557
- </div>
558
-
559
- <div class="method_details ">
560
- <h3 class="signature " id="query_apiary-instance_method">
561
-
562
- - (<tt>Object</tt>) <strong>query_apiary</strong>(host, path)
563
-
564
-
565
-
566
-
567
-
568
- </h3><table class="source_code">
569
- <tr>
570
- <td>
571
- <pre class="lines">
572
-
573
-
574
- 58
575
- 59
576
- 60
577
- 61
578
- 62
579
- 63
580
- 64
581
- 65
582
- 66
583
- 67
584
- 68
585
- 69</pre>
586
- </td>
587
- <td>
588
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 58</span>
589
-
590
- <span class='kw'>def</span> <span class='id identifier rubyid_query_apiary'>query_apiary</span><span class='lparen'>(</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
591
- <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_host'>host</span><span class='embexpr_end'>}</span><span class='tstring_content'>/blueprint/get/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_api_name'>api_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
592
- <span class='const'>RestClient</span><span class='period'>.</span><span class='id identifier rubyid_proxy'>proxy</span> <span class='op'>=</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_proxy'>proxy</span>
593
-
594
- <span class='kw'>begin</span>
595
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>RestClient</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span>
596
- <span class='kw'>rescue</span> <span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
597
- <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Apiary service responded with an error: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
598
- <span class='kw'>end</span>
599
-
600
- <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
601
- <span class='kw'>end</span></pre>
602
- </td>
603
- </tr>
604
- </table>
605
- </div>
606
-
607
- <div class="method_details ">
608
- <h3 class="signature " id="write_generated_path-instance_method">
609
-
610
- - (<tt>Object</tt>) <strong>write_generated_path</strong>(data, outfile)
611
-
612
-
613
-
614
-
615
-
616
- </h3><table class="source_code">
617
- <tr>
618
- <td>
619
- <pre class="lines">
620
-
621
-
622
- 71
623
- 72
624
- 73
625
- 74
626
- 75</pre>
627
- </td>
628
- <td>
629
- <pre class="code"><span class="info file"># File 'lib/apiary/command/fetch.rb', line 71</span>
630
-
631
- <span class='kw'>def</span> <span class='id identifier rubyid_write_generated_path'>write_generated_path</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_outfile'>outfile</span><span class='rparen'>)</span>
632
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_outfile'>outfile</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span>
633
- <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
634
- <span class='kw'>end</span>
635
- <span class='kw'>end</span></pre>
636
- </td>
637
- </tr>
638
- </table>
639
- </div>
640
-
641
- </div>
642
-
643
- </div>
644
-
645
- <div id="footer">
646
- Generated on Mon May 12 13:32:43 2014 by
647
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
648
- 0.8.7.4 (ruby-2.0.0).
649
- </div>
650
-
651
- </body>
652
- </html>