netlinx-compile 1.0.0 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +122 -0
  3. data/doc/NetLinx.html +130 -151
  4. data/doc/NetLinx/Compile.html +130 -148
  5. data/doc/NetLinx/Compile/Extension.html +128 -145
  6. data/doc/NetLinx/Compile/Extension/AXS.html +218 -154
  7. data/doc/NetLinx/Compile/ExtensionDiscovery.html +524 -321
  8. data/doc/NetLinx/Compile/ExtensionHandler.html +755 -396
  9. data/doc/NetLinx/Compile/Script.html +431 -282
  10. data/doc/NetLinx/Compiler.html +496 -285
  11. data/doc/NetLinx/CompilerResult.html +1250 -498
  12. data/doc/NetLinx/NoCompilerError.html +142 -155
  13. data/doc/NetLinx/Rake.html +115 -0
  14. data/doc/NetLinx/Rake/Compile.html +358 -0
  15. data/doc/NetLinx/SourceFile.html +702 -423
  16. data/doc/_index.html +234 -0
  17. data/doc/class_list.html +51 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +58 -0
  20. data/doc/css/style.css +496 -0
  21. data/doc/file.README.html +156 -0
  22. data/doc/file.license.html +70 -0
  23. data/doc/file_list.html +61 -0
  24. data/doc/frames.html +17 -0
  25. data/doc/index.html +156 -103
  26. data/doc/js/app.js +314 -0
  27. data/doc/js/full_list.js +216 -0
  28. data/doc/js/jquery.js +4 -18
  29. data/doc/method_list.html +339 -0
  30. data/doc/top-level-namespace.html +110 -0
  31. data/lib/netlinx-compile.rb +11 -1
  32. data/lib/netlinx/compile/extension_discovery.rb +4 -2
  33. data/lib/netlinx/compile/extension_handler.rb +23 -25
  34. data/lib/netlinx/compile/script.rb +4 -3
  35. data/lib/netlinx/compiler.rb +45 -21
  36. data/lib/netlinx/compiler_result.rb +16 -17
  37. data/lib/netlinx/rake/compile.rb +4 -0
  38. data/lib/netlinx/rake/compile/compile.rb +34 -0
  39. data/lib/netlinx/source_file.rb +20 -14
  40. data/lib/test/netlinx/compilable.rb +13 -48
  41. data/lib/test/netlinx/compile/discoverable.rb +3 -14
  42. data/lib/test/netlinx/compile/invokable.rb +3 -15
  43. data/license.txt +1 -1
  44. metadata +114 -74
  45. data/README.txt +0 -2
  46. data/doc/Test.html +0 -147
  47. data/doc/Test/NetLinx.html +0 -147
  48. data/doc/Test/NetLinx/Compilable.html +0 -148
  49. data/doc/Test/NetLinx/Compile.html +0 -146
  50. data/doc/Test/NetLinx/Compile/Discoverable.html +0 -148
  51. data/doc/Test/NetLinx/Compile/Invokable.html +0 -149
  52. data/doc/created.rid +0 -12
  53. data/doc/images/add.png +0 -0
  54. data/doc/images/arrow_up.png +0 -0
  55. data/doc/images/brick.png +0 -0
  56. data/doc/images/brick_link.png +0 -0
  57. data/doc/images/bug.png +0 -0
  58. data/doc/images/bullet_black.png +0 -0
  59. data/doc/images/bullet_toggle_minus.png +0 -0
  60. data/doc/images/bullet_toggle_plus.png +0 -0
  61. data/doc/images/date.png +0 -0
  62. data/doc/images/delete.png +0 -0
  63. data/doc/images/find.png +0 -0
  64. data/doc/images/loadingAnimation.gif +0 -0
  65. data/doc/images/macFFBgHack.png +0 -0
  66. data/doc/images/package.png +0 -0
  67. data/doc/images/page_green.png +0 -0
  68. data/doc/images/page_white_text.png +0 -0
  69. data/doc/images/page_white_width.png +0 -0
  70. data/doc/images/plugin.png +0 -0
  71. data/doc/images/ruby.png +0 -0
  72. data/doc/images/tag_blue.png +0 -0
  73. data/doc/images/tag_green.png +0 -0
  74. data/doc/images/transparent.png +0 -0
  75. data/doc/images/wrench.png +0 -0
  76. data/doc/images/wrench_orange.png +0 -0
  77. data/doc/images/zoom.png +0 -0
  78. data/doc/js/darkfish.js +0 -155
  79. data/doc/js/navigation.js +0 -142
  80. data/doc/js/search.js +0 -94
  81. data/doc/js/search_index.js +0 -1
  82. data/doc/js/searcher.js +0 -228
  83. data/doc/rdoc.css +0 -595
  84. data/doc/table_of_contents.html +0 -138
