apiaryio 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +34 -12
- data/.travis.yml +1 -0
- data/Rakefile +8 -0
- data/apiary.gemspec +5 -2
- data/circle.yml +4 -0
- data/features/fetch.feature +7 -0
- data/features/fixtures/apiary.apib +48 -0
- data/features/preview.feature +7 -0
- data/features/publish.feature +7 -0
- data/features/step_definitions/file_content_step.rb +19 -0
- data/features/support/env.rb +7 -0
- data/features/support/setup.rb +1 -0
- data/features/version.feature +10 -0
- data/lib/apiary/cli.rb +37 -74
- data/lib/apiary/command/fetch.rb +2 -2
- data/lib/apiary/command/preview.rb +16 -5
- data/lib/apiary/command/publish.rb +3 -2
- data/lib/apiary/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- data/spec/command/fetch_spec.rb +11 -9
- data/spec/spec_helper.rb +7 -0
- data/spec/support/aruba.rb +11 -0
- metadata +108 -52
- checksums.yaml +0 -7
- data/doc/Apiary.html +0 -131
- data/doc/Apiary/CLI.html +0 -528
- data/doc/Apiary/Command.html +0 -117
- data/doc/Apiary/Command/Fetch.html +0 -652
- data/doc/Apiary/Command/Help.html +0 -338
- data/doc/Apiary/Command/Preview.html +0 -1089
- data/doc/Apiary/Command/Publish.html +0 -658
- data/doc/Apiary/Command/Runner.html +0 -200
- data/doc/Apiary/Command/Version.html +0 -200
- data/doc/_index.html +0 -214
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file.README.html +0 -169
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -169
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -281
- data/doc/top-level-namespace.html +0 -112
- data/lib/apiary/command/help.rb +0 -38
- data/lib/apiary/command/runner.rb +0 -13
- data/lib/apiary/command/version.rb +0 -13
@@ -1,338 +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::Help
|
8
|
-
|
9
|
-
— 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/Help.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 (H)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Apiary.html" title="Apiary (module)">Apiary</a></span></span> » <span class='title'><span class='object_link'><a href="../Command.html" title="Apiary::Command (module)">Command</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">Help</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::Help
|
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::Help</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/help.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>Display help</p>
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
|
112
|
-
|
113
|
-
</div>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
<h2>
|
122
|
-
Class Method Summary
|
123
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
124
|
-
</h2>
|
125
|
-
|
126
|
-
<ul class="summary">
|
127
|
-
|
128
|
-
<li class="public ">
|
129
|
-
<span class="summary_signature">
|
130
|
-
|
131
|
-
<a href="#banner-class_method" title="banner (class method)">+ (Object) <strong>banner</strong> </a>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
</span>
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
146
|
-
|
147
|
-
</li>
|
148
|
-
|
149
|
-
|
150
|
-
<li class="public ">
|
151
|
-
<span class="summary_signature">
|
152
|
-
|
153
|
-
<a href="#commands-class_method" title="commands (class method)">+ (Object) <strong>commands</strong> </a>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
</span>
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
168
|
-
|
169
|
-
</li>
|
170
|
-
|
171
|
-
|
172
|
-
<li class="public ">
|
173
|
-
<span class="summary_signature">
|
174
|
-
|
175
|
-
<a href="#execute-class_method" title="execute (class method)">+ (Object) <strong>execute</strong>(options) </a>
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
</span>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
190
|
-
|
191
|
-
</li>
|
192
|
-
|
193
|
-
|
194
|
-
</ul>
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
<div id="class_method_details" class="method_details_list">
|
200
|
-
<h2>Class Method Details</h2>
|
201
|
-
|
202
|
-
|
203
|
-
<div class="method_details first">
|
204
|
-
<h3 class="signature first" id="banner-class_method">
|
205
|
-
|
206
|
-
+ (<tt>Object</tt>) <strong>banner</strong>
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
</h3><table class="source_code">
|
213
|
-
<tr>
|
214
|
-
<td>
|
215
|
-
<pre class="lines">
|
216
|
-
|
217
|
-
|
218
|
-
12
|
219
|
-
13
|
220
|
-
14
|
221
|
-
15</pre>
|
222
|
-
</td>
|
223
|
-
<td>
|
224
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/help.rb', line 12</span>
|
225
|
-
|
226
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span>
|
227
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\nUsage: apiary command [options]</span><span class='tstring_end'>"</span></span>
|
228
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Try 'apiary help' for more information.</span><span class='tstring_end'>"</span></span>
|
229
|
-
<span class='kw'>end</span></pre>
|
230
|
-
</td>
|
231
|
-
</tr>
|
232
|
-
</table>
|
233
|
-
</div>
|
234
|
-
|
235
|
-
<div class="method_details ">
|
236
|
-
<h3 class="signature " id="commands-class_method">
|
237
|
-
|
238
|
-
+ (<tt>Object</tt>) <strong>commands</strong>
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
</h3><table class="source_code">
|
245
|
-
<tr>
|
246
|
-
<td>
|
247
|
-
<pre class="lines">
|
248
|
-
|
249
|
-
|
250
|
-
17
|
251
|
-
18
|
252
|
-
19
|
253
|
-
20
|
254
|
-
21
|
255
|
-
22
|
256
|
-
23
|
257
|
-
24
|
258
|
-
25
|
259
|
-
26
|
260
|
-
27
|
261
|
-
28
|
262
|
-
29
|
263
|
-
30
|
264
|
-
31
|
265
|
-
32
|
266
|
-
33
|
267
|
-
34</pre>
|
268
|
-
</td>
|
269
|
-
<td>
|
270
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/help.rb', line 17</span>
|
271
|
-
|
272
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_commands'>commands</span>
|
273
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\nCurrently available apiary commands are:\n\n</span><span class='tstring_end'>"</span></span>
|
274
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview Show API documentation in default browser</span><span class='tstring_end'>"</span></span>
|
275
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --browser [chrome|safari|firefox] Show API documentation in specified browser</span><span class='tstring_end'>"</span></span>
|
276
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --output [FILE] Write generated HTML into specified file</span><span class='tstring_end'>"</span></span>
|
277
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --path [PATH] Specify path to blueprint file</span><span class='tstring_end'>"</span></span>
|
278
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --api_host [HOST] Specify apiary host</span><span class='tstring_end'>"</span></span>
|
279
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --server Start standalone web server on port 8080</span><span class='tstring_end'>"</span></span>
|
280
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpreview --server --port [PORT] Start standalone web server on specified port</span><span class='tstring_end'>"</span></span>
|
281
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpublish --api-name [API_NAME] Publish apiary.apib on docs.API_NAME.apiary.io</span><span class='tstring_end'>"</span></span>
|
282
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tpublish --api-name [API_NAME] \\</span><span class='tstring_end'>"</span></span>
|
283
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\t --message [COMMIT_MESSAGE] Publish with custom commit message</span><span class='tstring_end'>"</span></span>
|
284
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tfetch --api-name [API_NAME] Fetch apiary.apib from API_NAME.apiary.io</span><span class='tstring_end'>"</span></span>
|
285
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
286
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\thelp Show this help</span><span class='tstring_end'>"</span></span>
|
287
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tversion Show version</span><span class='tstring_end'>"</span></span>
|
288
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
289
|
-
<span class='kw'>end</span></pre>
|
290
|
-
</td>
|
291
|
-
</tr>
|
292
|
-
</table>
|
293
|
-
</div>
|
294
|
-
|
295
|
-
<div class="method_details ">
|
296
|
-
<h3 class="signature " id="execute-class_method">
|
297
|
-
|
298
|
-
+ (<tt>Object</tt>) <strong>execute</strong>(options)
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
</h3><table class="source_code">
|
305
|
-
<tr>
|
306
|
-
<td>
|
307
|
-
<pre class="lines">
|
308
|
-
|
309
|
-
|
310
|
-
7
|
311
|
-
8
|
312
|
-
9
|
313
|
-
10</pre>
|
314
|
-
</td>
|
315
|
-
<td>
|
316
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/help.rb', line 7</span>
|
317
|
-
|
318
|
-
<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_options'>options</span><span class='rparen'>)</span>
|
319
|
-
<span class='id identifier rubyid_banner'>banner</span>
|
320
|
-
<span class='id identifier rubyid_commands'>commands</span>
|
321
|
-
<span class='kw'>end</span></pre>
|
322
|
-
</td>
|
323
|
-
</tr>
|
324
|
-
</table>
|
325
|
-
</div>
|
326
|
-
|
327
|
-
</div>
|
328
|
-
|
329
|
-
</div>
|
330
|
-
|
331
|
-
<div id="footer">
|
332
|
-
Generated on Mon May 12 13:32:43 2014 by
|
333
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
334
|
-
0.8.7.4 (ruby-2.0.0).
|
335
|
-
</div>
|
336
|
-
|
337
|
-
</body>
|
338
|
-
</html>
|
@@ -1,1089 +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::Preview
|
8
|
-
|
9
|
-
— 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/Preview.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 (P)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Apiary.html" title="Apiary (module)">Apiary</a></span></span> » <span class='title'><span class='object_link'><a href="../Command.html" title="Apiary::Command (module)">Command</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">Preview</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::Preview
|
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::Preview</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/preview.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>Display preview of local blueprint file</p>
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
|
112
|
-
|
113
|
-
</div>
|
114
|
-
<h2>Constant Summary</h2>
|
115
|
-
|
116
|
-
<dl class="constants">
|
117
|
-
|
118
|
-
<dt id="BROWSERS-constant" class="">BROWSERS =
|
119
|
-
|
120
|
-
</dt>
|
121
|
-
<dd><pre class="code"><span class='lbrace'>{</span>
|
122
|
-
<span class='symbol'>:safari</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Safari</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
123
|
-
<span class='symbol'>:chrome</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Google Chrome</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
124
|
-
<span class='symbol'>:firefox</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Firefox</span><span class='tstring_end'>"</span></span>
|
125
|
-
<span class='rbrace'>}</span></pre></dd>
|
126
|
-
|
127
|
-
</dl>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
134
|
-
<ul class="summary">
|
135
|
-
|
136
|
-
<li class="public ">
|
137
|
-
<span class="summary_signature">
|
138
|
-
|
139
|
-
<a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
</span>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
<span class="note title readonly">readonly</span>
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
<span class="summary_desc"><div class='inline'>
|
159
|
-
<p>Returns the value of attribute options.</p>
|
160
|
-
</div></span>
|
161
|
-
|
162
|
-
</li>
|
163
|
-
|
164
|
-
|
165
|
-
</ul>
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<h2>
|
172
|
-
Class Method Summary
|
173
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
174
|
-
</h2>
|
175
|
-
|
176
|
-
<ul class="summary">
|
177
|
-
|
178
|
-
<li class="public ">
|
179
|
-
<span class="summary_signature">
|
180
|
-
|
181
|
-
<a href="#execute-class_method" title="execute (class method)">+ (Object) <strong>execute</strong>(args) </a>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</span>
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
196
|
-
|
197
|
-
</li>
|
198
|
-
|
199
|
-
|
200
|
-
</ul>
|
201
|
-
|
202
|
-
<h2>
|
203
|
-
Instance Method Summary
|
204
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
205
|
-
</h2>
|
206
|
-
|
207
|
-
<ul class="summary">
|
208
|
-
|
209
|
-
<li class="public ">
|
210
|
-
<span class="summary_signature">
|
211
|
-
|
212
|
-
<a href="#browser-instance_method" title="#browser (instance method)">- (Object) <strong>browser</strong> </a>
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
</span>
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
227
|
-
|
228
|
-
</li>
|
229
|
-
|
230
|
-
|
231
|
-
<li class="public ">
|
232
|
-
<span class="summary_signature">
|
233
|
-
|
234
|
-
<a href="#generate_static-instance_method" title="#generate_static (instance method)">- (Object) <strong>generate_static</strong>(path) </a>
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
</span>
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
249
|
-
|
250
|
-
</li>
|
251
|
-
|
252
|
-
|
253
|
-
<li class="public ">
|
254
|
-
<span class="summary_signature">
|
255
|
-
|
256
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Preview) <strong>initialize</strong>(opts) </a>
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
</span>
|
261
|
-
|
262
|
-
|
263
|
-
<span class="note title constructor">constructor</span>
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
<span class="summary_desc"><div class='inline'>
|
273
|
-
<p>TODO: use OpenStruct to store @options.</p>
|
274
|
-
</div></span>
|
275
|
-
|
276
|
-
</li>
|
277
|
-
|
278
|
-
|
279
|
-
<li class="public ">
|
280
|
-
<span class="summary_signature">
|
281
|
-
|
282
|
-
<a href="#open_generated_page-instance_method" title="#open_generated_page (instance method)">- (Object) <strong>open_generated_page</strong>(path) </a>
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
</span>
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
<span class="summary_desc"><div class='inline'>
|
297
|
-
<p>TODO: add linux and windows systems.</p>
|
298
|
-
</div></span>
|
299
|
-
|
300
|
-
</li>
|
301
|
-
|
302
|
-
|
303
|
-
<li class="public ">
|
304
|
-
<span class="summary_signature">
|
305
|
-
|
306
|
-
<a href="#path-instance_method" title="#path (instance method)">- (Object) <strong>path</strong> </a>
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
</span>
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
321
|
-
|
322
|
-
</li>
|
323
|
-
|
324
|
-
|
325
|
-
<li class="public ">
|
326
|
-
<span class="summary_signature">
|
327
|
-
|
328
|
-
<a href="#preview_path-instance_method" title="#preview_path (instance method)">- (Object) <strong>preview_path</strong>(path) </a>
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
</span>
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
343
|
-
|
344
|
-
</li>
|
345
|
-
|
346
|
-
|
347
|
-
<li class="public ">
|
348
|
-
<span class="summary_signature">
|
349
|
-
|
350
|
-
<a href="#query_apiary-instance_method" title="#query_apiary (instance method)">- (Object) <strong>query_apiary</strong>(host, path) </a>
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
</span>
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
365
|
-
|
366
|
-
</li>
|
367
|
-
|
368
|
-
|
369
|
-
<li class="public ">
|
370
|
-
<span class="summary_signature">
|
371
|
-
|
372
|
-
<a href="#rack_app-instance_method" title="#rack_app (instance method)">- (Object) <strong>rack_app</strong>(&block) </a>
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
</span>
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
387
|
-
|
388
|
-
</li>
|
389
|
-
|
390
|
-
|
391
|
-
<li class="public ">
|
392
|
-
<span class="summary_signature">
|
393
|
-
|
394
|
-
<a href="#run_server-instance_method" title="#run_server (instance method)">- (Object) <strong>run_server</strong> </a>
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
</span>
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
409
|
-
|
410
|
-
</li>
|
411
|
-
|
412
|
-
|
413
|
-
<li class="public ">
|
414
|
-
<span class="summary_signature">
|
415
|
-
|
416
|
-
<a href="#server-instance_method" title="#server (instance method)">- (Object) <strong>server</strong> </a>
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
</span>
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
431
|
-
|
432
|
-
</li>
|
433
|
-
|
434
|
-
|
435
|
-
<li class="public ">
|
436
|
-
<span class="summary_signature">
|
437
|
-
|
438
|
-
<a href="#show-instance_method" title="#show (instance method)">- (Object) <strong>show</strong> </a>
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
</span>
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
453
|
-
|
454
|
-
</li>
|
455
|
-
|
456
|
-
|
457
|
-
<li class="public ">
|
458
|
-
<span class="summary_signature">
|
459
|
-
|
460
|
-
<a href="#validate_apib_file-instance_method" title="#validate_apib_file (instance method)">- (Object) <strong>validate_apib_file</strong>(apib_file) </a>
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
</span>
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
475
|
-
|
476
|
-
</li>
|
477
|
-
|
478
|
-
|
479
|
-
<li class="public ">
|
480
|
-
<span class="summary_signature">
|
481
|
-
|
482
|
-
<a href="#write_generated_path-instance_method" title="#write_generated_path (instance method)">- (Object) <strong>write_generated_path</strong>(path, outfile) </a>
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
</span>
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
497
|
-
|
498
|
-
</li>
|
499
|
-
|
500
|
-
|
501
|
-
</ul>
|
502
|
-
|
503
|
-
|
504
|
-
<div id="constructor_details" class="method_details_list">
|
505
|
-
<h2>Constructor Details</h2>
|
506
|
-
|
507
|
-
<div class="method_details first">
|
508
|
-
<h3 class="signature first" id="initialize-instance_method">
|
509
|
-
|
510
|
-
- (<tt><span class='object_link'><a href="" title="Apiary::Command::Preview (class)">Preview</a></span></tt>) <strong>initialize</strong>(opts)
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
</h3><div class="docstring">
|
517
|
-
<div class="discussion">
|
518
|
-
|
519
|
-
<p>TODO: use OpenStruct to store @options</p>
|
520
|
-
|
521
|
-
|
522
|
-
</div>
|
523
|
-
</div>
|
524
|
-
<div class="tags">
|
525
|
-
|
526
|
-
|
527
|
-
</div><table class="source_code">
|
528
|
-
<tr>
|
529
|
-
<td>
|
530
|
-
<pre class="lines">
|
531
|
-
|
532
|
-
|
533
|
-
21
|
534
|
-
22
|
535
|
-
23
|
536
|
-
24
|
537
|
-
25
|
538
|
-
26
|
539
|
-
27
|
540
|
-
28</pre>
|
541
|
-
</td>
|
542
|
-
<td>
|
543
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 21</span>
|
544
|
-
|
545
|
-
<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>
|
546
|
-
<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>
|
547
|
-
<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'>"</span><span class='tstring_content'>apiary.apib</span><span class='tstring_end'>"</span></span>
|
548
|
-
<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'>"</span><span class='tstring_content'>api.apiary.io</span><span class='tstring_end'>"</span></span>
|
549
|
-
<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><span class='symbol'>:accept</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>text/html</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:content_type</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
550
|
-
<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>
|
551
|
-
<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'>'</span><span class='tstring_content'>http_proxy</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
552
|
-
<span class='kw'>end</span></pre>
|
553
|
-
</td>
|
554
|
-
</tr>
|
555
|
-
</table>
|
556
|
-
</div>
|
557
|
-
|
558
|
-
</div>
|
559
|
-
|
560
|
-
<div id="instance_attr_details" class="attr_details">
|
561
|
-
<h2>Instance Attribute Details</h2>
|
562
|
-
|
563
|
-
|
564
|
-
<span id=""></span>
|
565
|
-
<div class="method_details first">
|
566
|
-
<h3 class="signature first" id="options-instance_method">
|
567
|
-
|
568
|
-
- (<tt>Object</tt>) <strong>options</strong> <span class="extras">(readonly)</span>
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
</h3><div class="docstring">
|
575
|
-
<div class="discussion">
|
576
|
-
|
577
|
-
<p>Returns the value of attribute options</p>
|
578
|
-
|
579
|
-
|
580
|
-
</div>
|
581
|
-
</div>
|
582
|
-
<div class="tags">
|
583
|
-
|
584
|
-
|
585
|
-
</div><table class="source_code">
|
586
|
-
<tr>
|
587
|
-
<td>
|
588
|
-
<pre class="lines">
|
589
|
-
|
590
|
-
|
591
|
-
18
|
592
|
-
19
|
593
|
-
20</pre>
|
594
|
-
</td>
|
595
|
-
<td>
|
596
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 18</span>
|
597
|
-
|
598
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
599
|
-
<span class='ivar'>@options</span>
|
600
|
-
<span class='kw'>end</span></pre>
|
601
|
-
</td>
|
602
|
-
</tr>
|
603
|
-
</table>
|
604
|
-
</div>
|
605
|
-
|
606
|
-
</div>
|
607
|
-
|
608
|
-
|
609
|
-
<div id="class_method_details" class="method_details_list">
|
610
|
-
<h2>Class Method Details</h2>
|
611
|
-
|
612
|
-
|
613
|
-
<div class="method_details first">
|
614
|
-
<h3 class="signature first" id="execute-class_method">
|
615
|
-
|
616
|
-
+ (<tt>Object</tt>) <strong>execute</strong>(args)
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
</h3><table class="source_code">
|
623
|
-
<tr>
|
624
|
-
<td>
|
625
|
-
<pre class="lines">
|
626
|
-
|
627
|
-
|
628
|
-
30
|
629
|
-
31
|
630
|
-
32</pre>
|
631
|
-
</td>
|
632
|
-
<td>
|
633
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 30</span>
|
634
|
-
|
635
|
-
<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>
|
636
|
-
<span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='symbol'>:server</span><span class='rbracket'>]</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_server'>server</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_show'>show</span>
|
637
|
-
<span class='kw'>end</span></pre>
|
638
|
-
</td>
|
639
|
-
</tr>
|
640
|
-
</table>
|
641
|
-
</div>
|
642
|
-
|
643
|
-
</div>
|
644
|
-
|
645
|
-
<div id="instance_method_details" class="method_details_list">
|
646
|
-
<h2>Instance Method Details</h2>
|
647
|
-
|
648
|
-
|
649
|
-
<div class="method_details first">
|
650
|
-
<h3 class="signature first" id="browser-instance_method">
|
651
|
-
|
652
|
-
- (<tt>Object</tt>) <strong>browser</strong>
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
</h3><table class="source_code">
|
659
|
-
<tr>
|
660
|
-
<td>
|
661
|
-
<pre class="lines">
|
662
|
-
|
663
|
-
|
664
|
-
52
|
665
|
-
53
|
666
|
-
54</pre>
|
667
|
-
</td>
|
668
|
-
<td>
|
669
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 52</span>
|
670
|
-
|
671
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_browser'>browser</span>
|
672
|
-
<span class='const'>BROWSERS</span><span class='lbracket'>[</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_browser'>browser</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='kw'>nil</span>
|
673
|
-
<span class='kw'>end</span></pre>
|
674
|
-
</td>
|
675
|
-
</tr>
|
676
|
-
</table>
|
677
|
-
</div>
|
678
|
-
|
679
|
-
<div class="method_details ">
|
680
|
-
<h3 class="signature " id="generate_static-instance_method">
|
681
|
-
|
682
|
-
- (<tt>Object</tt>) <strong>generate_static</strong>(path)
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
</h3><table class="source_code">
|
689
|
-
<tr>
|
690
|
-
<td>
|
691
|
-
<pre class="lines">
|
692
|
-
|
693
|
-
|
694
|
-
105
|
695
|
-
106
|
696
|
-
107
|
697
|
-
108
|
698
|
-
109
|
699
|
-
110</pre>
|
700
|
-
</td>
|
701
|
-
<td>
|
702
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 105</span>
|
703
|
-
|
704
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_generate_static'>generate_static</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
705
|
-
<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_preview_path'>preview_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>w</span><span class='tstring_end'>"</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>
|
706
|
-
<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_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='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
707
|
-
<span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_output'>output</span> <span class='op'>?</span> <span class='id identifier rubyid_write_generated_path'>write_generated_path</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</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> <span class='op'>:</span> <span class='id identifier rubyid_open_generated_page'>open_generated_page</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
708
|
-
<span class='kw'>end</span>
|
709
|
-
<span class='kw'>end</span></pre>
|
710
|
-
</td>
|
711
|
-
</tr>
|
712
|
-
</table>
|
713
|
-
</div>
|
714
|
-
|
715
|
-
<div class="method_details ">
|
716
|
-
<h3 class="signature " id="open_generated_page-instance_method">
|
717
|
-
|
718
|
-
- (<tt>Object</tt>) <strong>open_generated_page</strong>(path)
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
</h3><div class="docstring">
|
725
|
-
<div class="discussion">
|
726
|
-
|
727
|
-
<p>TODO: add linux and windows systems</p>
|
728
|
-
|
729
|
-
|
730
|
-
</div>
|
731
|
-
</div>
|
732
|
-
<div class="tags">
|
733
|
-
|
734
|
-
|
735
|
-
</div><table class="source_code">
|
736
|
-
<tr>
|
737
|
-
<td>
|
738
|
-
<pre class="lines">
|
739
|
-
|
740
|
-
|
741
|
-
95
|
742
|
-
96
|
743
|
-
97</pre>
|
744
|
-
</td>
|
745
|
-
<td>
|
746
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 95</span>
|
747
|
-
|
748
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_open_generated_page'>open_generated_page</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
749
|
-
<span class='id identifier rubyid_exec'>exec</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>open </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_browser_options'>browser_options</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
750
|
-
<span class='kw'>end</span></pre>
|
751
|
-
</td>
|
752
|
-
</tr>
|
753
|
-
</table>
|
754
|
-
</div>
|
755
|
-
|
756
|
-
<div class="method_details ">
|
757
|
-
<h3 class="signature " id="path-instance_method">
|
758
|
-
|
759
|
-
- (<tt>Object</tt>) <strong>path</strong>
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
</h3><table class="source_code">
|
766
|
-
<tr>
|
767
|
-
<td>
|
768
|
-
<pre class="lines">
|
769
|
-
|
770
|
-
|
771
|
-
48
|
772
|
-
49
|
773
|
-
50</pre>
|
774
|
-
</td>
|
775
|
-
<td>
|
776
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 48</span>
|
777
|
-
|
778
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
|
779
|
-
<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'>"</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'>"</span></span>
|
780
|
-
<span class='kw'>end</span></pre>
|
781
|
-
</td>
|
782
|
-
</tr>
|
783
|
-
</table>
|
784
|
-
</div>
|
785
|
-
|
786
|
-
<div class="method_details ">
|
787
|
-
<h3 class="signature " id="preview_path-instance_method">
|
788
|
-
|
789
|
-
- (<tt>Object</tt>) <strong>preview_path</strong>(path)
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
</h3><table class="source_code">
|
796
|
-
<tr>
|
797
|
-
<td>
|
798
|
-
<pre class="lines">
|
799
|
-
|
800
|
-
|
801
|
-
70
|
802
|
-
71
|
803
|
-
72
|
804
|
-
73</pre>
|
805
|
-
</td>
|
806
|
-
<td>
|
807
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 70</span>
|
808
|
-
|
809
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_preview_path'>preview_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
810
|
-
<span class='id identifier rubyid_basename'>basename</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
811
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/tmp/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_basename'>basename</span><span class='embexpr_end'>}</span><span class='tstring_content'>-preview.html</span><span class='tstring_end'>"</span></span>
|
812
|
-
<span class='kw'>end</span></pre>
|
813
|
-
</td>
|
814
|
-
</tr>
|
815
|
-
</table>
|
816
|
-
</div>
|
817
|
-
|
818
|
-
<div class="method_details ">
|
819
|
-
<h3 class="signature " id="query_apiary-instance_method">
|
820
|
-
|
821
|
-
- (<tt>Object</tt>) <strong>query_apiary</strong>(host, path)
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
</h3><table class="source_code">
|
828
|
-
<tr>
|
829
|
-
<td>
|
830
|
-
<pre class="lines">
|
831
|
-
|
832
|
-
|
833
|
-
75
|
834
|
-
76
|
835
|
-
77
|
836
|
-
78
|
837
|
-
79
|
838
|
-
80
|
839
|
-
81
|
840
|
-
82
|
841
|
-
83
|
842
|
-
84
|
843
|
-
85
|
844
|
-
86
|
845
|
-
87
|
846
|
-
88
|
847
|
-
89
|
848
|
-
90
|
849
|
-
91
|
850
|
-
92</pre>
|
851
|
-
</td>
|
852
|
-
<td>
|
853
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 75</span>
|
854
|
-
|
855
|
-
<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>
|
856
|
-
<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</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/generate</span><span class='tstring_end'>"</span></span>
|
857
|
-
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
858
|
-
<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>
|
859
|
-
|
860
|
-
<span class='kw'>begin</span>
|
861
|
-
<span class='const'>RestClient</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
862
|
-
<span class='kw'>rescue</span> <span class='const'>RestClient</span><span class='op'>::</span><span class='const'>BadRequest</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
863
|
-
<span class='id identifier rubyid_err'>err</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span>
|
864
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_err'>err</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parserError</span><span class='tstring_end'>'</span></span>
|
865
|
-
<span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_err'>err</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>message</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_err'>err</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parserError</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
866
|
-
<span class='kw'>else</span>
|
867
|
-
<span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Apiary service responded with an error: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_err'>err</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>message</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
868
|
-
<span class='kw'>end</span>
|
869
|
-
<span class='kw'>rescue</span> <span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Exception</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
870
|
-
<span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</span></span>
|
871
|
-
<span class='kw'>end</span>
|
872
|
-
<span class='kw'>end</span></pre>
|
873
|
-
</td>
|
874
|
-
</tr>
|
875
|
-
</table>
|
876
|
-
</div>
|
877
|
-
|
878
|
-
<div class="method_details ">
|
879
|
-
<h3 class="signature " id="rack_app-instance_method">
|
880
|
-
|
881
|
-
- (<tt>Object</tt>) <strong>rack_app</strong>(&block)
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
</h3><table class="source_code">
|
888
|
-
<tr>
|
889
|
-
<td>
|
890
|
-
<pre class="lines">
|
891
|
-
|
892
|
-
|
893
|
-
56
|
894
|
-
57
|
895
|
-
58
|
896
|
-
59
|
897
|
-
60</pre>
|
898
|
-
</td>
|
899
|
-
<td>
|
900
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 56</span>
|
901
|
-
|
902
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_rack_app'>rack_app</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
903
|
-
<span class='const'>Rack</span><span class='op'>::</span><span class='const'>Builder</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span>
|
904
|
-
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_env'>env</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='int'>200</span><span class='comma'>,</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
905
|
-
<span class='kw'>end</span>
|
906
|
-
<span class='kw'>end</span></pre>
|
907
|
-
</td>
|
908
|
-
</tr>
|
909
|
-
</table>
|
910
|
-
</div>
|
911
|
-
|
912
|
-
<div class="method_details ">
|
913
|
-
<h3 class="signature " id="run_server-instance_method">
|
914
|
-
|
915
|
-
- (<tt>Object</tt>) <strong>run_server</strong>
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
</h3><table class="source_code">
|
922
|
-
<tr>
|
923
|
-
<td>
|
924
|
-
<pre class="lines">
|
925
|
-
|
926
|
-
|
927
|
-
62
|
928
|
-
63
|
929
|
-
64
|
930
|
-
65
|
931
|
-
66
|
932
|
-
67
|
933
|
-
68</pre>
|
934
|
-
</td>
|
935
|
-
<td>
|
936
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 62</span>
|
937
|
-
|
938
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_run_server'>run_server</span>
|
939
|
-
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rack_app'>rack_app</span> <span class='kw'>do</span>
|
940
|
-
<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>
|
941
|
-
<span class='kw'>end</span>
|
942
|
-
|
943
|
-
<span class='const'>Rack</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='symbol'>:Port</span> <span class='op'>=></span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='comma'>,</span> <span class='symbol'>:app</span> <span class='op'>=></span> <span class='id identifier rubyid_app'>app</span><span class='rparen'>)</span>
|
944
|
-
<span class='kw'>end</span></pre>
|
945
|
-
</td>
|
946
|
-
</tr>
|
947
|
-
</table>
|
948
|
-
</div>
|
949
|
-
|
950
|
-
<div class="method_details ">
|
951
|
-
<h3 class="signature " id="server-instance_method">
|
952
|
-
|
953
|
-
- (<tt>Object</tt>) <strong>server</strong>
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
</h3><table class="source_code">
|
960
|
-
<tr>
|
961
|
-
<td>
|
962
|
-
<pre class="lines">
|
963
|
-
|
964
|
-
|
965
|
-
34
|
966
|
-
35
|
967
|
-
36</pre>
|
968
|
-
</td>
|
969
|
-
<td>
|
970
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 34</span>
|
971
|
-
|
972
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_server'>server</span>
|
973
|
-
<span class='id identifier rubyid_run_server'>run_server</span>
|
974
|
-
<span class='kw'>end</span></pre>
|
975
|
-
</td>
|
976
|
-
</tr>
|
977
|
-
</table>
|
978
|
-
</div>
|
979
|
-
|
980
|
-
<div class="method_details ">
|
981
|
-
<h3 class="signature " id="show-instance_method">
|
982
|
-
|
983
|
-
- (<tt>Object</tt>) <strong>show</strong>
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
</h3><table class="source_code">
|
990
|
-
<tr>
|
991
|
-
<td>
|
992
|
-
<pre class="lines">
|
993
|
-
|
994
|
-
|
995
|
-
38
|
996
|
-
39
|
997
|
-
40</pre>
|
998
|
-
</td>
|
999
|
-
<td>
|
1000
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 38</span>
|
1001
|
-
|
1002
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_show'>show</span>
|
1003
|
-
<span class='id identifier rubyid_generate_static'>generate_static</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
1004
|
-
<span class='kw'>end</span></pre>
|
1005
|
-
</td>
|
1006
|
-
</tr>
|
1007
|
-
</table>
|
1008
|
-
</div>
|
1009
|
-
|
1010
|
-
<div class="method_details ">
|
1011
|
-
<h3 class="signature " id="validate_apib_file-instance_method">
|
1012
|
-
|
1013
|
-
- (<tt>Object</tt>) <strong>validate_apib_file</strong>(apib_file)
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
</h3><table class="source_code">
|
1020
|
-
<tr>
|
1021
|
-
<td>
|
1022
|
-
<pre class="lines">
|
1023
|
-
|
1024
|
-
|
1025
|
-
42
|
1026
|
-
43
|
1027
|
-
44
|
1028
|
-
45
|
1029
|
-
46</pre>
|
1030
|
-
</td>
|
1031
|
-
<td>
|
1032
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 42</span>
|
1033
|
-
|
1034
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_validate_apib_file'>validate_apib_file</span><span class='lparen'>(</span><span class='id identifier rubyid_apib_file'>apib_file</span><span class='rparen'>)</span>
|
1035
|
-
<span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_apib_file'>apib_file</span><span class='rparen'>)</span>
|
1036
|
-
<span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Apiary definition file hasn't been found: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_apib_file'>apib_file</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1037
|
-
<span class='kw'>end</span>
|
1038
|
-
<span class='kw'>end</span></pre>
|
1039
|
-
</td>
|
1040
|
-
</tr>
|
1041
|
-
</table>
|
1042
|
-
</div>
|
1043
|
-
|
1044
|
-
<div class="method_details ">
|
1045
|
-
<h3 class="signature " id="write_generated_path-instance_method">
|
1046
|
-
|
1047
|
-
- (<tt>Object</tt>) <strong>write_generated_path</strong>(path, outfile)
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
</h3><table class="source_code">
|
1054
|
-
<tr>
|
1055
|
-
<td>
|
1056
|
-
<pre class="lines">
|
1057
|
-
|
1058
|
-
|
1059
|
-
99
|
1060
|
-
100
|
1061
|
-
101
|
1062
|
-
102
|
1063
|
-
103</pre>
|
1064
|
-
</td>
|
1065
|
-
<td>
|
1066
|
-
<pre class="code"><span class="info file"># File 'lib/apiary/command/preview.rb', line 99</span>
|
1067
|
-
|
1068
|
-
<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_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_outfile'>outfile</span><span class='rparen'>)</span>
|
1069
|
-
<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'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</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>
|
1070
|
-
<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='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='rparen'>)</span>
|
1071
|
-
<span class='kw'>end</span>
|
1072
|
-
<span class='kw'>end</span></pre>
|
1073
|
-
</td>
|
1074
|
-
</tr>
|
1075
|
-
</table>
|
1076
|
-
</div>
|
1077
|
-
|
1078
|
-
</div>
|
1079
|
-
|
1080
|
-
</div>
|
1081
|
-
|
1082
|
-
<div id="footer">
|
1083
|
-
Generated on Mon May 12 13:32:43 2014 by
|
1084
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1085
|
-
0.8.7.4 (ruby-2.0.0).
|
1086
|
-
</div>
|
1087
|
-
|
1088
|
-
</body>
|
1089
|
-
</html>
|