netlinx-compile 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/README.txt +2 -0
  3. data/bin/netlinx-compile +4 -0
  4. data/doc/NetLinx.html +151 -0
  5. data/doc/NetLinx/Compile.html +148 -0
  6. data/doc/NetLinx/Compile/Extension.html +145 -0
  7. data/doc/NetLinx/Compile/Extension/AXS.html +154 -0
  8. data/doc/NetLinx/Compile/ExtensionDiscovery.html +324 -0
  9. data/doc/NetLinx/Compile/ExtensionHandler.html +396 -0
  10. data/doc/NetLinx/Compile/Script.html +293 -0
  11. data/doc/NetLinx/Compiler.html +295 -0
  12. data/doc/NetLinx/CompilerResult.html +501 -0
  13. data/doc/NetLinx/NoCompilerError.html +155 -0
  14. data/doc/NetLinx/SourceFile.html +430 -0
  15. data/doc/Test.html +147 -0
  16. data/doc/Test/NetLinx.html +147 -0
  17. data/doc/Test/NetLinx/Compilable.html +148 -0
  18. data/doc/Test/NetLinx/Compile.html +146 -0
  19. data/doc/Test/NetLinx/Compile/Discoverable.html +148 -0
  20. data/doc/Test/NetLinx/Compile/Invokable.html +149 -0
  21. data/doc/created.rid +12 -0
  22. data/doc/images/add.png +0 -0
  23. data/doc/images/arrow_up.png +0 -0
  24. data/doc/images/brick.png +0 -0
  25. data/doc/images/brick_link.png +0 -0
  26. data/doc/images/bug.png +0 -0
  27. data/doc/images/bullet_black.png +0 -0
  28. data/doc/images/bullet_toggle_minus.png +0 -0
  29. data/doc/images/bullet_toggle_plus.png +0 -0
  30. data/doc/images/date.png +0 -0
  31. data/doc/images/delete.png +0 -0
  32. data/doc/images/find.png +0 -0
  33. data/doc/images/loadingAnimation.gif +0 -0
  34. data/doc/images/macFFBgHack.png +0 -0
  35. data/doc/images/package.png +0 -0
  36. data/doc/images/page_green.png +0 -0
  37. data/doc/images/page_white_text.png +0 -0
  38. data/doc/images/page_white_width.png +0 -0
  39. data/doc/images/plugin.png +0 -0
  40. data/doc/images/ruby.png +0 -0
  41. data/doc/images/tag_blue.png +0 -0
  42. data/doc/images/tag_green.png +0 -0
  43. data/doc/images/transparent.png +0 -0
  44. data/doc/images/wrench.png +0 -0
  45. data/doc/images/wrench_orange.png +0 -0
  46. data/doc/images/zoom.png +0 -0
  47. data/doc/index.html +103 -0
  48. data/doc/js/darkfish.js +155 -0
  49. data/doc/js/jquery.js +18 -0
  50. data/doc/js/navigation.js +142 -0
  51. data/doc/js/search.js +94 -0
  52. data/doc/js/search_index.js +1 -0
  53. data/doc/js/searcher.js +228 -0
  54. data/doc/rdoc.css +595 -0
  55. data/doc/table_of_contents.html +138 -0
  56. data/lib/netlinx-compile.rb +1 -0
  57. data/lib/netlinx/compile/extension/axs.rb +18 -0
  58. data/lib/netlinx/compile/extension_discovery.rb +62 -0
  59. data/lib/netlinx/compile/extension_handler.rb +86 -0
  60. data/lib/netlinx/compile/script.rb +115 -0
  61. data/lib/netlinx/compiler.rb +71 -0
  62. data/lib/netlinx/compiler_result.rb +72 -0
  63. data/lib/netlinx/source_file.rb +78 -0
  64. data/lib/test/netlinx/compilable.rb +48 -0
  65. data/lib/test/netlinx/compile/discoverable.rb +14 -0
  66. data/lib/test/netlinx/compile/invokable.rb +15 -0
  67. data/license.txt +13 -0
  68. metadata +156 -0
