netlinx-compile 1.0.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,324 +1,527 @@
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::Compile::ExtensionDiscovery - 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::Compile::ExtensionDiscovery
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::Compile::ExtensionDiscovery";
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 (E)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span>
41
+ &raquo;
42
+ <span class="title">ExtensionDiscovery</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: NetLinx::Compile::ExtensionDiscovery
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">NetLinx::Compile::ExtensionDiscovery</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/netlinx/compile/extension_discovery.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Discovers and auto-requires add-on Ruby libraries for netlinx-compile.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#handlers-class_method" title="handlers (class method)">.<strong>handlers</strong> &#x21d2; Object </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'>
141
+ <p>An array of ExtensionHandlers installed on the system.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ </ul>
148
+
149
+
150
+
151
+
152
+
153
+ <h2>
154
+ Class Method Summary
155
+ <small><a href="#" class="summary_toggle">collapse</a></small>
156
+ </h2>
157
+
158
+ <ul class="summary">
159
+
160
+ <li class="public ">
161
+ <span class="summary_signature">
162
+
163
+ <a href="#discover-class_method" title="discover (class method)">.<strong>discover</strong> &#x21d2; Object </a>
164
+
165
+
166
+
167
+ </span>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <span class="summary_desc"><div class='inline'>
178
+ <p>Searches for gems with &#39;netlinx-compile&#39; as a dependency.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#get_handler-class_method" title="get_handler (class method)">.<strong>get_handler</strong>(filename) &#x21d2; ExtensionHandler </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'></div></span>
202
+
203
+ </li>
204
+
205
+
206
+ <li class="public ">
207
+ <span class="summary_signature">
208
+
209
+ <a href="#workspace_extensions-class_method" title="workspace_extensions (class method)">.<strong>workspace_extensions</strong> &#x21d2; Array&lt;String&gt; </a>
210
+
211
+
212
+
213
+ </span>
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <span class="summary_desc"><div class='inline'>
224
+ <p>Workspace file extensions.</p>
225
+ </div></span>
226
+
227
+ </li>
228
+
229
+
230
+ </ul>
231
+
232
+
233
+
234
+ <div id="class_attr_details" class="attr_details">
235
+ <h2>Class Attribute Details</h2>
236
+
237
+
238
+ <span id="handlers=-class_method"></span>
239
+ <div class="method_details first">
240
+ <h3 class="signature first" id="handlers-class_method">
241
+
242
+ .<strong>handlers</strong> &#x21d2; <tt>Object</tt>
243
+
244
+
245
+
246
+
247
+
248
+ </h3><div class="docstring">
249
+ <div class="discussion">
250
+
251
+ <p>An array of ExtensionHandlers installed on the system. #discover must be run before this array is populated.</p>
252
+
253
+
254
+ </div>
255
+ </div>
256
+ <div class="tags">
257
+
258
+
259
+ </div><table class="source_code">
260
+ <tr>
261
+ <td>
262
+ <pre class="lines">
263
+
264
+
265
+ 10
266
+ 11
267
+ 12</pre>
268
+ </td>
269
+ <td>
270
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compile/extension_discovery.rb', line 10</span>
271
+
272
+ <span class='kw'>def</span> <span class='id identifier rubyid_handlers'>handlers</span>
273
+ <span class='ivar'>@handlers</span>
274
+ <span class='kw'>end</span></pre>
275
+ </td>
276
+ </tr>
277
+ </table>
278
+ </div>
279
+
280
+ </div>
281
+
282
+
283
+ <div id="class_method_details" class="method_details_list">
284
+ <h2>Class Method Details</h2>
285
+
286
+
287
+ <div class="method_details first">
288
+ <h3 class="signature first" id="discover-class_method">
289
+
290
+ .<strong>discover</strong> &#x21d2; <tt>Object</tt>
291
+
292
+
293
+
294
+
295
+
296
+ </h3><div class="docstring">
297
+ <div class="discussion">
298
+
299
+ <p>Searches for gems with &#39;netlinx-compile&#39; as a dependency. The &#39;lib/netlinx/compile/extension/*&#39; path is checked for compiler extensions.</p>
300
+
301
+
302
+ </div>
303
+ </div>
304
+ <div class="tags">
305
+
306
+
307
+ </div><table class="source_code">
308
+ <tr>
309
+ <td>
310
+ <pre class="lines">
311
+
312
+
313
+ 17
314
+ 18
315
+ 19
316
+ 20
317
+ 21
318
+ 22
319
+ 23
320
+ 24
321
+ 25
322
+ 26
323
+ 27
324
+ 28
325
+ 29
326
+ 30
327
+ 31
328
+ 32
329
+ 33
330
+ 34
331
+ 35
332
+ 36
333
+ 37
334
+ 38
335
+ 39
336
+ 40
337
+ 41
338
+ 42
339
+ 43
340
+ 44</pre>
341
+ </td>
342
+ <td>
343
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compile/extension_discovery.rb', line 17</span>
344
+
345
+ <span class='kw'>def</span> <span class='id identifier rubyid_discover'>discover</span>
346
+ <span class='comment'># Require extensions built into netlinx-compile.
347
+ </span> <span class='id identifier rubyid_nc_gem'>nc_gem</span> <span class='op'>=</span> <span class='const'>Gem</span><span class='op'>::</span><span class='const'>Specification</span><span class='period'>.</span><span class='id identifier rubyid_find_by_name'>find_by_name</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>netlinx-compile</span><span class='tstring_end'>&#39;</span></span>
348
+ <span class='id identifier rubyid_nc_gem_path'>nc_gem_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='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>lib/netlinx/compile/extension</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_nc_gem'>nc_gem</span><span class='period'>.</span><span class='id identifier rubyid_gem_dir'>gem_dir</span>
349
+ <span class='id identifier rubyid_nc_gem_files'>nc_gem_files</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_nc_gem_path'>nc_gem_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*.rb</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
350
+ <span class='id identifier rubyid_nc_gem_files'>nc_gem_files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_require'>require</span> <span class='id identifier rubyid_file'>file</span><span class='rbrace'>}</span>
46
351
 
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/compile/extension_discovery.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>
352
+ <span class='comment'># Find gems with a dependency on &#39;netlinx-compile&#39;.
353
+ </span> <span class='id identifier rubyid_gems'>gems</span> <span class='op'>=</span> <span class='const'>Gem</span><span class='op'>::</span><span class='const'>Specification</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span>
354
+ <span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_gem'>gem</span><span class='op'>|</span> <span class='id identifier rubyid_gem'>gem</span><span class='period'>.</span><span class='id identifier rubyid_dependencies'>dependencies</span>
355
+ <span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_dependency'>dependency</span><span class='op'>|</span> <span class='id identifier rubyid_dependency'>dependency</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>netlinx-compile</span><span class='tstring_end'>&#39;</span></span><span class='rbrace'>}</span>
356
+ <span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>==</span> <span class='kw'>false</span>
357
+ <span class='rbrace'>}</span>
63
358
 
