tool-shed 0.0.4
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.
- data/Gemfile +9 -0
- data/LICENSE +20 -0
- data/README.md +52 -0
- data/bin/as-asset-detector +16 -0
- data/bin/as-class-detector +16 -0
- data/bin/as-docp +16 -0
- data/bin/as-manifest +16 -0
- data/bin/as-style-detector +16 -0
- data/coverage/unit/index.html +330 -0
- data/coverage/unit/jquery-1.3.2.min.js +19 -0
- data/coverage/unit/jquery.tablesorter.min.js +15 -0
- data/coverage/unit/lib-hel-asdoc_package_rb.html +447 -0
- data/coverage/unit/lib-hel-manifest_rb.html +555 -0
- data/coverage/unit/lib-hel-opts-asdoc_package_opts_rb.html +195 -0
- data/coverage/unit/lib-hel-opts-manifest_opts_rb.html +195 -0
- data/coverage/unit/lib-hel-opts-tool_opts_rb.html +531 -0
- data/coverage/unit/lib-hel-opts-unused_class_opts_rb.html +207 -0
- data/coverage/unit/lib-hel-opts-unused_style_opts_rb.html +201 -0
- data/coverage/unit/lib-hel-project_tools_rb.html +423 -0
- data/coverage/unit/lib-hel-search_rb.html +363 -0
- data/coverage/unit/lib-hel-stripper_rb.html +357 -0
- data/coverage/unit/lib-hel-tool_rb.html +423 -0
- data/coverage/unit/lib-hel-unused_class_rb.html +675 -0
- data/coverage/unit/lib-hel-unused_style_rb.html +747 -0
- data/coverage/unit/lib-hel-version_rb.html +135 -0
- data/coverage/unit/lib-hel_tools_rb.html +165 -0
- data/coverage/unit/print.css +12 -0
- data/coverage/unit/rcov.js +42 -0
- data/coverage/unit/screen.css +270 -0
- data/coverage.data +0 -0
- data/lib/shed/asdoc_package.rb +64 -0
- data/lib/shed/manifest.rb +82 -0
- data/lib/shed/opts/asdoc_package_opts.rb +22 -0
- data/lib/shed/opts/manifest_opts.rb +22 -0
- data/lib/shed/opts/tool_opts.rb +114 -0
- data/lib/shed/opts/unused_asset_opts.rb +24 -0
- data/lib/shed/opts/unused_class_opts.rb +24 -0
- data/lib/shed/opts/unused_style_opts.rb +23 -0
- data/lib/shed/project_tools.rb +60 -0
- data/lib/shed/search.rb +50 -0
- data/lib/shed/stripper.rb +49 -0
- data/lib/shed/tool.rb +60 -0
- data/lib/shed/unused_asset.rb +68 -0
- data/lib/shed/unused_class.rb +102 -0
- data/lib/shed/unused_style.rb +114 -0
- data/lib/shed/version.rb +12 -0
- data/lib/tool_shed.rb +19 -0
- data/rakefile.rb +109 -0
- data/rdoc/classes/ASDocPackage.html +281 -0
- data/rdoc/classes/ASDocPackageOpts.html +204 -0
- data/rdoc/classes/Manifest.html +323 -0
- data/rdoc/classes/ManifestOpts.html +205 -0
- data/rdoc/classes/ProjectTools.html +302 -0
- data/rdoc/classes/Search.html +203 -0
- data/rdoc/classes/Stripper.html +223 -0
- data/rdoc/classes/Tool.html +313 -0
- data/rdoc/classes/ToolOpts.html +297 -0
- data/rdoc/classes/UnusedClass.html +258 -0
- data/rdoc/classes/UnusedClassOpts.html +206 -0
- data/rdoc/classes/UnusedStyle.html +277 -0
- data/rdoc/classes/UnusedStyleOpts.html +205 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/LICENSE.html +129 -0
- data/rdoc/files/README_md.html +138 -0
- data/rdoc/files/lib/hel/asdoc_package_rb.html +107 -0
- data/rdoc/files/lib/hel/manifest_rb.html +107 -0
- data/rdoc/files/lib/hel/opts/asdoc_package_opts_rb.html +107 -0
- data/rdoc/files/lib/hel/opts/manifest_opts_rb.html +107 -0
- data/rdoc/files/lib/hel/opts/tool_opts_rb.html +114 -0
- data/rdoc/files/lib/hel/opts/unused_class_opts_rb.html +107 -0
- data/rdoc/files/lib/hel/opts/unused_style_opts_rb.html +107 -0
- data/rdoc/files/lib/hel/project_tools_rb.html +107 -0
- data/rdoc/files/lib/hel/search_rb.html +114 -0
- data/rdoc/files/lib/hel/stripper_rb.html +107 -0
- data/rdoc/files/lib/hel/tool_rb.html +107 -0
- data/rdoc/files/lib/hel/unused_class_rb.html +107 -0
- data/rdoc/files/lib/hel/unused_style_rb.html +107 -0
- data/rdoc/files/lib/hel/version_rb.html +107 -0
- data/rdoc/files/lib/hel_tools_rb.html +127 -0
- data/rdoc/fr_class_index.html +39 -0
- data/rdoc/fr_file_index.html +43 -0
- data/rdoc/fr_method_index.html +75 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/fixtures/search/App.mxml +0 -0
- data/test/fixtures/search/hide/Hidden.as +0 -0
- data/test/fixtures/search/org/helvector/Main.as +0 -0
- data/test/fixtures/src/org/helvector/Helvector.as +16 -0
- data/test/fixtures/src/org/helvector/one/HelOne.as +14 -0
- data/test/fixtures/src/org/helvector/one/HelOneTwo.mxml +0 -0
- data/test/fixtures/src/org/helvector/one/package.asdoc +1 -0
- data/test/fixtures/src/org/helvector/package.asdoc +1 -0
- data/test/fixtures/src/org/helvector/three/HelThree.as +14 -0
- data/test/fixtures/src/org/helvector/three/package.asdoc +1 -0
- data/test/fixtures/src/org/helvector/two/HelTwo.as +14 -0
- data/test/fixtures/src/org/helvector/two/package.asdoc +1 -0
- data/test/fixtures/unused-asset/assets/css/referenced.css +0 -0
- data/test/fixtures/unused-asset/assets/css/un-referenced.css +0 -0
- data/test/fixtures/unused-asset/assets/fonts/referenced.otf +0 -0
- data/test/fixtures/unused-asset/assets/fonts/un-referenced.otf +0 -0
- data/test/fixtures/unused-asset/assets/img/referenced.jpg +0 -0
- data/test/fixtures/unused-asset/assets/img/referenced.png +0 -0
- data/test/fixtures/unused-asset/assets/img/un-referenced.jpg +0 -0
- data/test/fixtures/unused-asset/assets/img/un-referenced.png +0 -0
- data/test/fixtures/unused-asset/src/org/helvector/ToolShed.as +30 -0
- data/test/fixtures/unused-cla/link-report.xml +17 -0
- data/test/fixtures/unused-cla/manifest.xml +6 -0
- data/test/fixtures/unused-cla/src/Unused.as +0 -0
- data/test/fixtures/unused-cla/src/Used.as +0 -0
- data/test/fixtures/unused-css/css/styles.css +2 -0
- data/test/fixtures/unused-css/css-multiple/more.css +2 -0
- data/test/fixtures/unused-css/css-multiple/styles.css +2 -0
- data/test/fixtures/unused-css/css-with-comments/commented.css +6 -0
- data/test/fixtures/unused-css/src/CSSApp.mxml +5 -0
- data/test/test_helper.rb +9 -0
- data/test/unit/test_asdoc_package.rb +72 -0
- data/test/unit/test_asdoc_package_opts.rb +28 -0
- data/test/unit/test_manifest.rb +53 -0
- data/test/unit/test_manifest_opts.rb +28 -0
- data/test/unit/test_search.rb +67 -0
- data/test/unit/test_source_tools.rb +97 -0
- data/test/unit/test_stripper.rb +56 -0
- data/test/unit/test_tool.rb +73 -0
- data/test/unit/test_tool_opts.rb +81 -0
- data/test/unit/test_unused_asset.rb +59 -0
- data/test/unit/test_unused_asset_opts.rb +32 -0
- data/test/unit/test_unused_class.rb +50 -0
- data/test/unit/test_unused_class_opts.rb +32 -0
- data/test/unit/test_unused_style.rb +103 -0
- data/test/unit/test_unused_style_opts.rb +31 -0
- data/tool-shed-0.0.3.gem +0 -0
- data/tool-shed.gemspec +41 -0
- metadata +265 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Tool</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Tool</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/hel/tool_rb.html">
|
|
59
|
+
lib/hel/tool.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
Abstract base class for tools. Provides basic default settings, and allows
|
|
84
|
+
control over the level of logging to standard out.
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div id="method-list">
|
|
93
|
+
<h3 class="section-bar">Methods</h3>
|
|
94
|
+
|
|
95
|
+
<div class="name-list">
|
|
96
|
+
<a href="#M000021">generated_at</a>
|
|
97
|
+
<a href="#M000018">log</a>
|
|
98
|
+
<a href="#M000016">new</a>
|
|
99
|
+
<a href="#M000017">puts</a>
|
|
100
|
+
<a href="#M000020">to_disk</a>
|
|
101
|
+
<a href="#M000019">valid_opts</a>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<!-- if includes -->
|
|
109
|
+
|
|
110
|
+
<div id="section">
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<div id="constants-list">
|
|
114
|
+
<h3 class="section-bar">Constants</h3>
|
|
115
|
+
|
|
116
|
+
<div class="name-list">
|
|
117
|
+
<table summary="Constants">
|
|
118
|
+
<tr class="top-aligned-row context-row">
|
|
119
|
+
<td class="context-item-name">INVALID_OPTS</td>
|
|
120
|
+
<td>=</td>
|
|
121
|
+
<td class="context-item-value">"Warning Invalid Options."</td>
|
|
122
|
+
</tr>
|
|
123
|
+
</table>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<!-- if method_list -->
|
|
133
|
+
<div id="methods">
|
|
134
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
135
|
+
|
|
136
|
+
<div id="method-M000016" class="method-detail">
|
|
137
|
+
<a name="M000016"></a>
|
|
138
|
+
|
|
139
|
+
<div class="method-heading">
|
|
140
|
+
<a href="#M000016" class="method-signature">
|
|
141
|
+
<span class="method-name">new</span><span class="method-args">(opt,out=STDOUT)</span>
|
|
142
|
+
</a>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div class="method-description">
|
|
146
|
+
<p><a class="source-toggle" href="#"
|
|
147
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
|
148
|
+
<div class="method-source-code" id="M000016-source">
|
|
149
|
+
<pre>
|
|
150
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 11</span>
|
|
151
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">opt</span>,<span class="ruby-identifier">out</span>=<span class="ruby-constant">STDOUT</span>)
|
|
152
|
+
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">:src</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'.'</span>
|
|
153
|
+
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">:output</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'hel-tool.txt'</span>
|
|
154
|
+
<span class="ruby-ivar">@verbose</span> = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
|
|
155
|
+
<span class="ruby-ivar">@silent</span> = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">:silent</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
|
|
156
|
+
<span class="ruby-ivar">@excludes</span> = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">:excludes</span>] <span class="ruby-operator">||</span> [<span class="ruby-value str">'.svn'</span>,<span class="ruby-value str">'.git'</span>]
|
|
157
|
+
<span class="ruby-ivar">@out</span> = <span class="ruby-identifier">out</span>
|
|
158
|
+
<span class="ruby-keyword kw">end</span>
|
|
159
|
+
</pre>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
165
|
+
|
|
166
|
+
<div id="method-M000021" class="method-detail">
|
|
167
|
+
<a name="M000021"></a>
|
|
168
|
+
|
|
169
|
+
<div class="method-heading">
|
|
170
|
+
<a href="#M000021" class="method-signature">
|
|
171
|
+
<span class="method-name">generated_at</span><span class="method-args">()</span>
|
|
172
|
+
</a>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div class="method-description">
|
|
176
|
+
<p>
|
|
177
|
+
Generate a timestamp to include in reports.
|
|
178
|
+
</p>
|
|
179
|
+
<p><a class="source-toggle" href="#"
|
|
180
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
|
181
|
+
<div class="method-source-code" id="M000021-source">
|
|
182
|
+
<pre>
|
|
183
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 56</span>
|
|
184
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generated_at</span>
|
|
185
|
+
<span class="ruby-value str">"Generated at"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">" [%m/%d/%Y %H:%M:%S] "</span>)
|
|
186
|
+
<span class="ruby-keyword kw">end</span>
|
|
187
|
+
</pre>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<div id="method-M000018" class="method-detail">
|
|
193
|
+
<a name="M000018"></a>
|
|
194
|
+
|
|
195
|
+
<div class="method-heading">
|
|
196
|
+
<a href="#M000018" class="method-signature">
|
|
197
|
+
<span class="method-name">log</span><span class="method-args">(msg)</span>
|
|
198
|
+
</a>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div class="method-description">
|
|
202
|
+
<p>
|
|
203
|
+
Puts the message if we are in verbose mode (but not in silent mode).
|
|
204
|
+
</p>
|
|
205
|
+
<p><a class="source-toggle" href="#"
|
|
206
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
|
207
|
+
<div class="method-source-code" id="M000018-source">
|
|
208
|
+
<pre>
|
|
209
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 30</span>
|
|
210
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">msg</span>)
|
|
211
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@verbose</span>
|
|
212
|
+
<span class="ruby-keyword kw">end</span>
|
|
213
|
+
</pre>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div id="method-M000017" class="method-detail">
|
|
219
|
+
<a name="M000017"></a>
|
|
220
|
+
|
|
221
|
+
<div class="method-heading">
|
|
222
|
+
<a href="#M000017" class="method-signature">
|
|
223
|
+
<span class="method-name">puts</span><span class="method-args">(msg)</span>
|
|
224
|
+
</a>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div class="method-description">
|
|
228
|
+
<p>
|
|
229
|
+
Puts the message unless we are in silent mode.
|
|
230
|
+
</p>
|
|
231
|
+
<p><a class="source-toggle" href="#"
|
|
232
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
|
233
|
+
<div class="method-source-code" id="M000017-source">
|
|
234
|
+
<pre>
|
|
235
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 23</span>
|
|
236
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-identifier">msg</span>)
|
|
237
|
+
<span class="ruby-ivar">@out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@silent</span>
|
|
238
|
+
<span class="ruby-keyword kw">end</span>
|
|
239
|
+
</pre>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div id="method-M000020" class="method-detail">
|
|
245
|
+
<a name="M000020"></a>
|
|
246
|
+
|
|
247
|
+
<div class="method-heading">
|
|
248
|
+
<a href="#M000020" class="method-signature">
|
|
249
|
+
<span class="method-name">to_disk</span><span class="method-args">(str)</span>
|
|
250
|
+
</a>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<div class="method-description">
|
|
254
|
+
<p>
|
|
255
|
+
Write the requested string to the output file.
|
|
256
|
+
</p>
|
|
257
|
+
<p><a class="source-toggle" href="#"
|
|
258
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
|
259
|
+
<div class="method-source-code" id="M000020-source">
|
|
260
|
+
<pre>
|
|
261
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 44</span>
|
|
262
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_disk</span>(<span class="ruby-identifier">str</span>)
|
|
263
|
+
<span class="ruby-identifier">f</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-ivar">@output</span>, <span class="ruby-value str">"w"</span>)
|
|
264
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str</span>
|
|
265
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">flush</span>
|
|
266
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>
|
|
267
|
+
|
|
268
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">"Saved result to #{File.expand_path(@output)}."</span>
|
|
269
|
+
<span class="ruby-keyword kw">end</span>
|
|
270
|
+
</pre>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<div id="method-M000019" class="method-detail">
|
|
276
|
+
<a name="M000019"></a>
|
|
277
|
+
|
|
278
|
+
<div class="method-heading">
|
|
279
|
+
<a href="#M000019" class="method-signature">
|
|
280
|
+
<span class="method-name">valid_opts</span><span class="method-args">()</span>
|
|
281
|
+
</a>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<div class="method-description">
|
|
285
|
+
<p>
|
|
286
|
+
Validates the opts the tool has been invoked with.
|
|
287
|
+
</p>
|
|
288
|
+
<p><a class="source-toggle" href="#"
|
|
289
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
|
290
|
+
<div class="method-source-code" id="M000019-source">
|
|
291
|
+
<pre>
|
|
292
|
+
<span class="ruby-comment cmt"># File lib/hel/tool.rb, line 37</span>
|
|
293
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_opts</span>
|
|
294
|
+
<span class="ruby-keyword kw">true</span>
|
|
295
|
+
<span class="ruby-keyword kw">end</span>
|
|
296
|
+
</pre>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
<div id="validator-badges">
|
|
309
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
</body>
|
|
313
|
+
</html>
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: ToolOpts</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">ToolOpts</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/hel/opts/tool_opts_rb.html">
|
|
59
|
+
lib/hel/opts/tool_opts.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
Abstract layer for the helvector tools options parsers. This sets the basic
|
|
84
|
+
paramaters the tools respond to via the command line.
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div id="method-list">
|
|
93
|
+
<h3 class="section-bar">Methods</h3>
|
|
94
|
+
|
|
95
|
+
<div class="name-list">
|
|
96
|
+
<a href="#M000004">default_config</a>
|
|
97
|
+
<a href="#M000002">description</a>
|
|
98
|
+
<a href="#M000001">name</a>
|
|
99
|
+
<a href="#M000005">parse</a>
|
|
100
|
+
<a href="#M000003">version</a>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<!-- if includes -->
|
|
108
|
+
|
|
109
|
+
<div id="section">
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<!-- if method_list -->
|
|
119
|
+
<div id="methods">
|
|
120
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
121
|
+
|
|
122
|
+
<div id="method-M000004" class="method-detail">
|
|
123
|
+
<a name="M000004"></a>
|
|
124
|
+
|
|
125
|
+
<div class="method-heading">
|
|
126
|
+
<a href="#M000004" class="method-signature">
|
|
127
|
+
<span class="method-name">default_config</span><span class="method-args">()</span>
|
|
128
|
+
</a>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="method-description">
|
|
132
|
+
<p><a class="source-toggle" href="#"
|
|
133
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
134
|
+
<div class="method-source-code" id="M000004-source">
|
|
135
|
+
<pre>
|
|
136
|
+
<span class="ruby-comment cmt"># File lib/hel/opts/tool_opts.rb, line 23</span>
|
|
137
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_config</span>
|
|
138
|
+
{
|
|
139
|
+
<span class="ruby-identifier">:src</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"."</span>,
|
|
140
|
+
<span class="ruby-identifier">:output</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'output.xml'</span>,
|
|
141
|
+
<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>,
|
|
142
|
+
<span class="ruby-identifier">:silent</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>
|
|
143
|
+
}
|
|
144
|
+
<span class="ruby-keyword kw">end</span>
|
|
145
|
+
</pre>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<div id="method-M000002" class="method-detail">
|
|
151
|
+
<a name="M000002"></a>
|
|
152
|
+
|
|
153
|
+
<div class="method-heading">
|
|
154
|
+
<a href="#M000002" class="method-signature">
|
|
155
|
+
<span class="method-name">description</span><span class="method-args">()</span>
|
|
156
|
+
</a>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="method-description">
|
|
160
|
+
<p><a class="source-toggle" href="#"
|
|
161
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
162
|
+
<div class="method-source-code" id="M000002-source">
|
|
163
|
+
<pre>
|
|
164
|
+
<span class="ruby-comment cmt"># File lib/hel/opts/tool_opts.rb, line 15</span>
|
|
165
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">description</span>
|
|
166
|
+
<span class="ruby-value str">'Helvector Tool'</span>
|
|
167
|
+
<span class="ruby-keyword kw">end</span>
|
|
168
|
+
</pre>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div id="method-M000001" class="method-detail">
|
|
174
|
+
<a name="M000001"></a>
|
|
175
|
+
|
|
176
|
+
<div class="method-heading">
|
|
177
|
+
<a href="#M000001" class="method-signature">
|
|
178
|
+
<span class="method-name">name</span><span class="method-args">()</span>
|
|
179
|
+
</a>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div class="method-description">
|
|
183
|
+
<p><a class="source-toggle" href="#"
|
|
184
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
185
|
+
<div class="method-source-code" id="M000001-source">
|
|
186
|
+
<pre>
|
|
187
|
+
<span class="ruby-comment cmt"># File lib/hel/opts/tool_opts.rb, line 11</span>
|
|
188
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>
|
|
189
|
+
<span class="ruby-constant">HelTool</span><span class="ruby-operator">::</span><span class="ruby-constant">NAME</span>
|
|
190
|
+
<span class="ruby-keyword kw">end</span>
|
|
191
|
+
</pre>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<div id="method-M000005" class="method-detail">
|
|
197
|
+
<a name="M000005"></a>
|
|
198
|
+
|
|
199
|
+
<div class="method-heading">
|
|
200
|
+
<a href="#M000005" class="method-signature">
|
|
201
|
+
<span class="method-name">parse</span><span class="method-args">(args,out=STDOUT)</span>
|
|
202
|
+
</a>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<div class="method-description">
|
|
206
|
+
<p>
|
|
207
|
+
<a
|
|
208
|
+
href="http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html">ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html</a>
|
|
209
|
+
</p>
|
|
210
|
+
<p><a class="source-toggle" href="#"
|
|
211
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
212
|
+
<div class="method-source-code" id="M000005-source">
|
|
213
|
+
<pre>
|
|
214
|
+
<span class="ruby-comment cmt"># File lib/hel/opts/tool_opts.rb, line 35</span>
|
|
215
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>,<span class="ruby-identifier">out</span>=<span class="ruby-constant">STDOUT</span>)
|
|
216
|
+
<span class="ruby-identifier">config</span> = <span class="ruby-identifier">default_config</span>
|
|
217
|
+
|
|
218
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
|
|
219
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-node">"Usage: #{name} [options]"</span>
|
|
220
|
+
|
|
221
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">""</span>
|
|
222
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">"Options:"</span>
|
|
223
|
+
|
|
224
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"--source [PATH]"</span>, <span class="ruby-constant">String</span>,
|
|
225
|
+
<span class="ruby-value str">"Path to source folder, defaults to current directory."</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
226
|
+
<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-identifier">v</span>
|
|
227
|
+
<span class="ruby-keyword kw">end</span>
|
|
228
|
+
|
|
229
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-o"</span>, <span class="ruby-value str">"--output [PATH]"</span>, <span class="ruby-constant">String</span>,
|
|
230
|
+
<span class="ruby-node">"Path to output XML file, defaults to #{config[:output]}"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
231
|
+
<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:output</span>] = <span class="ruby-identifier">v</span>
|
|
232
|
+
<span class="ruby-keyword kw">end</span>
|
|
233
|
+
|
|
234
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-v"</span>, <span class="ruby-value str">"--verbose"</span>, <span class="ruby-value str">"Run verbosely"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
235
|
+
<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:verbose</span>] = <span class="ruby-identifier">v</span>
|
|
236
|
+
<span class="ruby-keyword kw">end</span>
|
|
237
|
+
|
|
238
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"--silent"</span>, <span class="ruby-value str">"Supress all output."</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
239
|
+
<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:silent</span>] = <span class="ruby-identifier">v</span>
|
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
|
241
|
+
|
|
242
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on_tail</span>(<span class="ruby-value str">"-h"</span>, <span class="ruby-value str">"--help"</span>, <span class="ruby-value str">"Show this message"</span>) <span class="ruby-keyword kw">do</span>
|
|
243
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">opts</span>
|
|
244
|
+
<span class="ruby-identifier">exit</span>
|
|
245
|
+
<span class="ruby-keyword kw">end</span>
|
|
246
|
+
|
|
247
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on_tail</span>(<span class="ruby-value str">"--version"</span>, <span class="ruby-value str">"Show version"</span>) <span class="ruby-keyword kw">do</span>
|
|
248
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{description} version #{version}"</span>
|
|
249
|
+
<span class="ruby-identifier">exit</span>
|
|
250
|
+
<span class="ruby-keyword kw">end</span>
|
|
251
|
+
<span class="ruby-keyword kw">end</span>
|
|
252
|
+
|
|
253
|
+
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">parse!</span>(<span class="ruby-identifier">args</span>)
|
|
254
|
+
|
|
255
|
+
<span class="ruby-identifier">config</span>
|
|
256
|
+
<span class="ruby-keyword kw">end</span>
|
|
257
|
+
</pre>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<div id="method-M000003" class="method-detail">
|
|
263
|
+
<a name="M000003"></a>
|
|
264
|
+
|
|
265
|
+
<div class="method-heading">
|
|
266
|
+
<a href="#M000003" class="method-signature">
|
|
267
|
+
<span class="method-name">version</span><span class="method-args">()</span>
|
|
268
|
+
</a>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div class="method-description">
|
|
272
|
+
<p><a class="source-toggle" href="#"
|
|
273
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
274
|
+
<div class="method-source-code" id="M000003-source">
|
|
275
|
+
<pre>
|
|
276
|
+
<span class="ruby-comment cmt"># File lib/hel/opts/tool_opts.rb, line 19</span>
|
|
277
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>
|
|
278
|
+
<span class="ruby-constant">HelTool</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span><span class="ruby-operator">::</span><span class="ruby-constant">STRING</span>
|
|
279
|
+
<span class="ruby-keyword kw">end</span>
|
|
280
|
+
</pre>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
<div id="validator-badges">
|
|
293
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
</body>
|
|
297
|
+
</html>
|