netlinx-compile 1.0.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +122 -0
- data/doc/NetLinx.html +130 -151
- data/doc/NetLinx/Compile.html +130 -148
- data/doc/NetLinx/Compile/Extension.html +128 -145
- data/doc/NetLinx/Compile/Extension/AXS.html +218 -154
- data/doc/NetLinx/Compile/ExtensionDiscovery.html +524 -321
- data/doc/NetLinx/Compile/ExtensionHandler.html +755 -396
- data/doc/NetLinx/Compile/Script.html +431 -282
- data/doc/NetLinx/Compiler.html +496 -285
- data/doc/NetLinx/CompilerResult.html +1250 -498
- data/doc/NetLinx/NoCompilerError.html +142 -155
- data/doc/NetLinx/Rake.html +115 -0
- data/doc/NetLinx/Rake/Compile.html +358 -0
- data/doc/NetLinx/SourceFile.html +702 -423
- data/doc/_index.html +234 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +156 -0
- data/doc/file.license.html +70 -0
- data/doc/file_list.html +61 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +156 -103
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -18
- data/doc/method_list.html +339 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/netlinx-compile.rb +11 -1
- data/lib/netlinx/compile/extension_discovery.rb +4 -2
- data/lib/netlinx/compile/extension_handler.rb +23 -25
- data/lib/netlinx/compile/script.rb +4 -3
- data/lib/netlinx/compiler.rb +45 -21
- data/lib/netlinx/compiler_result.rb +16 -17
- data/lib/netlinx/rake/compile.rb +4 -0
- data/lib/netlinx/rake/compile/compile.rb +34 -0
- data/lib/netlinx/source_file.rb +20 -14
- data/lib/test/netlinx/compilable.rb +13 -48
- data/lib/test/netlinx/compile/discoverable.rb +3 -14
- data/lib/test/netlinx/compile/invokable.rb +3 -15
- data/license.txt +1 -1
- metadata +114 -74
- data/README.txt +0 -2
- data/doc/Test.html +0 -147
- data/doc/Test/NetLinx.html +0 -147
- data/doc/Test/NetLinx/Compilable.html +0 -148
- data/doc/Test/NetLinx/Compile.html +0 -146
- data/doc/Test/NetLinx/Compile/Discoverable.html +0 -148
- data/doc/Test/NetLinx/Compile/Invokable.html +0 -149
- data/doc/created.rid +0 -12
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/js/darkfish.js +0 -155
- data/doc/js/navigation.js +0 -142
- data/doc/js/search.js +0 -94
- data/doc/js/search_index.js +0 -1
- data/doc/js/searcher.js +0 -228
- data/doc/rdoc.css +0 -595
- data/doc/table_of_contents.html +0 -138
@@ -1,293 +1,442 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<
|
4
|
-
<
|
5
|
-
<meta
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<
|
16
|
-
|
17
|
-
<script type="text/javascript"
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
</
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
<
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
</
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
<
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
<
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: NetLinx::Compile::Script
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.25
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "NetLinx::Compile::Script";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span> » <span class='title'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Script</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: NetLinx::Compile::Script
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">NetLinx::Compile::Script</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/netlinx/compile/script.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>The container for the script that runs when netlinx-compile is executed.</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="#run-class_method" title="run (class method)">.<strong>run</strong>(**kwargs) ⇒ Object </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Run the script.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
</ul>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<div id="class_method_details" class="method_details_list">
|
158
|
+
<h2>Class Method Details</h2>
|
159
|
+
|
160
|
+
|
161
|
+
<div class="method_details first">
|
162
|
+
<h3 class="signature first" id="run-class_method">
|
163
|
+
|
164
|
+
.<strong>run</strong>(**kwargs) ⇒ <tt>Object</tt>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</h3><div class="docstring">
|
171
|
+
<div class="discussion">
|
172
|
+
|
173
|
+
<p>Run the script.</p>
|
174
|
+
|
175
|
+
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
<div class="tags">
|
179
|
+
<p class="tag_title">Parameters:</p>
|
180
|
+
<ul class="param">
|
181
|
+
|
182
|
+
<li>
|
183
|
+
|
184
|
+
<span class='name'>kwargs</span>
|
185
|
+
|
186
|
+
|
187
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
—
|
192
|
+
<div class='inline'>
|
193
|
+
<p>a customizable set of options</p>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
</li>
|
197
|
+
|
198
|
+
</ul>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<p class="tag_title">Options Hash (<tt>**kwargs</tt>):</p>
|
204
|
+
<ul class="option">
|
205
|
+
|
206
|
+
<li>
|
207
|
+
<span class="name">:argv</span>
|
208
|
+
<span class="type">(<tt>Array<String></tt>)</span>
|
209
|
+
<span class="default">
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
— <div class='inline'>
|
214
|
+
<p>A convenience to override ARGV, like for testing.</p>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
</li>
|
218
|
+
|
219
|
+
</ul>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</div><table class="source_code">
|
224
|
+
<tr>
|
225
|
+
<td>
|
226
|
+
<pre class="lines">
|
227
|
+
|
228
|
+
|
229
|
+
15
|
230
|
+
16
|
231
|
+
17
|
232
|
+
18
|
233
|
+
19
|
234
|
+
20
|
235
|
+
21
|
236
|
+
22
|
237
|
+
23
|
238
|
+
24
|
239
|
+
25
|
240
|
+
26
|
241
|
+
27
|
242
|
+
28
|
243
|
+
29
|
244
|
+
30
|
245
|
+
31
|
246
|
+
32
|
247
|
+
33
|
248
|
+
34
|
249
|
+
35
|
250
|
+
36
|
251
|
+
37
|
252
|
+
38
|
253
|
+
39
|
254
|
+
40
|
255
|
+
41
|
256
|
+
42
|
257
|
+
43
|
258
|
+
44
|
259
|
+
45
|
260
|
+
46
|
261
|
+
47
|
262
|
+
48
|
263
|
+
49
|
264
|
+
50
|
265
|
+
51
|
266
|
+
52
|
267
|
+
53
|
268
|
+
54
|
269
|
+
55
|
270
|
+
56
|
271
|
+
57
|
272
|
+
58
|
273
|
+
59
|
274
|
+
60
|
275
|
+
61
|
276
|
+
62
|
277
|
+
63
|
278
|
+
64
|
279
|
+
65
|
280
|
+
66
|
281
|
+
67
|
282
|
+
68
|
283
|
+
69
|
284
|
+
70
|
285
|
+
71
|
286
|
+
72
|
287
|
+
73
|
288
|
+
74
|
289
|
+
75
|
290
|
+
76
|
291
|
+
77
|
292
|
+
78
|
293
|
+
79
|
294
|
+
80
|
295
|
+
81
|
296
|
+
82
|
297
|
+
83
|
298
|
+
84
|
299
|
+
85
|
300
|
+
86
|
301
|
+
87
|
302
|
+
88
|
303
|
+
89
|
304
|
+
90
|
305
|
+
91
|
306
|
+
92
|
307
|
+
93
|
308
|
+
94
|
309
|
+
95
|
310
|
+
96
|
311
|
+
97
|
312
|
+
98
|
313
|
+
99
|
314
|
+
100
|
315
|
+
101
|
316
|
+
102
|
317
|
+
103
|
318
|
+
104
|
319
|
+
105
|
320
|
+
106
|
321
|
+
107
|
322
|
+
108
|
323
|
+
109
|
324
|
+
110</pre>
|
325
|
+
</td>
|
326
|
+
<td>
|
327
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/compile/script.rb', line 15</span>
|
328
|
+
|
329
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
|
330
|
+
<span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:argv</span><span class='comma'>,</span> <span class='const'>ARGV</span>
|
331
|
+
|
332
|
+
<span class='comment'># Command line options.
|
333
|
+
</span> <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> \
|
334
|
+
<span class='label'>source:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
335
|
+
<span class='label'>include_paths:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
336
|
+
<span class='label'>use_workspace:</span> <span class='kw'>false</span>
|
337
|
+
|
338
|
+
<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>
|
339
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Usage: netlinx-compile [options]</span><span class='tstring_end'>"</span></span>
|
188
340
|
|
189
|
-
<span class=
|
190
|
-
<span class=
|
191
|
-
<span class=
|
192
|
-
<span class=
|
341
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-h</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--help</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Display this help screen.</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
|
342
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_opts'>opts</span>
|
343
|
+
<span class='id identifier rubyid_exit'>exit</span>
|
344
|
+
<span class='kw'>end</span>
|
193
345
|
|
194
|
-
<span class=
|
195
|
-
<span class=
|
196
|
-
<span class=
|
346
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--source FILE</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Source file to compile.</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
347
|
+
<span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
|
348
|
+
<span class='kw'>end</span>
|
197
349
|
|
198
|
-
<span class=
|
199
|
-
<span class=
|
200
|
-
<span class=
|
350
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-i</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--include [Path1,Path2]</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>Array</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Additional include and module paths.</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
351
|
+
<span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_include_paths'>include_paths</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
|
352
|
+
<span class='kw'>end</span>
|
201
353
|
|
202
|
-
<span class=
|
203
|
-
<span class=
|
204
|
-
<span class=
|
205
|
-
<span class=
|
206
|
-
<span class=
|
354
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-w</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--workspace</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--smart</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
355
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Search up directory tree for a workspace</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
356
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>containing the source file.</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
357
|
+
<span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_use_workspace'>use_workspace</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
|
358
|
+
<span class='kw'>end</span>
|
207
359
|
|
208
|
-
<span class=
|
209
|
-
|
210
|
-
<span class=
|
211
|
-
<span class=
|
212
|
-
<span class=
|
213
|
-
<span class=
|
214
|
-
|
215
|
-
<span class=
|
216
|
-
<span class="
|
217
|
-
<span class=
|
218
|
-
<span class=
|
219
|
-
|
220
|
-
<span class=
|
221
|
-
<span class=
|
222
|
-
<span class=
|
223
|
-
<span class=
|
224
|
-
<span class=
|
225
|
-
<span class=
|
360
|
+
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span> <span class='id identifier rubyid_args'>args</span>
|
361
|
+
|
362
|
+
<span class='kw'>if</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
363
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No source file specified.\nRun \"netlinx-compile -h\" for help.</span><span class='tstring_end'>"</span></span>
|
364
|
+
<span class='id identifier rubyid_exit'>exit</span>
|
365
|
+
<span class='kw'>end</span>
|
366
|
+
|
367
|
+
<span class='comment'># Find an ExtensionHandler for the given file.
|
368
|
+
</span> <span class='const'><span class='object_link'><a href="ExtensionDiscovery.html" title="NetLinx::Compile::ExtensionDiscovery (class)">ExtensionDiscovery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_discover'><span class='object_link'><a href="ExtensionDiscovery.html#discover-class_method" title="NetLinx::Compile::ExtensionDiscovery.discover (method)">discover</a></span></span>
|
369
|
+
<span class='id identifier rubyid_source_file'>source_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_source'>source</span>
|
370
|
+
<span class='id identifier rubyid_handler'>handler</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExtensionDiscovery.html" title="NetLinx::Compile::ExtensionDiscovery (class)">ExtensionDiscovery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get_handler'><span class='object_link'><a href="ExtensionDiscovery.html#get_handler-class_method" title="NetLinx::Compile::ExtensionDiscovery.get_handler (method)">get_handler</a></span></span> <span class='id identifier rubyid_source_file'>source_file</span>
|
371
|
+
|
372
|
+
<span class='comment'># If the handler is a workspace handler, go straight to compiling it.
|
373
|
+
</span> <span class='comment'># Otherwise, if the use_workspace flag is true, search up through the
|
374
|
+
</span> <span class='comment'># directory tree to try to find a workspace that includes the
|
375
|
+
</span> <span class='comment'># specified source file.
|
376
|
+
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='kw'>not</span> <span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_is_a_workspace?'>is_a_workspace?</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_use_workspace'>use_workspace</span>
|
377
|
+
<span class='id identifier rubyid_workspace_extensions'>workspace_extensions</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExtensionDiscovery.html" title="NetLinx::Compile::ExtensionDiscovery (class)">ExtensionDiscovery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_workspace_extensions'><span class='object_link'><a href="ExtensionDiscovery.html#workspace_extensions-class_method" title="NetLinx::Compile::ExtensionDiscovery.workspace_extensions (method)">workspace_extensions</a></span></span>
|
226
378
|
|
227
|
-
<span class=
|
228
|
-
<span class=
|
229
|
-
<span class=
|
379
|
+
<span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span>
|
380
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_dir'>dir</span> <span class='op'>!=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>..</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
381
|
+
<span class='id identifier rubyid_workspaces'>workspaces</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dir'>dir</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*.{</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_workspace_extensions'>workspace_extensions</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='embexpr_end'>}</span><span class='tstring_content'>}</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
230
382
|
|
231
|
-
<span class=
|
232
|
-
<span class=
|
233
|
-
|
234
|
-
<span class=
|
235
|
-
<span class=
|
236
|
-
<span class=
|
383
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_workspaces'>workspaces</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
384
|
+
<span class='comment'># TODO: Handle workspace file extension usurping logic here.
|
385
|
+
</span>
|
386
|
+
<span class='id identifier rubyid_new_source_file'>new_source_file</span> <span class='op'>=</span> <span class='id identifier rubyid_workspaces'>workspaces</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
387
|
+
<span class='id identifier rubyid_new_handler'>new_handler</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExtensionDiscovery.html" title="NetLinx::Compile::ExtensionDiscovery (class)">ExtensionDiscovery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get_handler'><span class='object_link'><a href="ExtensionDiscovery.html#get_handler-class_method" title="NetLinx::Compile::ExtensionDiscovery.get_handler (method)">get_handler</a></span></span> <span class='id identifier rubyid_new_source_file'>new_source_file</span>
|
388
|
+
<span class='id identifier rubyid_new_handler_class'>new_handler_class</span> <span class='op'>=</span> <span class='id identifier rubyid_new_handler'>new_handler</span><span class='period'>.</span><span class='id identifier rubyid_handler_class'>handler_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> \
|
389
|
+
<span class='label'>file:</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_new_source_file'>new_source_file</span><span class='rparen'>)</span>
|
237
390
|
|
238
|
-
<span class=
|
239
|
-
<span class=
|
240
|
-
<span class=
|
391
|
+
<span class='comment'># If supported by the new_handler, make sure the source_file is
|
392
|
+
</span> <span class='comment'># included in the workspace before overwriting the old handler.
|
393
|
+
</span> <span class='id identifier rubyid_overwrite_old_handler'>overwrite_old_handler</span> <span class='op'>=</span> <span class='kw'>false</span>
|
241
394
|
|
242
|
-
<span class=
|
243
|
-
<span class=
|
244
|
-
<span class=
|
245
|
-
<span class=
|
246
|
-
<span class=
|
247
|
-
<span class=
|
248
|
-
<span class=
|
249
|
-
<span class=
|
250
|
-
<span class=
|
395
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_new_handler_class'>new_handler_class</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:include?</span>
|
396
|
+
<span class='id identifier rubyid_overwrite_old_handler'>overwrite_old_handler</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_handler_class'>new_handler_class</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_source_file'>source_file</span>
|
397
|
+
<span class='kw'>else</span>
|
398
|
+
<span class='comment'># Workspace doesn't expose an interface to see if it
|
399
|
+
</span> <span class='comment'># includes the source file, so assume it does.
|
400
|
+
</span> <span class='comment'># Otherwise the user could have compiled without the
|
401
|
+
</span> <span class='comment'># workspace flag.
|
402
|
+
</span> <span class='id identifier rubyid_overwrite_old_handler'>overwrite_old_handler</span> <span class='op'>=</span> <span class='kw'>true</span>
|
403
|
+
<span class='kw'>end</span>
|
251
404
|
|
252
|
-
<span class=
|
253
|
-
<span class=
|
254
|
-
<span class=
|
255
|
-
<span class=
|
256
|
-
<span class=
|
257
|
-
<span class=
|
258
|
-
<span class=
|
405
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_overwrite_old_handler'>overwrite_old_handler</span>
|
406
|
+
<span class='id identifier rubyid_source_file'>source_file</span> <span class='op'>=</span> <span class='id identifier rubyid_new_source_file'>new_source_file</span>
|
407
|
+
<span class='id identifier rubyid_handler'>handler</span> <span class='op'>=</span> <span class='id identifier rubyid_new_handler'>new_handler</span>
|
408
|
+
<span class='id identifier rubyid_handler_class'>handler_class</span> <span class='op'>=</span> <span class='id identifier rubyid_new_handler_class'>new_handler_class</span>
|
409
|
+
<span class='kw'>break</span>
|
410
|
+
<span class='kw'>end</span>
|
411
|
+
<span class='kw'>end</span>
|
259
412
|
|
260
|
-
<span class=
|
261
|
-
<span class=
|
262
|
-
<span class=
|
263
|
-
|
264
|
-
<span class=
|
265
|
-
<span class=
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
<span class=
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
</div
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.1.
|
291
|
-
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
292
|
-
</footer>
|
293
|
-
|
413
|
+
<span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>..</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span>
|
414
|
+
<span class='kw'>end</span>
|
415
|
+
<span class='kw'>end</span>
|
416
|
+
|
417
|
+
<span class='comment'># Instantiate the class that can handle compiling of the file.
|
418
|
+
</span> <span class='id identifier rubyid_handler_class'>handler_class</span> <span class='op'>=</span> <span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_handler_class'>handler_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> \
|
419
|
+
<span class='label'>file:</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_source_file'>source_file</span><span class='rparen'>)</span>
|
420
|
+
|
421
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_handler_class'>handler_class</span><span class='period'>.</span><span class='id identifier rubyid_compile'>compile</span>
|
422
|
+
|
423
|
+
<span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span>
|
424
|
+
<span class='kw'>end</span></pre>
|
425
|
+
</td>
|
426
|
+
</tr>
|
427
|
+
</table>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</div>
|
433
|
+
|
434
|
+
<div id="footer">
|
435
|
+
Generated on Sat Jul 11 17:29:50 2020 by
|
436
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
437
|
+
0.9.25 (ruby-2.7.1).
|
438
|
+
</div>
|
439
|
+
|
440
|
+
</div>
|
441
|
+
</body>
|
442
|
+
</html>
|