@@ -0,0 +1,295 @@
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
+
46
+
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>
115
+
116
+ <li><a href="../Test/NetLinx.html">Test::NetLinx</a>
117
+
118
+ <li><a href="../Test/NetLinx/Compilable.html">Test::NetLinx::Compilable</a>
119
+
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>
249
+
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>
252
+
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>
255
+
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>
260
+
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
+
282
+
283
+ </section><!-- public-instance-method-details -->
284
+
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
+
@@ -0,0 +1,501 @@
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::CompilerResult - 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
+
46
+
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_result.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-error_items">#error_items</a>
79
+
80
+ <li ><a href="#method-i-success-3F">#success?</a>
81
+
82
+ <li ><a href="#method-i-target_file">#target_file</a>
83
+
84
+ <li ><a href="#method-i-to_s">#to_s</a>
85
+
86
+ <li ><a href="#method-i-warning_items">#warning_items</a>
87
+
88
+ </ul>
89
+ </nav>
90
+
91
+ </div>
92
+
93
+ <div id="project-metadata">
94
+
95
+ <nav id="classindex-section" class="section project-section">
96
+ <h3 class="section-header">Class and Module Index</h3>
97
+
98
+ <ul class="link-list">
99
+
100
+ <li><a href="../NetLinx.html">NetLinx</a>
101
+
102
+ <li><a href="../NetLinx/Compile.html">NetLinx::Compile</a>
103
+
104
+ <li><a href="../NetLinx/Compile/Extension.html">NetLinx::Compile::Extension</a>
105
+
106
+ <li><a href="../NetLinx/Compile/Extension/AXS.html">NetLinx::Compile::Extension::AXS</a>
107
+
108
+ <li><a href="../NetLinx/Compile/ExtensionDiscovery.html">NetLinx::Compile::ExtensionDiscovery</a>
109
+
110
+ <li><a href="../NetLinx/Compile/ExtensionHandler.html">NetLinx::Compile::ExtensionHandler</a>
111
+
112
+ <li><a href="../NetLinx/Compile/Script.html">NetLinx::Compile::Script</a>
113
+
114
+ <li><a href="../NetLinx/Compiler.html">NetLinx::Compiler</a>
115
+
116
+ <li><a href="../NetLinx/CompilerResult.html">NetLinx::CompilerResult</a>
117
+
118
+ <li><a href="../NetLinx/NoCompilerError.html">NetLinx::NoCompilerError</a>
119
+
120
+ <li><a href="../NetLinx/SourceFile.html">NetLinx::SourceFile</a>
121
+
122
+ <li><a href="../Test.html">Test</a>
123
+
124
+ <li><a href="../Test/NetLinx.html">Test::NetLinx</a>
125
+
126
+ <li><a href="../Test/NetLinx/Compilable.html">Test::NetLinx::Compilable</a>
127
+
128
+ <li><a href="../Test/NetLinx/Compile.html">Test::NetLinx::Compile</a>
129
+
130
+ <li><a href="../Test/NetLinx/Compile/Discoverable.html">Test::NetLinx::Compile::Discoverable</a>
131
+
132
+ <li><a href="../Test/NetLinx/Compile/Invokable.html">Test::NetLinx::Compile::Invokable</a>
133
+
134
+ </ul>
135
+ </nav>
136
+
137
+ </div>
138
+ </nav>
139
+
140
+ <div id="documentation">
141
+ <h1 class="class">class NetLinx::CompilerResult</h1>
142
+
143
+ <div id="description" class="description">
144
+
145
+ <p>Contains info pertaining to a job run through the compiler.</p>
146
+
147
+ </div><!-- description -->
148
+
149
+
150
+
151
+
152
+ <section id="5Buntitled-5D" class="documentation-section">
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <!-- Attributes -->
161
+ <section id="attribute-method-details" class="method-section section">
162
+ <h3 class="section-header">Attributes</h3>
163
+
164
+
165
+ <div id="attribute-i-compiler_include_paths" class="method-detail">
166
+ <div class="method-heading attribute-method-heading">
167
+ <span class="method-name">compiler_include_paths</span><span
168
+ class="attribute-access-type">[R]</span>
169
+ </div>
170
+
171
+ <div class="method-description">
172
+
173
+ <p>See Compilable interface.</p>
174
+
175
+ </div>
176
+ </div>
177
+
178
+ <div id="attribute-i-compiler_library_paths" class="method-detail">
179
+ <div class="method-heading attribute-method-heading">
180
+ <span class="method-name">compiler_library_paths</span><span
181
+ class="attribute-access-type">[R]</span>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+
186
+ <p>See Compilable interface.</p>
187
+
188
+ </div>
189
+ </div>
190
+
191
+ <div id="attribute-i-compiler_module_paths" class="method-detail">
192
+ <div class="method-heading attribute-method-heading">
193
+ <span class="method-name">compiler_module_paths</span><span
194
+ class="attribute-access-type">[R]</span>
195
+ </div>
196
+
197
+ <div class="method-description">
198
+
199
+ <p>See Compilable interface.</p>
200
+
201
+ </div>
202
+ </div>
203
+
204
+ <div id="attribute-i-compiler_target_files" class="method-detail">
205
+ <div class="method-heading attribute-method-heading">
206
+ <span class="method-name">compiler_target_files</span><span
207
+ class="attribute-access-type">[R]</span>
208
+ </div>
209
+
210
+ <div class="method-description">
211
+
212
+ <p>See Compilable interface.</p>
213
+
214
+ </div>
215
+ </div>
216
+
217
+ <div id="attribute-i-errors" class="method-detail">
218
+ <div class="method-heading attribute-method-heading">
219
+ <span class="method-name">errors</span><span
220
+ class="attribute-access-type">[R]</span>
221
+ </div>
222
+
223
+ <div class="method-description">
224
+
225
+ <p>Number of compiler errors.</p>
226
+
227
+ </div>
228
+ </div>
229
+
230
+ <div id="attribute-i-stream" class="method-detail">
231
+ <div class="method-heading attribute-method-heading">
232
+ <span class="method-name">stream</span><span
233
+ class="attribute-access-type">[R]</span>
234
+ </div>
235
+
236
+ <div class="method-description">
237
+
238
+ <p>The raw stream of text returned by the compiler.</p>
239
+
240
+ </div>
241
+ </div>
242
+
243
+ <div id="attribute-i-warnings" class="method-detail">
244
+ <div class="method-heading attribute-method-heading">
245
+ <span class="method-name">warnings</span><span
246
+ class="attribute-access-type">[R]</span>
247
+ </div>
248
+
249
+ <div class="method-description">
250
+
251
+ <p>Number of compiler warnings.</p>
252
+
253
+ </div>
254
+ </div>
255
+
256
+ </section><!-- attribute-method-details -->
257
+
258
+
259
+ <!-- Methods -->
260
+
261
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
262
+ <h3 class="section-header">Public Class Methods</h3>
263
+
264
+
265
+ <div id="method-c-new" class="method-detail ">
266
+
267
+ <div class="method-heading">
268
+ <span class="method-name">new</span><span
269
+ class="method-args">(**kvargs)</span>
270
+
271
+ <span class="method-click-advice">click to toggle source</span>
272
+
273
+ </div>
274
+
275
+
276
+ <div class="method-description">
277
+
278
+ <p>Args:</p>
279
+
280
+ <pre>stream -- The raw stream of text returned by the compiler.
281
+ compiler_target_files -- See Compilable interface.
282
+ compiler_include_paths -- See Compilable interface.
283
+ compiler_module_paths -- See Compilable interface.
284
+ compiler_library_paths -- See Compilable interface.</pre>
285
+
286
+
287
+
288
+
289
+ <div class="method-source-code" id="new-source">
290
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 28</span>
291
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">kvargs</span>)
292
+ <span class="ruby-ivar">@stream</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:stream</span>, <span class="ruby-string">&#39;&#39;</span>
293
+
294
+ <span class="ruby-ivar">@compiler_target_files</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:compiler_target_files</span>, []
295
+ <span class="ruby-ivar">@compiler_include_paths</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:compiler_include_paths</span>, []
296
+ <span class="ruby-ivar">@compiler_module_paths</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:compiler_module_paths</span>, []
297
+ <span class="ruby-ivar">@compiler_library_paths</span> = <span class="ruby-identifier">kvargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:compiler_library_paths</span>, []
298
+
299
+ <span class="ruby-comment"># Capture error and warning counts.</span>
300
+ <span class="ruby-ivar">@errors</span> = <span class="ruby-keyword">nil</span>
301
+ <span class="ruby-ivar">@warnings</span> = <span class="ruby-keyword">nil</span>
302
+
303
+ <span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">scan</span> <span class="ruby-regexp">/(\d+) error\(s\), (\d+) warning\(s\)/</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span>, <span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
304
+ <span class="ruby-ivar">@errors</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">e</span>
305
+ <span class="ruby-ivar">@warnings</span> = <span class="ruby-identifier">w</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">w</span>
306
+ <span class="ruby-keyword">end</span>
307
+ <span class="ruby-keyword">end</span></pre>
308
+ </div><!-- new-source -->
309
+
310
+ </div>
311
+
312
+
313
+
314
+
315
+ </div><!-- new-method -->
316
+
317
+
318
+ </section><!-- public-class-method-details -->
319
+
320
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
321
+ <h3 class="section-header">Public Instance Methods</h3>
322
+
323
+
324
+ <div id="method-i-error_items" class="method-detail ">
325
+
326
+ <div class="method-heading">
327
+ <span class="method-name">error_items</span><span
328
+ class="method-args">()</span>
329
+
330
+ <span class="method-click-advice">click to toggle source</span>
331
+
332
+ </div>
333
+
334
+
335
+ <div class="method-description">
336
+
337
+ <p>An enumerable list of errors.</p>
338
+
339
+
340
+
341
+
342
+ <div class="method-source-code" id="error_items-source">
343
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 67</span>
344
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">error_items</span>
345
+ <span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp">/(^ERROR: .*$)/</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">first</span>}
346
+ <span class="ruby-keyword">end</span></pre>
347
+ </div><!-- error_items-source -->
348
+
349
+ </div>
350
+
351
+
352
+
353
+
354
+ </div><!-- error_items-method -->
355
+
356
+
357
+ <div id="method-i-success-3F" class="method-detail ">
358
+
359
+ <div class="method-heading">
360
+ <span class="method-name">success?</span><span
361
+ class="method-args">()</span>
362
+
363
+ <span class="method-click-advice">click to toggle source</span>
364
+
365
+ </div>
366
+
367
+
368
+ <div class="method-description">
369
+
370
+ <p><a href="Compile.html">Compile</a> was successful?</p>
371
+
372
+
373
+
374
+
375
+ <div class="method-source-code" id="success-3F-source">
376
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 57</span>
377
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">success?</span>
378
+ <span class="ruby-ivar">@errors</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@warnings</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
379
+ <span class="ruby-keyword">end</span></pre>
380
+ </div><!-- success-3F-source -->
381
+
382
+ </div>
383
+
384
+
385
+
386
+
387
+ </div><!-- success-3F-method -->
388
+
389
+
390
+ <div id="method-i-target_file" class="method-detail ">
391
+
392
+ <div class="method-heading">
393
+ <span class="method-name">target_file</span><span
394
+ class="method-args">()</span>
395
+
396
+ <span class="method-click-advice">click to toggle source</span>
397
+
398
+ </div>
399
+
400
+
401
+ <div class="method-description">
402
+
403
+ <p>Returns the absolute path of the source code file that was compiled.</p>
404
+
405
+
406
+
407
+
408
+ <div class="method-source-code" id="target_file-source">
409
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 52</span>
410
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">target_file</span>
411
+ <span class="ruby-ivar">@compiler_target_files</span>.<span class="ruby-identifier">first</span>
412
+ <span class="ruby-keyword">end</span></pre>
413
+ </div><!-- target_file-source -->
414
+
415
+ </div>
416
+
417
+
418
+
419
+
420
+ </div><!-- target_file-method -->
421
+
422
+
423
+ <div id="method-i-to_s" class="method-detail ">
424
+
425
+ <div class="method-heading">
426
+ <span class="method-name">to_s</span><span
427
+ class="method-args">()</span>
428
+
429
+ <span class="method-click-advice">click to toggle source</span>
430
+
431
+ </div>
432
+
433
+
434
+ <div class="method-description">
435
+
436
+ <p>Alias of <a href="CompilerResult.html#attribute-i-stream">stream</a>.</p>
437
+
438
+
439
+
440
+
441
+ <div class="method-source-code" id="to_s-source">
442
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 47</span>
443
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
444
+ <span class="ruby-ivar">@stream</span>
445
+ <span class="ruby-keyword">end</span></pre>
446
+ </div><!-- to_s-source -->
447
+
448
+ </div>
449
+
450
+
451
+
452
+
453
+ </div><!-- to_s-method -->
454
+
455
+
456
+ <div id="method-i-warning_items" class="method-detail ">
457
+
458
+ <div class="method-heading">
459
+ <span class="method-name">warning_items</span><span
460
+ class="method-args">()</span>
461
+
462
+ <span class="method-click-advice">click to toggle source</span>
463
+
464
+ </div>
465
+
466
+
467
+ <div class="method-description">
468
+
469
+ <p>An enumerable list of warnings.</p>
470
+
471
+
472
+
473
+
474
+ <div class="method-source-code" id="warning_items-source">
475
+ <pre><span class="ruby-comment"># File lib/netlinx/compiler_result.rb, line 62</span>
476
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">warning_items</span>
477
+ <span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp">/(^WARNING: .*$)/</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">first</span>}
478
+ <span class="ruby-keyword">end</span></pre>
479
+ </div><!-- warning_items-source -->
480
+
481
+ </div>
482
+
483
+
484
+
485
+
486
+ </div><!-- warning_items-method -->
487
+
488
+
489
+ </section><!-- public-instance-method-details -->
490
+
491
+ </section><!-- 5Buntitled-5D -->
492
+
493
+ </div><!-- documentation -->
494
+
495
+
496
+ <footer id="validator-badges">
497
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
498
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.1.
499
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
500
+ </footer>
501
+