apiaryio 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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
data/doc/Apiary/CLI.html DELETED
@@ -1,528 +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::CLI
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/CLI.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">CLI</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::CLI
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::CLI</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/cli.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
-
103
-
104
-
105
-
106
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
- <ul class="summary">
108
-
109
- <li class="public ">
110
- <span class="summary_signature">
111
-
112
- <a href="#command-instance_method" title="#command (instance method)">- (Object) <strong>command</strong> </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
- <span class="note title readonly">readonly</span>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <span class="summary_desc"><div class='inline'>
132
- <p>Returns the value of attribute command.</p>
133
- </div></span>
134
-
135
- </li>
136
-
137
-
138
- </ul>
139
-
140
-
141
-
142
-
143
-
144
- <h2>
145
- Instance Method Summary
146
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
147
- </h2>
148
-
149
- <ul class="summary">
150
-
151
- <li class="public ">
152
- <span class="summary_signature">
153
-
154
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (CLI) <strong>initialize</strong>(args) </a>
155
-
156
-
157
-
158
- </span>
159
-
160
-
161
- <span class="note title constructor">constructor</span>
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
- <span class="summary_desc"><div class='inline'>
171
- <p>A new instance of CLI.</p>
172
- </div></span>
173
-
174
- </li>
175
-
176
-
177
- <li class="public ">
178
- <span class="summary_signature">
179
-
180
- <a href="#parse_options%21-instance_method" title="#parse_options! (instance method)">- (Object) <strong>parse_options!</strong>(args) </a>
181
-
182
-
183
-
184
- </span>
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
- <span class="summary_desc"><div class='inline'></div></span>
195
-
196
- </li>
197
-
198
-
199
- <li class="public ">
200
- <span class="summary_signature">
201
-
202
- <a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong>(options) </a>
203
-
204
-
205
-
206
- </span>
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- <span class="summary_desc"><div class='inline'></div></span>
217
-
218
- </li>
219
-
220
-
221
- </ul>
222
-
223
-
224
- <div id="constructor_details" class="method_details_list">
225
- <h2>Constructor Details</h2>
226
-
227
- <div class="method_details first">
228
- <h3 class="signature first" id="initialize-instance_method">
229
-
230
- - (<tt><span class='object_link'><a href="" title="Apiary::CLI (class)">CLI</a></span></tt>) <strong>initialize</strong>(args)
231
-
232
-
233
-
234
-
235
-
236
- </h3><div class="docstring">
237
- <div class="discussion">
238
-
239
- <p>Returns a new instance of CLI</p>
240
-
241
-
242
- </div>
243
- </div>
244
- <div class="tags">
245
-
246
-
247
- </div><table class="source_code">
248
- <tr>
249
- <td>
250
- <pre class="lines">
251
-
252
-
253
- 8
254
- 9
255
- 10
256
- 11
257
- 12</pre>
258
- </td>
259
- <td>
260
- <pre class="code"><span class="info file"># File 'lib/apiary/cli.rb', line 8</span>
261
-
262
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
263
- <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_options!'>parse_options!</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
264
- <span class='ivar'>@command</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:command</span><span class='rparen'>)</span>
265
- <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
266
- <span class='kw'>end</span></pre>
267
- </td>
268
- </tr>
269
- </table>
270
- </div>
271
-
272
- </div>
273
-
274
- <div id="instance_attr_details" class="attr_details">
275
- <h2>Instance Attribute Details</h2>
276
-
277
-
278
- <span id=""></span>
279
- <div class="method_details first">
280
- <h3 class="signature first" id="command-instance_method">
281
-
282
- - (<tt>Object</tt>) <strong>command</strong> <span class="extras">(readonly)</span>
283
-
284
-
285
-
286
-
287
-
288
- </h3><div class="docstring">
289
- <div class="discussion">
290
-
291
- <p>Returns the value of attribute command</p>
292
-
293
-
294
- </div>
295
- </div>
296
- <div class="tags">
297
-
298
-
299
- </div><table class="source_code">
300
- <tr>
301
- <td>
302
- <pre class="lines">
303
-
304
-
305
- 6
306
- 7
307
- 8</pre>
308
- </td>
309
- <td>
310
- <pre class="code"><span class="info file"># File 'lib/apiary/cli.rb', line 6</span>
311
-
312
- <span class='kw'>def</span> <span class='id identifier rubyid_command'>command</span>
313
- <span class='ivar'>@command</span>
314
- <span class='kw'>end</span></pre>
315
- </td>
316
- </tr>
317
- </table>
318
- </div>
319
-
320
- </div>
321
-
322
-
323
- <div id="instance_method_details" class="method_details_list">
324
- <h2>Instance Method Details</h2>
325
-
326
-
327
- <div class="method_details first">
328
- <h3 class="signature first" id="parse_options!-instance_method">
329
-
330
- - (<tt>Object</tt>) <strong>parse_options!</strong>(args)
331
-
332
-
333
-
334
-
335
-
336
- </h3><table class="source_code">
337
- <tr>
338
- <td>
339
- <pre class="lines">
340
-
341
-
342
- 18
343
- 19
344
- 20
345
- 21
346
- 22
347
- 23
348
- 24
349
- 25
350
- 26
351
- 27
352
- 28
353
- 29
354
- 30
355
- 31
356
- 32
357
- 33
358
- 34
359
- 35
360
- 36
361
- 37
362
- 38
363
- 39
364
- 40
365
- 41
366
- 42
367
- 43
368
- 44
369
- 45
370
- 46
371
- 47
372
- 48
373
- 49
374
- 50
375
- 51
376
- 52
377
- 53
378
- 54
379
- 55
380
- 56
381
- 57
382
- 58
383
- 59
384
- 60
385
- 61
386
- 62
387
- 63
388
- 64
389
- 65
390
- 66
391
- 67
392
- 68
393
- 69
394
- 70
395
- 71
396
- 72
397
- 73
398
- 74
399
- 75
400
- 76
401
- 77
402
- 78
403
- 79
404
- 80
405
- 81
406
- 82
407
- 83
408
- 84
409
- 85</pre>
410
- </td>
411
- <td>
412
- <pre class="code"><span class="info file"># File 'lib/apiary/cli.rb', line 18</span>
413
-
414
- <span class='kw'>def</span> <span class='id identifier rubyid_parse_options!'>parse_options!</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
415
- <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
416
- <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='kw'>nil</span>
417
- <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
418
- <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
419
- <span class='kw'>end</span>
420
-
421
- <span class='id identifier rubyid_options_parser'>options_parser</span> <span class='op'>=</span> <span class='const'>OptionParser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_opts'>opts</span><span class='op'>|</span>
422
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--path [PATH]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
423
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fetch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>publish</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_command'>command</span>
424
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
425
- <span class='kw'>end</span>
426
-
427
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--output [PATH]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
428
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fetch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_command'>command</span>
429
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:output</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
430
- <span class='kw'>end</span>
431
-
432
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--api_host API_HOST</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_api_host'>api_host</span><span class='op'>|</span>
433
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fetch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>publish</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_command'>command</span>
434
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:api_host</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_api_host'>api_host</span>
435
- <span class='kw'>end</span>
436
-
437
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--api-name API_HOST</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_api_name'>api_name</span><span class='op'>|</span>
438
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fetch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>publish</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_command'>command</span>
439
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:api_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_api_name'>api_name</span>
440
- <span class='kw'>end</span>
441
-
442
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--message COMMIT_MESSAGE</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_commit_message'>commit_message</span><span class='op'>|</span>
443
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>publish</span><span class='tstring_end'>&quot;</span></span>
444
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:commit_message</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_commit_message'>commit_message</span>
445
- <span class='kw'>end</span>
446
-
447
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--browser BROWSER</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_browser'>browser</span><span class='op'>|</span>
448
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span>
449
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:browser</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_browser'>browser</span>
450
- <span class='kw'>end</span>
451
-
452
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--server</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
453
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span>
454
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:server</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
455
- <span class='kw'>end</span>
456
-
457
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--port [PORT]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_port'>port</span><span class='op'>|</span>
458
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fetch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>preview</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>publish</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_command'>command</span>
459
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:port</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_port'>port</span>
460
- <span class='kw'>end</span>
461
-
462
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-v</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--version</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
463
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span>
464
- <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='symbol'>:version</span>
465
- <span class='kw'>end</span>
466
-
467
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-h</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--help</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
468
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span>
469
- <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='symbol'>:help</span>
470
- <span class='kw'>end</span>
471
- <span class='kw'>end</span>
472
-
473
- <span class='id identifier rubyid_options_parser'>options_parser</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span>
474
- <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:command</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>||</span> <span class='symbol'>:help</span>
475
- <span class='id identifier rubyid_options'>options</span>
476
-
477
- <span class='kw'>rescue</span> <span class='const'>OptionParser</span><span class='op'>::</span><span class='const'>InvalidOption</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
478
- <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_e'>e</span>
479
- <span class='id identifier rubyid_puts'>puts</span> <span class='const'>Apiary</span><span class='op'>::</span><span class='const'>Command</span><span class='op'>::</span><span class='const'>Help</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span>
480
- <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span>
481
- <span class='kw'>end</span></pre>
482
- </td>
483
- </tr>
484
- </table>
485
- </div>
486
-
487
- <div class="method_details ">
488
- <h3 class="signature " id="run-instance_method">
489
-
490
- - (<tt>Object</tt>) <strong>run</strong>(options)
491
-
492
-
493
-
494
-
495
-
496
- </h3><table class="source_code">
497
- <tr>
498
- <td>
499
- <pre class="lines">
500
-
501
-
502
- 14
503
- 15
504
- 16</pre>
505
- </td>
506
- <td>
507
- <pre class="code"><span class="info file"># File 'lib/apiary/cli.rb', line 14</span>
508
-
509
- <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
510
- <span class='const'>Apiary</span><span class='op'>::</span><span class='const'>Command</span><span class='op'>::</span><span class='const'>Runner</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='ivar'>@command</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
511
- <span class='kw'>end</span></pre>
512
- </td>
513
- </tr>
514
- </table>
515
- </div>
516
-
517
- </div>
518
-
519
- </div>
520
-
521
- <div id="footer">
522
- Generated on Mon May 12 13:32:43 2014 by
523
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
524
- 0.8.7.4 (ruby-2.0.0).
525
- </div>
526
-
527
- </body>
528
- </html>