netlinx-compile 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/bin/netlinx-compile +0 -0
- data/doc/NetLinx.html +119 -151
- data/doc/NetLinx/Compile.html +119 -148
- data/doc/NetLinx/Compile/Extension.html +115 -145
- data/doc/NetLinx/Compile/Extension/AXS.html +217 -154
- data/doc/NetLinx/Compile/ExtensionDiscovery.html +479 -321
- data/doc/NetLinx/Compile/ExtensionHandler.html +703 -396
- data/doc/NetLinx/Compile/Script.html +390 -282
- data/doc/NetLinx/Compiler.html +375 -288
- data/doc/NetLinx/CompilerResult.html +1102 -498
- data/doc/NetLinx/NoCompilerError.html +135 -155
- data/doc/NetLinx/SourceFile.html +608 -423
- data/doc/_index.html +215 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +94 -0
- data/doc/file.license.html +73 -0
- data/doc/file_list.html +63 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +94 -103
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -18
- data/doc/method_list.html +261 -0
- data/doc/top-level-namespace.html +112 -0
- 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
- metadata +98 -67
- 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
data/doc/NetLinx/Compiler.html
CHANGED
@@ -1,295 +1,382 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta content="text/html; charset=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8"
|
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
|
-
|
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: NetLinx::Compiler
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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#!NetLinx/Compiler.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Compiler</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: NetLinx::Compiler
|
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">NetLinx::Compiler</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/netlinx/compiler.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>A wrapper class for the AMX NetLinx compiler executable (nlrc.exe).</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
|
+
Instance 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="#compile-instance_method" title="#compile (instance method)">- (Object) <strong>compile</strong>(compilable) </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>Compile the specified object with the NetLinx compiler.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Compiler) <strong>initialize</strong>(**kvargs) </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
<span class="note title constructor">constructor</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>Checks for the AMX NetLinx compiler (third-party software, nlrc.exe) at the
|
173
|
+
default installation path.</p>
|
174
|
+
</div></span>
|
175
|
+
|
176
|
+
</li>
|
177
|
+
|
178
|
+
|
179
|
+
</ul>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="constructor_details" class="method_details_list">
|
183
|
+
<h2>Constructor Details</h2>
|
184
|
+
|
185
|
+
<div class="method_details first">
|
186
|
+
<h3 class="signature first" id="initialize-instance_method">
|
187
|
+
|
188
|
+
- (<tt><span class='object_link'><a href="" title="NetLinx::Compiler (class)">Compiler</a></span></tt>) <strong>initialize</strong>(**kvargs)
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</h3><div class="docstring">
|
195
|
+
<div class="discussion">
|
196
|
+
|
197
|
+
<p>Checks for the AMX NetLinx compiler (third-party software, nlrc.exe) at the
|
198
|
+
default installation path. This can be overridden by specifying
|
199
|
+
:compiler_path.</p>
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
<div class="tags">
|
205
|
+
|
206
|
+
|
207
|
+
</div><table class="source_code">
|
208
|
+
<tr>
|
209
|
+
<td>
|
210
|
+
<pre class="lines">
|
211
|
+
|
212
|
+
|
213
|
+
13
|
214
|
+
14
|
215
|
+
15
|
216
|
+
16
|
217
|
+
17
|
218
|
+
18
|
219
|
+
19
|
220
|
+
20
|
221
|
+
21
|
222
|
+
22
|
223
|
+
23
|
224
|
+
24
|
225
|
+
25
|
226
|
+
26
|
227
|
+
27
|
228
|
+
28
|
229
|
+
29
|
230
|
+
30
|
231
|
+
31
|
232
|
+
32
|
233
|
+
33</pre>
|
234
|
+
</td>
|
235
|
+
<td>
|
236
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/compiler.rb', line 13</span>
|
237
|
+
|
238
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_kvargs'>kvargs</span><span class='rparen'>)</span>
|
239
|
+
<span class='ivar'>@compiler_exe</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nlrc.exe</span><span class='tstring_end'>'</span></span>
|
46
240
|
|
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
|
-
|
241
|
+
<span class='ivar'>@compiler_path</span> <span class='op'>=</span> <span class='id identifier rubyid_kvargs'>kvargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:compiler_path</span><span class='comma'>,</span>
|
242
|
+
<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'>C:\Program Files (x86)\Common Files\AMXShare\COM</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'># 64-bit O/S path
|
243
|
+
</span>
|
244
|
+
<span class='comment'># Check for NetLinx compiler at :compiler_path or the 64-bit O/S path.
|
245
|
+
</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</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'>nlrc.exe</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@compiler_path</span><span class='rparen'>)</span>
|
246
|
+
<span class='comment'># Compiler not found. Try 32-bit O/S path.
|
247
|
+
</span> <span class='ivar'>@compiler_path</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'>C:\Program Files\Common Files\AMXShare\COM</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
248
|
+
<span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</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'>nlrc.exe</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@compiler_path</span><span class='rparen'>)</span>
|
249
|
+
<span class='comment'># ---------------------------------------------------------
|
250
|
+
</span> <span class='comment'># TODO: Check if the compiler was added to the system path.
|
251
|
+
</span> <span class='comment'># Execute system('nlrc').
|
252
|
+
</span> <span class='comment'># ---------------------------------------------------------
|
253
|
+
</span>
|
254
|
+
<span class='comment'># Compiler not found.
|
255
|
+
</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NetLinx</span><span class='op'>::</span><span class='const'>NoCompilerError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>The NetLinx compiler (nlrc.exe) could not be found on the system.</span><span class='tstring_end'>'</span></span>
|
256
|
+
<span class='kw'>end</span>
|
257
|
+
<span class='kw'>end</span>
|
258
|
+
<span class='kw'>end</span></pre>
|
259
|
+
</td>
|
260
|
+
</tr>
|
261
|
+
</table>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
<div id="instance_method_details" class="method_details_list">
|
268
|
+
<h2>Instance Method Details</h2>
|
269
|
+
|
270
|
+
|
271
|
+
<div class="method_details first">
|
272
|
+
<h3 class="signature first" id="compile-instance_method">
|
273
|
+
|
274
|
+
- (<tt>Object</tt>) <strong>compile</strong>(compilable)
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
</h3><div class="docstring">
|
281
|
+
<div class="discussion">
|
282
|
+
|
283
|
+
<p>Compile the specified object with the NetLinx compiler. See
|
284
|
+
Test::NetLinx::Compilable.</p>
|
285
|
+
|
286
|
+
|
287
|
+
</div>
|
288
|
+
</div>
|
289
|
+
<div class="tags">
|
290
|
+
|
291
|
+
|
292
|
+
</div><table class="source_code">
|
293
|
+
<tr>
|
294
|
+
<td>
|
295
|
+
<pre class="lines">
|
296
|
+
|
297
|
+
|
298
|
+
37
|
299
|
+
38
|
300
|
+
39
|
301
|
+
40
|
302
|
+
41
|
303
|
+
42
|
304
|
+
43
|
305
|
+
44
|
306
|
+
45
|
307
|
+
46
|
308
|
+
47
|
309
|
+
48
|
310
|
+
49
|
311
|
+
50
|
312
|
+
51
|
313
|
+
52
|
314
|
+
53
|
315
|
+
54
|
316
|
+
55
|
317
|
+
56
|
318
|
+
57
|
319
|
+
58
|
320
|
+
59
|
321
|
+
60
|
322
|
+
61
|
323
|
+
62
|
324
|
+
63
|
325
|
+
64
|
326
|
+
65
|
327
|
+
66
|
328
|
+
67
|
329
|
+
68</pre>
|
330
|
+
</td>
|
331
|
+
<td>
|
332
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/compiler.rb', line 37</span>
|
333
|
+
|
334
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_compile'>compile</span><span class='lparen'>(</span><span class='id identifier rubyid_compilable'>compilable</span><span class='rparen'>)</span>
|
335
|
+
<span class='id identifier rubyid_compiler'>compiler</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'>@compiler_exe</span><span class='comma'>,</span> <span class='ivar'>@compiler_path</span>
|
336
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
117
337
|
|
118
|
-
|
119
|
-
|
120
|
-
<
|
121
|
-
|
122
|
-
<li><a href="../Test/NetLinx/Compile/Discoverable.html">Test::NetLinx::Compile::Discoverable</a>
|
123
|
-
|
124
|
-
<li><a href="../Test/NetLinx/Compile/Invokable.html">Test::NetLinx::Compile::Invokable</a>
|
125
|
-
|
126
|
-
</ul>
|
127
|
-
</nav>
|
128
|
-
|
129
|
-
</div>
|
130
|
-
</nav>
|
131
|
-
|
132
|
-
<div id="documentation">
|
133
|
-
<h1 class="class">class NetLinx::Compiler</h1>
|
134
|
-
|
135
|
-
<div id="description" class="description">
|
136
|
-
|
137
|
-
<p>A wrapper class for the AMX <a href="../NetLinx.html">NetLinx</a> compiler
|
138
|
-
executable (nlrc.exe).</p>
|
139
|
-
|
140
|
-
</div><!-- description -->
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
<!-- Methods -->
|
155
|
-
|
156
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
157
|
-
<h3 class="section-header">Public Class Methods</h3>
|
158
|
-
|
159
|
-
|
160
|
-
<div id="method-c-new" class="method-detail ">
|
161
|
-
|
162
|
-
<div class="method-heading">
|
163
|
-
<span class="method-name">new</span><span
|
164
|
-
class="method-args">(**kvargs)</span>
|
165
|
-
|
166
|
-
<span class="method-click-advice">click to toggle source</span>
|
167
|
-
|
168
|
-
</div>
|
169
|
-
|
170
|
-
|
171
|
-
<div class="method-description">
|
172
|
-
|
173
|
-
<p>Checks for the AMX <a href="../NetLinx.html">NetLinx</a> compiler
|
174
|
-
(third-party software, nlrc.exe) at the default installation path. This can
|
175
|
-
be overridden by specifying :compiler_path.</p>
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
<div class="method-source-code" id="new-source">
|
181
|
-
<pre><span class="ruby-comment"># File lib/netlinx/compiler.rb, line 13</span>
|
182
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">kvargs</span>)
|
183
|
-
<span class="ruby-ivar">@compiler_exe</span> = <span class="ruby-string">'nlrc.exe'</span>
|
184
|
-
|
185
|
-
<span class="ruby-ivar">@compiler_path</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:compiler_path</span>,
|
186
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">'C:\Program Files (x86)\Common Files\AMXShare\COM'</span>) <span class="ruby-comment"># 64-bit O/S path</span>
|
187
|
-
|
188
|
-
<span class="ruby-comment"># Check for NetLinx compiler at :compiler_path or the 64-bit O/S path.</span>
|
189
|
-
<span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">'nlrc.exe'</span>, <span class="ruby-ivar">@compiler_path</span>)
|
190
|
-
<span class="ruby-comment"># Compiler not found. Try 32-bit O/S path.</span>
|
191
|
-
<span class="ruby-ivar">@compiler_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">'C:\Program Files\Common Files\AMXShare\COM'</span>)
|
192
|
-
<span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">'nlrc.exe'</span>, <span class="ruby-ivar">@compiler_path</span>)
|
193
|
-
<span class="ruby-comment"># ---------------------------------------------------------</span>
|
194
|
-
<span class="ruby-comment"># TODO: Check if the compiler was added to the system path.</span>
|
195
|
-
<span class="ruby-comment"># Execute system('nlrc').</span>
|
196
|
-
<span class="ruby-comment"># ---------------------------------------------------------</span>
|
338
|
+
<span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_target_files'>compiler_target_files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_target_file'>target_file</span><span class='op'>|</span>
|
339
|
+
<span class='comment'># Construct paths.
|
340
|
+
</span> <span class='id identifier rubyid_include_paths'>include_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-I</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_include_paths'>compiler_include_paths</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_end'>"</span></span> <span class='kw'>unless</span>
|
341
|
+
<span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_include_paths'>compiler_include_paths</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
197
342
|
|
198
|
-
|
199
|
-
<span class=
|
200
|
-
<span class="ruby-keyword">end</span>
|
201
|
-
<span class="ruby-keyword">end</span>
|
202
|
-
<span class="ruby-keyword">end</span></pre>
|
203
|
-
</div><!-- new-source -->
|
204
|
-
|
205
|
-
</div>
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
</div><!-- new-method -->
|
211
|
-
|
212
|
-
|
213
|
-
</section><!-- public-class-method-details -->
|
214
|
-
|
215
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
216
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
217
|
-
|
218
|
-
|
219
|
-
<div id="method-i-compile" class="method-detail ">
|
220
|
-
|
221
|
-
<div class="method-heading">
|
222
|
-
<span class="method-name">compile</span><span
|
223
|
-
class="method-args">(compilable)</span>
|
224
|
-
|
225
|
-
<span class="method-click-advice">click to toggle source</span>
|
226
|
-
|
227
|
-
</div>
|
228
|
-
|
229
|
-
|
230
|
-
<div class="method-description">
|
231
|
-
|
232
|
-
<p><a href="Compile.html">Compile</a> the specified object with the <a
|
233
|
-
href="../NetLinx.html">NetLinx</a> compiler. See <a
|
234
|
-
href="../Test/NetLinx/Compilable.html">Test::NetLinx::Compilable</a>.</p>
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<div class="method-source-code" id="compile-source">
|
240
|
-
<pre><span class="ruby-comment"># File lib/netlinx/compiler.rb, line 37</span>
|
241
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">compilable</span>)
|
242
|
-
<span class="ruby-identifier">compiler</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-ivar">@compiler_exe</span>, <span class="ruby-ivar">@compiler_path</span>
|
243
|
-
<span class="ruby-identifier">result</span> = []
|
244
|
-
|
245
|
-
<span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_target_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">target_file</span><span class="ruby-operator">|</span>
|
246
|
-
<span class="ruby-comment"># Construct paths.</span>
|
247
|
-
<span class="ruby-identifier">include_paths</span> = <span class="ruby-node">"-I#{compilable.compiler_include_paths.join ';'}"</span> <span class="ruby-keyword">unless</span>
|
248
|
-
<span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_include_paths</span>.<span class="ruby-identifier">empty?</span>
|
249
|
-
|
250
|
-
<span class="ruby-identifier">module_paths</span> = <span class="ruby-node">"-M#{compilable.compiler_module_paths.join ';'}"</span> <span class="ruby-keyword">unless</span>
|
251
|
-
<span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_module_paths</span>.<span class="ruby-identifier">empty?</span>
|
343
|
+
<span class='id identifier rubyid_module_paths'>module_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-M</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_module_paths'>compiler_module_paths</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_end'>"</span></span> <span class='kw'>unless</span>
|
344
|
+
<span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_module_paths'>compiler_module_paths</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
252
345
|
|
253
|
-
<span class=
|
254
|
-
<span class=
|
346
|
+
<span class='id identifier rubyid_library_paths'>library_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-L</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_library_paths'>compiler_library_paths</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_end'>"</span></span> <span class='kw'>unless</span>
|
347
|
+
<span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_library_paths'>compiler_library_paths</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
255
348
|
|
256
|
-
<span class=
|
257
|
-
<span class=
|
258
|
-
<span class=
|
259
|
-
<span class=
|
260
|
-
|
261
|
-
<span class="ruby-comment"># Build the result.</span>
|
262
|
-
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NetLinx</span><span class="ruby-operator">::</span><span class="ruby-constant">CompilerResult</span>.<span class="ruby-identifier">new</span>(
|
263
|
-
<span class="ruby-identifier">compiler_target_files</span><span class="ruby-operator">:</span> [<span class="ruby-identifier">target_file</span>],
|
264
|
-
<span class="ruby-identifier">compiler_include_paths</span><span class="ruby-operator">:</span> <span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_include_paths</span>,
|
265
|
-
<span class="ruby-identifier">compiler_module_paths</span><span class="ruby-operator">:</span> <span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_module_paths</span>,
|
266
|
-
<span class="ruby-identifier">compiler_library_paths</span><span class="ruby-operator">:</span> <span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_library_paths</span>,
|
267
|
-
<span class="ruby-identifier">stream</span><span class="ruby-operator">:</span> <span class="ruby-identifier">stream</span>
|
268
|
-
)
|
269
|
-
<span class="ruby-keyword">end</span>
|
270
|
-
|
271
|
-
<span class="ruby-identifier">result</span>
|
272
|
-
<span class="ruby-keyword">end</span></pre>
|
273
|
-
</div><!-- compile-source -->
|
274
|
-
|
275
|
-
</div>
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
</div><!-- compile-method -->
|
281
|
-
|
349
|
+
<span class='comment'># Run the NetLinx compiler.
|
350
|
+
</span> <span class='id identifier rubyid_io'>io</span> <span class='op'>=</span> <span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_popen'>popen</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_compiler'>compiler</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target_file'>target_file</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_include_paths'>include_paths</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_module_paths'>module_paths</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_library_paths'>library_paths</span><span class='embexpr_end'>}</span><span class='tstring_content'>\"</span><span class='tstring_end'>"</span></span>
|
351
|
+
<span class='id identifier rubyid_stream'>stream</span> <span class='op'>=</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
|
352
|
+
<span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
282
353
|
|
283
|
-
|
354
|
+
<span class='comment'># Build the result.
|
355
|
+
</span> <span class='id identifier rubyid_result'>result</span> <span class='op'><<</span> <span class='const'>NetLinx</span><span class='op'>::</span><span class='const'>CompilerResult</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
356
|
+
<span class='label'>compiler_target_files:</span> <span class='lbracket'>[</span><span class='id identifier rubyid_target_file'>target_file</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
357
|
+
<span class='label'>compiler_include_paths:</span> <span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_include_paths'>compiler_include_paths</span><span class='comma'>,</span>
|
358
|
+
<span class='label'>compiler_module_paths:</span> <span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_module_paths'>compiler_module_paths</span><span class='comma'>,</span>
|
359
|
+
<span class='label'>compiler_library_paths:</span> <span class='id identifier rubyid_compilable'>compilable</span><span class='period'>.</span><span class='id identifier rubyid_compiler_library_paths'>compiler_library_paths</span><span class='comma'>,</span>
|
360
|
+
<span class='label'>stream:</span> <span class='id identifier rubyid_stream'>stream</span>
|
361
|
+
<span class='rparen'>)</span>
|
362
|
+
<span class='kw'>end</span>
|
284
363
|
|
285
|
-
|
286
|
-
|
287
|
-
</
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
</
|
295
|
-
|
364
|
+
<span class='id identifier rubyid_result'>result</span>
|
365
|
+
<span class='kw'>end</span></pre>
|
366
|
+
</td>
|
367
|
+
</tr>
|
368
|
+
</table>
|
369
|
+
</div>
|
370
|
+
|
371
|
+
</div>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
|
375
|
+
<div id="footer">
|
376
|
+
Generated on Mon Jan 26 15:35:28 2015 by
|
377
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
378
|
+
0.8.7.6 (ruby-2.1.5).
|
379
|
+
</div>
|
380
|
+
|
381
|
+
</body>
|
382
|
+
</html>
|