64
- <p class="link">Object
359
+ <span class='comment'># Load any Ruby files in their lib/netlinx/compile/extension paths.
360
+ </span> <span class='id identifier rubyid_gems'>gems</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_gem'>gem</span><span class='op'>|</span>
361
+ <span class='id identifier rubyid_extension_path'>extension_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='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>lib/netlinx/compile/extension</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_gem'>gem</span><span class='period'>.</span><span class='id identifier rubyid_gem_dir'>gem_dir</span>
362
+ <span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_extension_path'>extension_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*.rb</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
363
+ <span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_require'>require</span> <span class='id identifier rubyid_file'>file</span><span class='rbrace'>}</span>
364
+ <span class='kw'>end</span>
65
365
 
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-discover">::discover</a>
77
-
78
- <li ><a href="#method-c-get_handler">::get_handler</a>
79
-
80
- <li ><a href="#method-c-workspace_extensions">::workspace_extensions</a>
81
-
82
- </ul>
83
- </nav>
84
-
85
- </div>
86
-
87
- <div id="project-metadata">
88
-
89
- <nav id="classindex-section" class="section project-section">
90
- <h3 class="section-header">Class and Module Index</h3>
91
-
92
- <ul class="link-list">
93
-
94
- <li><a href="../../NetLinx.html">NetLinx</a>
95
-
96
- <li><a href="../../NetLinx/Compile.html">NetLinx::Compile</a>
97
-
98
- <li><a href="../../NetLinx/Compile/Extension.html">NetLinx::Compile::Extension</a>
99
-
100
- <li><a href="../../NetLinx/Compile/Extension/AXS.html">NetLinx::Compile::Extension::AXS</a>
101
-
102
- <li><a href="../../NetLinx/Compile/ExtensionDiscovery.html">NetLinx::Compile::ExtensionDiscovery</a>
103
-
104
- <li><a href="../../NetLinx/Compile/ExtensionHandler.html">NetLinx::Compile::ExtensionHandler</a>
105
-
106
- <li><a href="../../NetLinx/Compile/Script.html">NetLinx::Compile::Script</a>
107
-
108
- <li><a href="../../NetLinx/Compiler.html">NetLinx::Compiler</a>
109
-
110
- <li><a href="../../NetLinx/CompilerResult.html">NetLinx::CompilerResult</a>
111
-
112
- <li><a href="../../NetLinx/NoCompilerError.html">NetLinx::NoCompilerError</a>
113
-
114
- <li><a href="../../NetLinx/SourceFile.html">NetLinx::SourceFile</a>
115
-
116
- <li><a href="../../Test.html">Test</a>
117
-
118
- <li><a href="../../Test/NetLinx.html">Test::NetLinx</a>
119
-
120
- <li><a href="../../Test/NetLinx/Compilable.html">Test::NetLinx::Compilable</a>
121
-
122
- <li><a href="../../Test/NetLinx/Compile.html">Test::NetLinx::Compile</a>
123
-
124
- <li><a href="../../Test/NetLinx/Compile/Discoverable.html">Test::NetLinx::Compile::Discoverable</a>
125
-
126
- <li><a href="../../Test/NetLinx/Compile/Invokable.html">Test::NetLinx::Compile::Invokable</a>
127
-
128
- </ul>
129
- </nav>
130
-
131
- </div>
132
- </nav>
133
-
134
- <div id="documentation">
135
- <h1 class="class">class NetLinx::Compile::ExtensionDiscovery</h1>
136
-
137
- <div id="description" class="description">
138
-
139
- <p>Discovers and auto-requires add-on Ruby libraries for netlinx-compile.</p>
140
-
141
- </div><!-- description -->
142
-
143
-
144
-
145
-
146
- <section id="5Buntitled-5D" class="documentation-section">
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
- <!-- Attributes -->
155
- <section id="attribute-method-details" class="method-section section">
156
- <h3 class="section-header">Attributes</h3>
157
-
158
-
159
- <div id="attribute-c-handlers" class="method-detail">
160
- <div class="method-heading attribute-method-heading">
161
- <span class="method-name">handlers</span><span
162
- class="attribute-access-type">[RW]</span>
163
- </div>
164
-
165
- <div class="method-description">
166
-
167
- <p>An array of ExtensionHandlers installed on the system. discover must be run
168
- before this array is populated.</p>
169
-
170
- </div>
171
- </div>
172
-
173
- </section><!-- attribute-method-details -->
174
-
175
-
176
- <!-- Methods -->
177
-
178
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
179
- <h3 class="section-header">Public Class Methods</h3>
180
-
181
-
182
- <div id="method-c-discover" class="method-detail ">
183
-
184
- <div class="method-heading">
185
- <span class="method-name">discover</span><span
186
- class="method-args">()</span>
187
-
188
- <span class="method-click-advice">click to toggle source</span>
189
-
190
- </div>
191
-
192
-
193
- <div class="method-description">
194
-
195
- <p>Searches for gems with &#39;netlinx-compile&#39; as a dependency. The
196
- &#39;lib/netlinx/compile/extension/*&#39; path is checked for compiler
197
- extensions.</p>
198
-
199
-
200
-
201
-
202
- <div class="method-source-code" id="discover-source">
203
- <pre><span class="ruby-comment"># File lib/netlinx/compile/extension_discovery.rb, line 17</span>
204
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">discover</span>
205
- <span class="ruby-comment"># Require extensions built into netlinx-compile.</span>
206
- <span class="ruby-identifier">nc_gem</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">find_by_name</span> <span class="ruby-string">&#39;netlinx-compile&#39;</span>
207
- <span class="ruby-identifier">nc_gem_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&#39;lib/netlinx/compile/extension&#39;</span>, <span class="ruby-identifier">nc_gem</span>.<span class="ruby-identifier">gem_dir</span>
208
- <span class="ruby-identifier">nc_gem_files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{nc_gem_path}/*.rb&quot;</span>]
209
- <span class="ruby-identifier">nc_gem_files</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">file</span>}
210
-
211
- <span class="ruby-comment"># Find gems with a dependency on &#39;netlinx-compile&#39;.</span>
212
- <span class="ruby-identifier">gems</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">each</span>
213
- .<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">gem</span><span class="ruby-operator">|</span> <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">dependencies</span>
214
- .<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">dependency</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dependency</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;netlinx-compile&#39;</span>}
215
- .<span class="ruby-identifier">empty?</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span>
216
- }
217
-
218
- <span class="ruby-comment"># Load any Ruby files in their lib/netlinx/compile/extension paths.</span>
219
- <span class="ruby-identifier">gems</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gem</span><span class="ruby-operator">|</span>
220
- <span class="ruby-identifier">extension_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&#39;lib/netlinx/compile/extension&#39;</span>, <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">gem_dir</span>
221
- <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{extension_path}/*.rb&quot;</span>]
222
- <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">file</span>}
223
- <span class="ruby-keyword">end</span>
224
-
225
- <span class="ruby-comment"># Register ExtensionHandler objects.</span>
226
- <span class="ruby-ivar">@handlers</span> = <span class="ruby-constant">NetLinx</span><span class="ruby-operator">::</span><span class="ruby-constant">Compile</span><span class="ruby-operator">::</span><span class="ruby-constant">Extension</span>.<span class="ruby-identifier">constants</span>
227
- .<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-constant">NetLinx</span><span class="ruby-operator">::</span><span class="ruby-constant">Compile</span><span class="ruby-operator">::</span><span class="ruby-constant">Extension</span>.<span class="ruby-identifier">const_get</span> <span class="ruby-identifier">c</span>}
228
- .<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Class</span>}
229
- .<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">get_handler</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:get_handler</span>}
230
- .<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>}
231
- <span class="ruby-keyword">end</span></pre>
232
- </div><!-- discover-source -->
233
-
234
- </div>
235
-
236
-
237
-
238
-
239
- </div><!-- discover-method -->
240
-
241
-
242
- <div id="method-c-get_handler" class="method-detail ">
243
-
244
- <div class="method-heading">
245
- <span class="method-name">get_handler</span><span
246
- class="method-args">(filename)</span>
247
-
248
- <span class="method-click-advice">click to toggle source</span>
249
-
250
- </div>
251
-
252
-
253
- <div class="method-description">
254
-
255
- <p>Get an <a href="ExtensionHandler.html">ExtensionHandler</a> for a given
256
- file or extension.</p>
257
-
258
-
259
-
260
-
261
- <div class="method-source-code" id="get_handler-source">
262
- <pre><span class="ruby-comment"># File lib/netlinx/compile/extension_discovery.rb, line 55</span>
263
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_handler</span>(<span class="ruby-identifier">filename</span>)
264
- <span class="ruby-ivar">@handlers</span>.<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">filename</span>}.<span class="ruby-identifier">first</span>
265
- <span class="ruby-keyword">end</span></pre>
266
- </div><!-- get_handler-source -->
267
-
268
- </div>
269
-
270
-
271
-
272
-
273
- </div><!-- get_handler-method -->
274
-
275
-
276
- <div id="method-c-workspace_extensions" class="method-detail ">
277
-
278
- <div class="method-heading">
279
- <span class="method-name">workspace_extensions</span><span
280
- class="method-args">()</span>
281
-
282
- <span class="method-click-advice">click to toggle source</span>
283
-
284
- </div>
285
-
286
-
287
- <div class="method-description">
288
-
289
- <p>Returns an array of workspace file extensions.</p>
290
-
291
-
292
-
293
-
294
- <div class="method-source-code" id="workspace_extensions-source">
295
- <pre><span class="ruby-comment"># File lib/netlinx/compile/extension_discovery.rb, line 47</span>
296
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">workspace_extensions</span>
297
- <span class="ruby-ivar">@handlers</span>
298
- .<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">is_a_workspace?</span>}
299
- .<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">extensions</span>}
300
- .<span class="ruby-identifier">flatten</span>
301
- <span class="ruby-keyword">end</span></pre>
302
- </div><!-- workspace_extensions-source -->
303
-
304
- </div>
305
-
306
-
307
-
308
-
309
- </div><!-- workspace_extensions-method -->
310
-
311
-
312
- </section><!-- public-class-method-details -->
313
-
314
- </section><!-- 5Buntitled-5D -->
315
-
316
- </div><!-- documentation -->
317
-
318
-
319
- <footer id="validator-badges">
320
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
321
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.1.
322
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
323
- </footer>
324
-
366
+ <span class='comment'># Register ExtensionHandler objects.
367
+ </span> <span class='ivar'>@handlers</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Extension.html" title="NetLinx::Compile::Extension (module)">Extension</a></span></span><span class='period'>.</span><span class='id identifier rubyid_constants'>constants</span>
368
+ <span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../../NetLinx.html" title="NetLinx (module)">NetLinx</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Compile.html" title="NetLinx::Compile (module)">Compile</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Extension.html" title="NetLinx::Compile::Extension (module)">Extension</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span>
369
+ <span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Class</span><span class='rbrace'>}</span>
370
+ <span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_get_handler'>get_handler</span> <span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:get_handler</span><span class='rbrace'>}</span>
371
+ <span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='kw'>not</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span><span class='rbrace'>}</span>
372
+ <span class='kw'>end</span></pre>
373
+ </td>
374
+ </tr>
375
+ </table>
376
+ </div>
377
+
378
+ <div class="method_details ">
379
+ <h3 class="signature " id="get_handler-class_method">
380
+
381
+ .<strong>get_handler</strong>(filename) &#x21d2; <tt><span class='object_link'><a href="ExtensionHandler.html" title="NetLinx::Compile::ExtensionHandler (class)">ExtensionHandler</a></span></tt>
382
+
383
+
384
+
385
+
386
+
387
+ </h3><div class="docstring">
388
+ <div class="discussion">
389
+
390
+
391
+ </div>
392
+ </div>
393
+ <div class="tags">
394
+ <p class="tag_title">Parameters:</p>
395
+ <ul class="param">
396
+
397
+ <li>
398
+
399
+ <span class='name'>filename</span>
400
+
401
+
402
+ <span class='type'>(<tt>String</tt>)</span>
403
+
404
+
405
+
406
+ &mdash;
407
+ <div class='inline'>
408
+ <p>File or extension to find a <span class='object_link'><a href="ExtensionHandler.html" title="NetLinx::Compile::ExtensionHandler (class)">NetLinx::Compile::ExtensionHandler</a></span> for.</p>
409
+ </div>
410
+
411
+ </li>
412
+
413
+ </ul>
414
+
415
+ <p class="tag_title">Returns:</p>
416
+ <ul class="return">
417
+
418
+ <li>
419
+
420
+
421
+ <span class='type'>(<tt><span class='object_link'><a href="ExtensionHandler.html" title="NetLinx::Compile::ExtensionHandler (class)">ExtensionHandler</a></span></tt>)</span>
422
+
423
+
424
+
425
+ </li>
426
+
427
+ </ul>
428
+
429
+ </div><table class="source_code">
430
+ <tr>
431
+ <td>
432
+ <pre class="lines">
433
+
434
+
435
+ 57
436
+ 58
437
+ 59</pre>
438
+ </td>
439
+ <td>
440
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compile/extension_discovery.rb', line 57</span>
441
+
442
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_handler'>get_handler</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
443
+ <span class='ivar'>@handlers</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_filename'>filename</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
444
+ <span class='kw'>end</span></pre>
445
+ </td>
446
+ </tr>
447
+ </table>
448
+ </div>
449
+
450
+ <div class="method_details ">
451
+ <h3 class="signature " id="workspace_extensions-class_method">
452
+
453
+ .<strong>workspace_extensions</strong> &#x21d2; <tt>Array&lt;String&gt;</tt>
454
+
455
+
456
+
457
+
458
+
459
+ </h3><div class="docstring">
460
+ <div class="discussion">
461
+
462
+ <p>Returns workspace file extensions.</p>
463
+
464
+
465
+ </div>
466
+ </div>
467
+ <div class="tags">
468
+
469
+ <p class="tag_title">Returns:</p>
470
+ <ul class="return">
471
+
472
+ <li>
473
+
474
+
475
+ <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
476
+
477
+
478
+
479
+ &mdash;
480
+ <div class='inline'>
481
+ <p>workspace file extensions.</p>
482
+ </div>
483
+
484
+ </li>
485
+
486
+ </ul>
487
+
488
+ </div><table class="source_code">
489
+ <tr>
490
+ <td>
491
+ <pre class="lines">
492
+
493
+
494
+ 47
495
+ 48
496
+ 49
497
+ 50
498
+ 51
499
+ 52</pre>
500
+ </td>
501
+ <td>
502
+ <pre class="code"><span class="info file"># File 'lib/netlinx/compile/extension_discovery.rb', line 47</span>
503
+
504
+ <span class='kw'>def</span> <span class='id identifier rubyid_workspace_extensions'>workspace_extensions</span>
505
+ <span class='ivar'>@handlers</span>
506
+ <span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_is_a_workspace?'>is_a_workspace?</span><span class='rbrace'>}</span>
507
+ <span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_extensions'>extensions</span><span class='rbrace'>}</span>
508
+ <span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
509
+ <span class='kw'>end</span></pre>
510
+ </td>
511
+ </tr>
512
+ </table>
513
+ </div>
514
+
515
+ </div>
516
+
517
+ </div>
518
+
519
+ <div id="footer">
520
+ Generated on Sat Jul 11 17:29:51 2020 by
521
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
522
+ 0.9.25 (ruby-2.7.1).
523
+ </div>
524
+
525
+ </div>
526
+ </body>
527
+ </html>