@@ -1,295 +1,506 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
-
7
- <title>class NetLinx::Compiler - RDoc Documentation</title>
8
-
9
- <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
10
-
11
- <script type="text/javascript">
12
- var rdoc_rel_prefix = "../";
13
- </script>
14
-
15
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
21
-
22
-
23
- <body id="top" class="class">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="../index.html">Home</a>
28
- <a href="../table_of_contents.html#classes">Classes</a>
29
- <a href="../table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
33
-
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
35
- <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
38
- title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
44
-
45
-
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::Compiler
8
+
9
+ &mdash; 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::Compiler";
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 (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span>
41
+ &raquo;
42
+ <span class="title">Compiler</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::Compiler
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::Compiler</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/compiler.rb</dd>
98
+ </dl>
99
+
100
+ </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)">#<strong>compile</strong>(compilable) &#x21d2; 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>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)">#<strong>initialize</strong>(**kwargs) &#x21d2; Compiler </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 default installation path.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ </ul>
179
+
180
+
181
+ <div id="constructor_details" class="method_details_list">
182
+ <h2>Constructor Details</h2>
183
+
184
+ <div class="method_details first">
185
+ <h3 class="signature first" id="initialize-instance_method">
186
+
187
+ #<strong>initialize</strong>(**kwargs) &#x21d2; <tt><span class='object_link'><a href="" title="NetLinx::Compiler (class)">Compiler</a></span></tt>
188
+
189
+
190
+
191
+
192
+
193
+ </h3><div class="docstring">
194
+ <div class="discussion">
195
+
196
+ <p>Checks for the AMX NetLinx compiler (third-party software, nlrc.exe) at the default installation path.</p>
197
+
198
+
199
+ </div>
200
+ </div>
201
+ <div class="tags">
202
+ <p class="tag_title">Parameters:</p>
203
+ <ul class="param">
204
+
205
+ <li>
206
+
207
+ <span class='name'>kwargs</span>
208
+
209
+
210
+ <span class='type'>(<tt>Hash</tt>)</span>
211
+
212
+
213
+
214
+ &mdash;
215
+ <div class='inline'>
216
+ <p>a customizable set of options</p>
217
+ </div>
218
+
219
+ </li>
220
+
221
+ </ul>
222
+
223
+
224
+
225
+
226
+ <p class="tag_title">Options Hash (<tt>**kwargs</tt>):</p>
227
+ <ul class="option">
228
+
229
+ <li>
230
+ <span class="name">:compiler_exe</span>
231
+ <span class="type">(<tt>String</tt>)</span>
232
+ <span class="default">
233
+
234
+ &mdash; default:
235
+ <tt>&#39;nlrc.exe&#39;</tt>
236
+
237
+ </span>
238
+
239
+ </li>
240
+
241
+ <li>
242
+ <span class="name">:compiler_path</span>
243
+ <span class="type">(<tt>String</tt>)</span>
244
+ <span class="default">
245
+
246
+ </span>
247
+
248
+ &mdash; <div class='inline'>
249
+ <p>Recommend a directory to look for the compiler_exe.</p>
250
+ </div>
251
+
252
+ </li>
253
+
254
+ <li>
255
+ <span class="name">:use_wine</span>
256
+ <span class="type">(<tt>String</tt>)</span>
257
+ <span class="default">
258
+
259
+ &mdash; default:
260
+ <tt>false</tt>
261
+
262
+ </span>
263
+
264
+ &mdash; <div class='inline'>
265
+ <p>Set to true to force `wine` at the front of the compiler command. This is automatic if nlrc.exe is installed at Wine&#39;s default Program Files path.</p>
266
+ </div>
267
+
268
+ </li>
269
+
270
+ </ul>
271
+
272
+
273
+ <p class="tag_title">Raises:</p>
274
+ <ul class="raise">
275
+
276
+ <li>
277
+
278
+
279
+ <span class='type'>(<tt><span class='object_link'><a href="NoCompilerError.html" title="NetLinx::NoCompilerError (class)">NetLinx::NoCompilerError</a></span></tt>)</span>
280
+
281
+
282
+
283
+ &mdash;
284
+ <div class='inline'>
285
+ <p>Compiler not found.</p>
286
+ </div>
287
+
288
+ </li>
289
+
290
+ </ul>
291
+
292
+ </div><table class="source_code">
293
+ <tr>
294
+ <td>
295
+ <pre class="lines">
296
+
297
+
298
+ 21
299
+ 22
300
+ 23
301
+ 24
302
+ 25
303
+ 26
304
+ 27
305
+ 28
306
+ 29
307
+ 30
308
+ 31
309
+ 32
310
+ 33
311
+ 34
312
+ 35
313
+ 36
314
+ 37
315
+ 38
316
+ 39
317
+ 40
318
+ 41
319
+ 42
320
+ 43
321
+ 44
322
+ 45
323
+ 46
324
+ 47
325
+ 48
326
+ 49</pre>
327
+ </td>
328
+ <td>
329
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compiler.rb', line 21</span>
330
+
331
+ <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_kwargs'>kwargs</span><span class='rparen'>)</span>
332
+ <span class='ivar'>@compiler_exe</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'>:compiler_exe</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>nlrc.exe</span><span class='tstring_end'>&#39;</span></span>
333
+ <span class='id identifier rubyid_user_specified_path'>user_specified_path</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'>:compiler_path</span><span class='comma'>,</span> <span class='kw'>nil</span>
334
+ <span class='ivar'>@use_wine</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'>:use_wine</span><span class='comma'>,</span> <span class='kw'>false</span>
46
335
 
47
-
48
- <div id="file-metadata">
49
- <nav id="file-list-section" class="section">
50
- <h3 class="section-header">Defined In</h3>
51
- <ul>
52
- <li>lib/netlinx/compiler.rb
53
- </ul>
54
- </nav>
55
-
56
-
57
- </div>
58
-
59
- <div id="class-metadata">
60
-
61
- <nav id="parent-class-section" class="section">
62
- <h3 class="section-header">Parent</h3>
63
-
64
- <p class="link">Object
65
-
66
- </nav>
67
-
68
-
69
-
70
- <!-- Method Quickref -->
71
- <nav id="method-list-section" class="section">
72
- <h3 class="section-header">Methods</h3>
73
-
74
- <ul class="link-list">
75
-
76
- <li ><a href="#method-c-new">::new</a>
77
-
78
- <li ><a href="#method-i-compile">#compile</a>
79
-
80
- </ul>
81
- </nav>
82
-
83
- </div>
84
-
85
- <div id="project-metadata">
86
-
87
- <nav id="classindex-section" class="section project-section">
88
- <h3 class="section-header">Class and Module Index</h3>
89
-
90
- <ul class="link-list">
91
-
92
- <li><a href="../NetLinx.html">NetLinx</a>
93
-
94
- <li><a href="../NetLinx/Compile.html">NetLinx::Compile</a>
95
-
96
- <li><a href="../NetLinx/Compile/Extension.html">NetLinx::Compile::Extension</a>
97
-
98
- <li><a href="../NetLinx/Compile/Extension/AXS.html">NetLinx::Compile::Extension::AXS</a>
99
-
100
- <li><a href="../NetLinx/Compile/ExtensionDiscovery.html">NetLinx::Compile::ExtensionDiscovery</a>
101
-
102
- <li><a href="../NetLinx/Compile/ExtensionHandler.html">NetLinx::Compile::ExtensionHandler</a>
103
-
104
- <li><a href="../NetLinx/Compile/Script.html">NetLinx::Compile::Script</a>
105
-
106
- <li><a href="../NetLinx/Compiler.html">NetLinx::Compiler</a>
107
-
108
- <li><a href="../NetLinx/CompilerResult.html">NetLinx::CompilerResult</a>
109
-
110
- <li><a href="../NetLinx/NoCompilerError.html">NetLinx::NoCompilerError</a>
111
-
112
- <li><a href="../NetLinx/SourceFile.html">NetLinx::SourceFile</a>
113
-
114
- <li><a href="../Test.html">Test</a>
336
+ <span class='id identifier rubyid_default_paths'>default_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span>
337
+ <span class='id identifier rubyid_user_specified_path'>user_specified_path</span><span class='comma'>,</span>
338
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>C:\Program Files (x86)\Common Files\AMXShare\COM</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='comment'># 64-bit O/S path
339
+ </span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>C:\Program Files\Common Files\AMXShare\COM</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='comment'># 32-bit O/S path
340
+ </span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>~/.wine/drive_c/Program Files/Common Files/AMXShare/COM</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='comment'># Wine path
341
+ </span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
115
342
 
116
- <li><a href="../Test/NetLinx.html">Test::NetLinx</a>
343
+ <span class='comment'># Check for NetLinx compiler.
344
+ </span> <span class='id identifier rubyid_default_paths'>default_paths</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_path'>path</span><span class='op'>|</span>
345
+ <span class='kw'>if</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='ivar'>@compiler_exe</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
346
+ <span class='ivar'>@compiler_path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
347
+ <span class='kw'>break</span>
348
+ <span class='kw'>end</span>
349
+ <span class='kw'>end</span>
117
350
 
118
- <li><a href="../Test/NetLinx/Compilable.html">Test::NetLinx::Compilable</a>
351
+ <span class='comment'># ---------------------------------------------------------
352
+ </span> <span class='comment'># TODO: Check if the compiler was added to the system path.
353
+ </span> <span class='comment'># Execute system(@compiler_exe).
354
+ </span> <span class='comment'># ---------------------------------------------------------
355
+ </span>
356
+ <span class='comment'># Compiler not found.
357
+ </span> <span class='id identifier rubyid_raise'>raise</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="NoCompilerError.html" title="NetLinx::NoCompilerError (class)">NoCompilerError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The NetLinx compiler (</span><span class='embexpr_beg'>#{</span><span class='ivar'>@compiler_exe</span><span class='embexpr_end'>}</span><span class='tstring_content'>) could not be found on the system.</span><span class='tstring_end'>&quot;</span></span> \
358
+ <span class='kw'>unless</span> <span class='ivar'>@compiler_path</span>
359
+ <span class='kw'>end</span></pre>
360
+ </td>
361
+ </tr>
362
+ </table>
363
+ </div>
364
+
365
+ </div>
366
+
367
+
368
+ <div id="instance_method_details" class="method_details_list">
369
+ <h2>Instance Method Details</h2>
370
+
371
+
372
+ <div class="method_details first">
373
+ <h3 class="signature first" id="compile-instance_method">
374
+
375
+ #<strong>compile</strong>(compilable) &#x21d2; <tt>Object</tt>
376
+
377
+
378
+
379
+
380
+
381
+ </h3><div class="docstring">
382
+ <div class="discussion">
383
+
384
+ <p>Compile the specified object with the NetLinx compiler.</p>
385
+
386
+
387
+ </div>
388
+ </div>
389
+ <div class="tags">
390
+
391
+
392
+ <p class="tag_title">See Also:</p>
393
+ <ul class="see">
394
+
395
+ <li>Test::NetLinx::Compilable.</li>
396
+
397
+ </ul>
398
+
399
+ </div><table class="source_code">
400
+ <tr>
401
+ <td>
402
+ <pre class="lines">
403
+
404
+
405
+ 53
406
+ 54
407
+ 55
408
+ 56
409
+ 57
410
+ 58
411
+ 59
412
+ 60
413
+ 61
414
+ 62
415
+ 63
416
+ 64
417
+ 65
418
+ 66
419
+ 67
420
+ 68
421
+ 69
422
+ 70
423
+ 71
424
+ 72
425
+ 73
426
+ 74
427
+ 75
428
+ 76
429
+ 77
430
+ 78
431
+ 79
432
+ 80
433
+ 81
434
+ 82
435
+ 83
436
+ 84
437
+ 85
438
+ 86
439
+ 87
440
+ 88
441
+ 89
442
+ 90
443
+ 91
444
+ 92</pre>
445
+ </td>
446
+ <td>
447
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compiler.rb', line 53</span>
448
+
449
+ <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>
450
+ <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>
451
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
119
452
 
120
- <li><a href="../Test/NetLinx/Compile.html">Test::NetLinx::Compile</a>
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">&#39;nlrc.exe&#39;</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">&#39;C:\Program Files (x86)\Common Files\AMXShare\COM&#39;</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">&#39;nlrc.exe&#39;</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">&#39;C:\Program Files\Common Files\AMXShare\COM&#39;</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">&#39;nlrc.exe&#39;</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(&#39;nlrc&#39;).</span>
196
- <span class="ruby-comment"># ---------------------------------------------------------</span>
197
-
198
- <span class="ruby-comment"># Compiler not found.</span>
199
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">NetLinx</span><span class="ruby-operator">::</span><span class="ruby-constant">NoCompilerError</span>, <span class="ruby-string">&#39;The NetLinx compiler (nlrc.exe) could not be found on the system.&#39;</span>
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">&quot;-I#{compilable.compiler_include_paths.join &#39;;&#39;}&quot;</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>
453
+ <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>
454
+ <span class='comment'># Construct paths.
455
+ </span> <span class='id identifier rubyid_include_paths'>include_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&#39;</span><span class='tstring_content'>;</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span>
456
+ <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>
249
457
 
250
- <span class="ruby-identifier">module_paths</span> = <span class="ruby-node">&quot;-M#{compilable.compiler_module_paths.join &#39;;&#39;}&quot;</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>
458
+ <span class='id identifier rubyid_module_paths'>module_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&#39;</span><span class='tstring_content'>;</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span>
459
+ <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
460
 
253
- <span class="ruby-identifier">library_paths</span> = <span class="ruby-node">&quot;-L#{compilable.compiler_library_paths.join &#39;;&#39;}&quot;</span> <span class="ruby-keyword">unless</span>
254
- <span class="ruby-identifier">compilable</span>.<span class="ruby-identifier">compiler_library_paths</span>.<span class="ruby-identifier">empty?</span>
461
+ <span class='id identifier rubyid_library_paths'>library_paths</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&#39;</span><span class='tstring_content'>;</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span>
462
+ <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
463
 
256
- <span class="ruby-comment"># Run the NetLinx compiler.</span>
257
- <span class="ruby-identifier">io</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">popen</span> <span class="ruby-node">&quot;\&quot;#{compiler}\&quot; \&quot;#{target_file}\&quot; \&quot;#{include_paths}\&quot; \&quot;#{module_paths}\&quot; \&quot;#{library_paths}\&quot;&quot;</span>
258
- <span class="ruby-identifier">stream</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>
259
- <span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>
464
+ <span class='comment'># Run the NetLinx compiler.
465
+ </span> <span class='comment'># Note: NLRC.exe v2.1 freaks out if empty arguments (&quot;&quot;) are in the command.
466
+ </span> <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
467
+ <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>wine </span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@use_wine</span> <span class='kw'>or</span> <span class='id identifier rubyid_compiler'>compiler</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/.wine/</span><span class='tstring_end'>&#39;</span></span>
468
+ <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_compiler'>compiler</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot; \&quot;</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'>\&quot;</span><span class='tstring_end'>&quot;</span></span>
469
+ <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> \&quot;</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'>\&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_include_paths'>include_paths</span>
470
+ <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> \&quot;</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'>\&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_module_paths'>module_paths</span>
471
+ <span class='id identifier rubyid_cmd'>cmd</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> \&quot;</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'>\&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_library_paths'>library_paths</span>
260
472
 
261
- <span class="ruby-comment"># Build the result.</span>
262
- <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</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
-
473
+ <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='id identifier rubyid_cmd'>cmd</span>
474
+ <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>
475
+ <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
282
476
 
283
- </section><!-- public-instance-method-details -->
477
+ <span class='comment'># Build the result.
478
+ </span> <span class='id identifier rubyid_result'>result</span> <span class='op'>&lt;&lt;</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="CompilerResult.html" title="NetLinx::CompilerResult (class)">CompilerResult</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CompilerResult.html#initialize-instance_method" title="NetLinx::CompilerResult#initialize (method)">new</a></span></span><span class='lparen'>(</span>
479
+ <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>
480
+ <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>
481
+ <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>
482
+ <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>
483
+ <span class='label'>stream:</span> <span class='id identifier rubyid_stream'>stream</span>
484
+ <span class='rparen'>)</span>
485
+ <span class='kw'>end</span>
284
486
 
285
- </section><!-- 5Buntitled-5D -->
286
-
287
- </div><!-- documentation -->
288
-
289
-
290
- <footer id="validator-badges">
291
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
292
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.1.
293
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
294
- </footer>
295
-
487
+ <span class='id identifier rubyid_result'>result</span>
488
+ <span class='kw'>end</span></pre>
489
+ </td>
490
+ </tr>
491
+ </table>
492
+ </div>
493
+
494
+ </div>
495
+
496
+ </div>
497
+
498
+ <div id="footer">
499
+ Generated on Sat Jul 11 17:29:50 2020 by
500
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
501
+ 0.9.25 (ruby-2.7.1).
502
+ </div>
503
+
504
+ </div>
505
+ </body>
506
+ </html>