dtf 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/doc/AnalysisCase.html +1 -1
- data/doc/CaseTest.html +1 -1
- data/doc/Dtf.html +5 -3
- data/doc/Dtf/Command.html +30 -546
- data/doc/Dtf/Command/CreateUser.html +320 -0
- data/doc/Dtf/Command/CreateVs.html +311 -0
- data/doc/Dtf/Command/DeleteUser.html +354 -0
- data/doc/Dtf/Command/DeleteVs.html +296 -0
- data/doc/Dtf/Command/SetupDtf.html +293 -0
- data/doc/Dtf/ErrorSystem.html +15 -19
- data/doc/Dtf/OptionsParser.html +73 -65
- data/doc/User.html +1 -1
- data/doc/VerificationSuite.html +1 -1
- data/doc/_index.html +48 -2
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +5 -1
- data/doc/index.html +5 -1
- data/doc/method_list.html +61 -13
- data/doc/top-level-namespace.html +1 -1
- data/lib/dtf.rb +4 -3
- data/lib/dtf/version.rb +1 -1
- metadata +6 -1
data/README.md
CHANGED
@@ -184,4 +184,8 @@ Options:
|
|
184
184
|
--help, -h: Show this message
|
185
185
|
```
|
186
186
|
|
187
|
+
An unlisted command is 'setup_dtf'. This command is for use by sub-gems in the DTF framework.
|
188
|
+
It copies the thor task from DTF's master gem 'dtf' to the proper directory in the sub-gem, or
|
189
|
+
a project that makes use of the dtf master gem. It is referenced, but not shown here, for that reason.
|
190
|
+
|
187
191
|
Enjoy!
|
data/doc/AnalysisCase.html
CHANGED
@@ -129,7 +129,7 @@ AnalysisCase</p>
|
|
129
129
|
</div>
|
130
130
|
|
131
131
|
<div id="footer">
|
132
|
-
Generated on
|
132
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
133
133
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
134
134
|
0.8.2.1 (ruby-1.9.3).
|
135
135
|
</div>
|
data/doc/CaseTest.html
CHANGED
@@ -126,7 +126,7 @@
|
|
126
126
|
</div>
|
127
127
|
|
128
128
|
<div id="footer">
|
129
|
-
Generated on
|
129
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
130
130
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
131
131
|
0.8.2.1 (ruby-1.9.3).
|
132
132
|
</div>
|
data/doc/Dtf.html
CHANGED
@@ -90,9 +90,11 @@
|
|
90
90
|
<p class="children">
|
91
91
|
|
92
92
|
|
93
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Dtf/Command.html" title="Dtf::Command (module)">Command</a></span>
|
94
|
+
|
93
95
|
|
94
96
|
|
95
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Dtf/
|
97
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Dtf/ErrorSystem.html" title="Dtf::ErrorSystem (class)">ErrorSystem</a></span>, <span class='object_link'><a href="Dtf/OptionsParser.html" title="Dtf::OptionsParser (class)">OptionsParser</a></span>
|
96
98
|
|
97
99
|
|
98
100
|
</p>
|
@@ -104,7 +106,7 @@
|
|
104
106
|
<dt id="VERSION-constant" class="">VERSION =
|
105
107
|
|
106
108
|
</dt>
|
107
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.
|
109
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.3.5</span><span class='tstring_end'>"</span></span></pre></dd>
|
108
110
|
|
109
111
|
</dl>
|
110
112
|
|
@@ -120,7 +122,7 @@
|
|
120
122
|
</div>
|
121
123
|
|
122
124
|
<div id="footer">
|
123
|
-
Generated on
|
125
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
124
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
125
127
|
0.8.2.1 (ruby-1.9.3).
|
126
128
|
</div>
|
data/doc/Dtf/Command.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
|
7
|
+
Module: Dtf::Command
|
8
8
|
|
9
9
|
— Documentation by YARD 0.8.2.1
|
10
10
|
|
@@ -63,7 +63,7 @@
|
|
63
63
|
|
64
64
|
<iframe id="search_frame"></iframe>
|
65
65
|
|
66
|
-
<div id="content"><h1>
|
66
|
+
<div id="content"><h1>Module: Dtf::Command
|
67
67
|
|
68
68
|
|
69
69
|
|
@@ -71,21 +71,6 @@
|
|
71
71
|
|
72
72
|
<dl class="box">
|
73
73
|
|
74
|
-
<dt class="r1">Inherits:</dt>
|
75
|
-
<dd class="r1">
|
76
|
-
<span class="inheritName">Object</span>
|
77
|
-
|
78
|
-
<ul class="fullTree">
|
79
|
-
<li>Object</li>
|
80
|
-
|
81
|
-
<li class="next">Dtf::Command</li>
|
82
|
-
|
83
|
-
</ul>
|
84
|
-
<a href="#" class="inheritanceTree">show all</a>
|
85
|
-
|
86
|
-
</dd>
|
87
|
-
|
88
|
-
|
89
74
|
|
90
75
|
|
91
76
|
|
@@ -93,26 +78,23 @@
|
|
93
78
|
|
94
79
|
|
95
80
|
|
96
|
-
<dt class="
|
97
|
-
<dd class="
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/dtf.rb</dd>
|
98
83
|
|
99
84
|
</dl>
|
100
85
|
<div class="clear"></div>
|
101
86
|
|
102
|
-
<h2>
|
103
|
-
|
87
|
+
<h2>Defined Under Namespace</h2>
|
88
|
+
<p class="children">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Command/CreateUser.html" title="Dtf::Command::CreateUser (class)">CreateUser</a></span>, <span class='object_link'><a href="Command/CreateVs.html" title="Dtf::Command::CreateVs (class)">CreateVs</a></span>, <span class='object_link'><a href="Command/DeleteUser.html" title="Dtf::Command::DeleteUser (class)">DeleteUser</a></span>, <span class='object_link'><a href="Command/DeleteVs.html" title="Dtf::Command::DeleteVs (class)">DeleteVs</a></span>, <span class='object_link'><a href="Command/SetupDtf.html" title="Dtf::Command::SetupDtf (class)">SetupDtf</a></span>
|
104
94
|
|
105
|
-
<p>Dtf::Command contains all sub-commands availabe in the DTF master gem. All
|
106
|
-
methods receive the @cmd and @cmd_opts returned by
|
107
|
-
Dtf::OptionsParser.parse_cmds()</p>
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
</div>
|
112
|
-
<div class="tags">
|
113
95
|
|
96
|
+
</p>
|
114
97
|
|
115
|
-
</div>
|
116
98
|
|
117
99
|
|
118
100
|
|
@@ -130,80 +112,7 @@ Dtf::OptionsParser.parse_cmds()</p>
|
|
130
112
|
<li class="public ">
|
131
113
|
<span class="summary_signature">
|
132
114
|
|
133
|
-
<a href="#
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</span>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<span class="summary_desc"><div class='inline'>
|
148
|
-
<p>This sub-command is used to add a User to the Test Framework system.</p>
|
149
|
-
</div></span>
|
150
|
-
|
151
|
-
</li>
|
152
|
-
|
153
|
-
|
154
|
-
<li class="public ">
|
155
|
-
<span class="summary_signature">
|
156
|
-
|
157
|
-
<a href="#create_vs-class_method" title="create_vs (class method)">+ (Object) <strong>create_vs</strong>(cmd, cmd_opts) </a>
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
</span>
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<span class="summary_desc"><div class='inline'>
|
172
|
-
<p>This sub-command generates, adds, and associates a Verification Suite in
|
173
|
-
the Testing Framework system.</p>
|
174
|
-
</div></span>
|
175
|
-
|
176
|
-
</li>
|
177
|
-
|
178
|
-
|
179
|
-
<li class="public ">
|
180
|
-
<span class="summary_signature">
|
181
|
-
|
182
|
-
<a href="#delete_user-class_method" title="delete_user (class method)">+ (Object) <strong>delete_user</strong>(cmd, cmd_opts) </a>
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
</span>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
<span class="summary_desc"><div class='inline'>
|
197
|
-
<p>This sub-command removes a User from the Testing Framework system.</p>
|
198
|
-
</div></span>
|
199
|
-
|
200
|
-
</li>
|
201
|
-
|
202
|
-
|
203
|
-
<li class="public ">
|
204
|
-
<span class="summary_signature">
|
205
|
-
|
206
|
-
<a href="#delete_vs-class_method" title="delete_vs (class method)">+ (Object) <strong>delete_vs</strong>(cmd, cmd_opts) </a>
|
115
|
+
<a href="#create_cmd-class_method" title="create_cmd (class method)">+ (Object) <strong>create_cmd</strong>(cmd, options) </a>
|
207
116
|
|
208
117
|
|
209
118
|
|
@@ -217,34 +126,7 @@ the Testing Framework system.</p>
|
|
217
126
|
|
218
127
|
|
219
128
|
|
220
|
-
<span class="summary_desc"><div class='inline'>
|
221
|
-
<p>This sub-command removes a Verification Suite from the Testing Framework
|
222
|
-
system.</p>
|
223
|
-
</div></span>
|
224
|
-
|
225
|
-
</li>
|
226
|
-
|
227
|
-
|
228
|
-
<li class="public ">
|
229
|
-
<span class="summary_signature">
|
230
|
-
|
231
|
-
<a href="#process-class_method" title="process (class method)">+ (Object) <strong>process</strong>(cmd, cmd_opts) </a>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</span>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
<span class="summary_desc"><div class='inline'>
|
246
|
-
<p>Process both the requested command and all/any parameters.</p>
|
247
|
-
</div></span>
|
129
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
248
130
|
|
249
131
|
</li>
|
250
132
|
|
@@ -259,433 +141,35 @@ system.</p>
|
|
259
141
|
|
260
142
|
|
261
143
|
<div class="method_details first">
|
262
|
-
<h3 class="signature first" id="
|
263
|
-
|
264
|
-
+ (<tt>Object</tt>) <strong>create_user</strong>(cmd, cmd_opts)
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
</h3><div class="docstring">
|
271
|
-
<div class="discussion">
|
272
|
-
|
273
|
-
<p>This sub-command is used to add a User to the Test Framework system</p>
|
274
|
-
|
275
|
-
<p>Required Parameters are:</p>
|
276
|
-
|
277
|
-
<pre class="code ruby"><code>--user-name [String], --full-name [String], --email-address [String]</code></pre>
|
278
|
-
|
279
|
-
<p>'--user-name' is used to specify the user_name of the created User, and
|
280
|
-
<b>must</b> be unique in the system. '--full-name' is the Real Name of the
|
281
|
-
created User. '--email-address' is the email address of the created User,
|
282
|
-
and <b>must</b> be unique in the system.</p>
|
283
|
-
|
284
|
-
|
285
|
-
</div>
|
286
|
-
</div>
|
287
|
-
<div class="tags">
|
288
|
-
|
289
|
-
|
290
|
-
</div><table class="source_code">
|
291
|
-
<tr>
|
292
|
-
<td>
|
293
|
-
<pre class="lines">
|
294
|
-
|
295
|
-
|
296
|
-
143
|
297
|
-
144
|
298
|
-
145
|
299
|
-
146
|
300
|
-
147
|
301
|
-
148
|
302
|
-
149
|
303
|
-
150
|
304
|
-
151
|
305
|
-
152
|
306
|
-
153
|
307
|
-
154
|
308
|
-
155
|
309
|
-
156
|
310
|
-
157
|
311
|
-
158
|
312
|
-
159
|
313
|
-
160
|
314
|
-
161
|
315
|
-
162
|
316
|
-
163
|
317
|
-
164</pre>
|
318
|
-
</td>
|
319
|
-
<td>
|
320
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 143</span>
|
321
|
-
|
322
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_user'>create_user</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
323
|
-
<span class='kw'>if</span> <span class='lbracket'>[</span><span class='symbol'>:user_name_given</span><span class='comma'>,</span> <span class='symbol'>:full_name_given</span><span class='comma'>,</span> <span class='symbol'>:email_address_given</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>then</span>
|
324
|
-
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='label'>user_name:</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
325
|
-
<span class='label'>full_name:</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:full_name</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
326
|
-
<span class='label'>email_address:</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:email_address</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span>
|
327
|
-
|
328
|
-
<span class='comment'># Check to make sure user was actually saved to the db
|
329
|
-
</span> <span class='kw'>if</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_persisted?'>persisted?</span> <span class='kw'>then</span>
|
330
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Created user \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\' for \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:full_name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\'</span><span class='tstring_end'>"</span></span>
|
331
|
-
<span class='kw'>else</span>
|
332
|
-
<span class='comment'># Oops, it wasn't! Notify user and display any error message(s)
|
333
|
-
</span> <span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'> was NOT created! Please fix the following errors and try again:</span><span class='tstring_end'>"</span></span>
|
334
|
-
<span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_full_messages'>full_messages</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_msg'>msg</span><span class='op'>|</span>
|
335
|
-
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_msg'>msg</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
336
|
-
<span class='kw'>end</span>
|
337
|
-
<span class='comment'># Now throw a proper error code to the system, while exiting the script
|
338
|
-
</span> <span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
339
|
-
<span class='kw'>end</span>
|
340
|
-
<span class='kw'>else</span>
|
341
|
-
<span class='const'>Dtf</span><span class='op'>::</span><span class='const'>ErrorSystem</span><span class='period'>.</span><span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='comment'># This error here is thrown when not all params are provided
|
342
|
-
</span> <span class='kw'>end</span>
|
343
|
-
<span class='kw'>end</span></pre>
|
344
|
-
</td>
|
345
|
-
</tr>
|
346
|
-
</table>
|
347
|
-
</div>
|
348
|
-
|
349
|
-
<div class="method_details ">
|
350
|
-
<h3 class="signature " id="create_vs-class_method">
|
351
|
-
|
352
|
-
+ (<tt>Object</tt>) <strong>create_vs</strong>(cmd, cmd_opts)
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
</h3><div class="docstring">
|
359
|
-
<div class="discussion">
|
360
|
-
|
361
|
-
<p>This sub-command generates, adds, and associates a Verification Suite in
|
362
|
-
the Testing Framework system.</p>
|
363
|
-
|
364
|
-
<p>Required Parameters are:</p>
|
365
|
-
|
366
|
-
<pre class="code ruby"><code>--user-name [String], --name [String]</code></pre>
|
367
|
-
|
368
|
-
<p>'--user-name' is the user_name of the User that should own this
|
369
|
-
Verification Suite. '--name' is the descriptive name of the Verification
|
370
|
-
Suite.</p>
|
371
|
-
|
372
|
-
<p>Options are:</p>
|
373
|
-
|
374
|
-
<pre class="code ruby"><code>--description [String]</code></pre>
|
375
|
-
|
376
|
-
<p>This <b>optional</b> parameter is for providing a description of the
|
377
|
-
Verification Suite's use. e.g. --description "RSpec Verification"</p>
|
378
|
-
|
379
|
-
|
380
|
-
</div>
|
381
|
-
</div>
|
382
|
-
<div class="tags">
|
383
|
-
|
384
|
-
|
385
|
-
</div><table class="source_code">
|
386
|
-
<tr>
|
387
|
-
<td>
|
388
|
-
<pre class="lines">
|
389
|
-
|
390
|
-
|
391
|
-
231
|
392
|
-
232
|
393
|
-
233
|
394
|
-
234
|
395
|
-
235
|
396
|
-
236
|
397
|
-
237
|
398
|
-
238
|
399
|
-
239
|
400
|
-
240
|
401
|
-
241
|
402
|
-
242
|
403
|
-
243
|
404
|
-
244</pre>
|
405
|
-
</td>
|
406
|
-
<td>
|
407
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 231</span>
|
408
|
-
|
409
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_vs'>create_vs</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
410
|
-
<span class='kw'>if</span> <span class='lbracket'>[</span><span class='symbol'>:user_name_given</span><span class='comma'>,</span> <span class='symbol'>:name_given</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>then</span>
|
411
|
-
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_user_name'>find_by_user_name</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
412
|
-
<span class='id identifier rubyid_vs'>vs</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_verification_suites'>verification_suites</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>description:</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:description</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
413
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_vs'>vs</span><span class='period'>.</span><span class='id identifier rubyid_persisted?'>persisted?</span> <span class='kw'>then</span>
|
414
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>VS named \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\' allocated to user \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\'</span><span class='tstring_end'>"</span></span>
|
415
|
-
<span class='kw'>else</span>
|
416
|
-
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: Failed to save Verification Suite. Check DB logfile for errors</span><span class='tstring_end'>"</span></span>
|
417
|
-
<span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
418
|
-
<span class='kw'>end</span>
|
419
|
-
<span class='kw'>else</span>
|
420
|
-
<span class='const'>Dtf</span><span class='op'>::</span><span class='const'>ErrorSystem</span><span class='period'>.</span><span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
|
421
|
-
<span class='kw'>end</span>
|
422
|
-
<span class='kw'>end</span></pre>
|
423
|
-
</td>
|
424
|
-
</tr>
|
425
|
-
</table>
|
426
|
-
</div>
|
427
|
-
|
428
|
-
<div class="method_details ">
|
429
|
-
<h3 class="signature " id="delete_user-class_method">
|
430
|
-
|
431
|
-
+ (<tt>Object</tt>) <strong>delete_user</strong>(cmd, cmd_opts)
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
</h3><div class="docstring">
|
438
|
-
<div class="discussion">
|
439
|
-
|
440
|
-
<p>This sub-command removes a User from the Testing Framework system</p>
|
441
|
-
|
442
|
-
<p>Required Parameters are:</p>
|
443
|
-
|
444
|
-
<pre class="code ruby"><code>--user-name [String]</code></pre>
|
445
|
-
|
446
|
-
<p>'--user-name' is the assigned user_name of the User you wish to delete.</p>
|
447
|
-
|
448
|
-
<p>Optional Flags are:</p>
|
449
|
-
|
450
|
-
<pre class="code ruby"><code><span class='op'>-</span><span class='op'>-</span><span class='id identifier rubyid_delete'>delete</span><span class='op'>-</span><span class='id identifier rubyid_all'>all</span><span class='op'>|</span><span class='op'>-</span><span class='op'>-</span><span class='id identifier rubyid_no'>no</span><span class='op'>-</span><span class='id identifier rubyid_delete'>delete</span><span class='op'>-</span><span class='id identifier rubyid_all'>all</span></code></pre>
|
451
|
-
|
452
|
-
<p>By default this command will delete <b>all</b> Verification Suites owned by
|
453
|
-
the deleted user. The default behaviour is as if the sub-command had been
|
454
|
-
invoked passing the '--delete-all' flag explicitly.</p>
|
455
|
-
|
456
|
-
<p>To delete the user, but <b>keep</b> their VS, pass the '--no-delete-all'
|
457
|
-
flag. This flag will find all Verification Suites owned by the user being
|
458
|
-
deleted, and reassign them to 'Library Owner' (user_name: library_owner)
|
459
|
-
which is the generic in-house User shipped with DTF.</p>
|
460
|
-
|
461
|
-
|
462
|
-
</div>
|
463
|
-
</div>
|
464
|
-
<div class="tags">
|
144
|
+
<h3 class="signature first" id="create_cmd-class_method">
|
465
145
|
|
466
|
-
|
467
|
-
</div><table class="source_code">
|
468
|
-
<tr>
|
469
|
-
<td>
|
470
|
-
<pre class="lines">
|
471
|
-
|
472
|
-
|
473
|
-
182
|
474
|
-
183
|
475
|
-
184
|
476
|
-
185
|
477
|
-
186
|
478
|
-
187
|
479
|
-
188
|
480
|
-
189
|
481
|
-
190
|
482
|
-
191
|
483
|
-
192
|
484
|
-
193
|
485
|
-
194
|
486
|
-
195
|
487
|
-
196
|
488
|
-
197
|
489
|
-
198
|
490
|
-
199
|
491
|
-
200
|
492
|
-
201
|
493
|
-
202
|
494
|
-
203
|
495
|
-
204
|
496
|
-
205
|
497
|
-
206
|
498
|
-
207
|
499
|
-
208
|
500
|
-
209
|
501
|
-
210
|
502
|
-
211
|
503
|
-
212
|
504
|
-
213
|
505
|
-
214
|
506
|
-
215</pre>
|
507
|
-
</td>
|
508
|
-
<td>
|
509
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 182</span>
|
510
|
-
|
511
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_user'>delete_user</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
512
|
-
<span class='kw'>if</span> <span class='lbracket'>[</span><span class='symbol'>:user_name_given</span><span class='comma'>,</span> <span class='symbol'>:delete_all</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>then</span>
|
513
|
-
<span class='comment'># NOTE: :delete_all is 'true' by default. passing '--no-delete-all' sets it to false,
|
514
|
-
</span> <span class='comment'># and adds the :delete_all_given key to the cmd_opts hash, set to true.
|
515
|
-
</span> <span class='comment'># This means NOT to delete all VSs associated with this user. We delete them by default.
|
516
|
-
</span> <span class='kw'>if</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:delete_all</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>false</span> <span class='op'>&&</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:delete_all_given</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span>
|
517
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> called with '--no-delete-all' set! NOT deleting all owned VSs!</span><span class='tstring_end'>"</span></span>
|
518
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Reassigning VSs to Library. New owner will be \'Library Owner\'</span><span class='tstring_end'>"</span></span>
|
519
|
-
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_user_name'>find_by_user_name</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
520
|
-
<span class='id identifier rubyid_lib_owner'>lib_owner</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_user_name'>find_by_user_name</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>library_owner</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
521
|
-
<span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_verification_suites'>verification_suites</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</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_vs'>vs</span><span class='op'>|</span>
|
522
|
-
<span class='id identifier rubyid_vs'>vs</span><span class='period'>.</span><span class='id identifier rubyid_user_id'>user_id</span> <span class='op'>=</span> <span class='id identifier rubyid_lib_owner'>lib_owner</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
|
523
|
-
<span class='id identifier rubyid_vs'>vs</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span>
|
524
|
-
<span class='kw'>end</span>
|
525
|
-
<span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
526
|
-
<span class='kw'>else</span>
|
527
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> called with '--delete-all' set or on by default! Deleting all VSs owned by </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
528
|
-
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_user_name'>find_by_user_name</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
529
|
-
<span class='kw'>if</span> <span class='op'>!</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>then</span>
|
530
|
-
<span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_verification_suites'>verification_suites</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</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_vs'>vs</span><span class='op'>|</span>
|
531
|
-
<span class='const'>VerificationSuite</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_vs'>vs</span><span class='rparen'>)</span>
|
532
|
-
<span class='kw'>end</span>
|
533
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_verification_suites'>verification_suites</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>then</span>
|
534
|
-
<span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
|
535
|
-
<span class='kw'>end</span>
|
536
|
-
<span class='kw'>else</span>
|
537
|
-
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: No user named \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>\' found!</span><span class='tstring_end'>"</span></span>
|
538
|
-
<span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
539
|
-
<span class='kw'>end</span>
|
540
|
-
<span class='kw'>end</span>
|
541
|
-
<span class='kw'>else</span>
|
542
|
-
<span class='const'>Dtf</span><span class='op'>::</span><span class='const'>ErrorSystem</span><span class='period'>.</span><span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
|
543
|
-
<span class='kw'>end</span>
|
544
|
-
<span class='kw'>end</span></pre>
|
545
|
-
</td>
|
546
|
-
</tr>
|
547
|
-
</table>
|
548
|
-
</div>
|
549
|
-
|
550
|
-
<div class="method_details ">
|
551
|
-
<h3 class="signature " id="delete_vs-class_method">
|
552
|
-
|
553
|
-
+ (<tt>Object</tt>) <strong>delete_vs</strong>(cmd, cmd_opts)
|
554
|
-
|
555
|
-
|
146
|
+
+ (<tt>Object</tt>) <strong>create_cmd</strong>(cmd, options)
|
556
147
|
|
557
148
|
|
558
149
|
|
559
|
-
</h3><div class="docstring">
|
560
|
-
<div class="discussion">
|
561
|
-
|
562
|
-
<p>This sub-command removes a Verification Suite from the Testing Framework
|
563
|
-
system</p>
|
564
|
-
|
565
|
-
<p>Required Parameters are:</p>
|
566
|
-
|
567
|
-
<pre class="code ruby"><code>--user-name [String], --id [Integer]</code></pre>
|
568
|
-
|
569
|
-
<p>The '--user-name' parameter is the user_name of the User that owns the
|
570
|
-
Verification Suite you wish to delete The '--id' parameter is the ID # of
|
571
|
-
the Verification Suite you wish to delete, as provided by @vs.id</p>
|
572
150
|
|
573
|
-
|
574
|
-
</div>
|
575
|
-
</div>
|
576
|
-
<div class="tags">
|
577
151
|
|
578
|
-
|
579
|
-
</div><table class="source_code">
|
152
|
+
</h3><table class="source_code">
|
580
153
|
<tr>
|
581
154
|
<td>
|
582
155
|
<pre class="lines">
|
583
156
|
|
584
157
|
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
259
|
592
|
-
260
|
593
|
-
261
|
594
|
-
262</pre>
|
158
|
+
10
|
159
|
+
11
|
160
|
+
12
|
161
|
+
13
|
162
|
+
14
|
163
|
+
15</pre>
|
595
164
|
</td>
|
596
165
|
<td>
|
597
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
598
|
-
|
599
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_vs'>delete_vs</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
600
|
-
<span class='kw'>if</span> <span class='lbracket'>[</span><span class='symbol'>:user_name_given</span><span class='comma'>,</span> <span class='symbol'>:id_given</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>then</span>
|
601
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> called! Deleting </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\'s VS with ID \'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\'</span><span class='tstring_end'>"</span></span>
|
602
|
-
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_find_by_user_name'>find_by_user_name</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
603
|
-
<span class='id identifier rubyid_vs'>vs</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_verification_suites'>verification_suites</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
604
|
-
<span class='const'>VerificationSuite</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_vs'>vs</span><span class='rparen'>)</span>
|
605
|
-
<span class='kw'>else</span>
|
606
|
-
<span class='const'>Dtf</span><span class='op'>::</span><span class='const'>ErrorSystem</span><span class='period'>.</span><span class='id identifier rubyid_raise_error'>raise_error</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
|
607
|
-
<span class='kw'>end</span>
|
608
|
-
<span class='kw'>end</span></pre>
|
609
|
-
</td>
|
610
|
-
</tr>
|
611
|
-
</table>
|
612
|
-
</div>
|
613
|
-
|
614
|
-
<div class="method_details ">
|
615
|
-
<h3 class="signature " id="process-class_method">
|
616
|
-
|
617
|
-
+ (<tt>Object</tt>) <strong>process</strong>(cmd, cmd_opts)
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
</h3><div class="docstring">
|
624
|
-
<div class="discussion">
|
625
|
-
|
626
|
-
<p>Process both the requested command and all/any parameters. NOTE: This
|
627
|
-
method is the 'master' method. It parses @cmd for which sub-command to
|
628
|
-
execute and then hands off to the appropriate method. All methods are a 1:1
|
629
|
-
match in their name. e.g 'create_user' sub-command is matched to the
|
630
|
-
'create_user' method of this class.</p>
|
631
|
-
|
632
|
-
<p>This method requires, and processes, 2 arguments. The first is a String,
|
633
|
-
the second is a Hash. They are the 'cmd' to process and any
|
634
|
-
options/parameters, stored in the 'cmd_opts' hash, of that sub-command.</p>
|
635
|
-
|
636
|
-
|
637
|
-
</div>
|
638
|
-
</div>
|
639
|
-
<div class="tags">
|
640
|
-
|
641
|
-
|
642
|
-
</div><table class="source_code">
|
643
|
-
<tr>
|
644
|
-
<td>
|
645
|
-
<pre class="lines">
|
646
|
-
|
647
|
-
|
648
|
-
115
|
649
|
-
116
|
650
|
-
117
|
651
|
-
118
|
652
|
-
119
|
653
|
-
120
|
654
|
-
121
|
655
|
-
122
|
656
|
-
123
|
657
|
-
124
|
658
|
-
125
|
659
|
-
126
|
660
|
-
127
|
661
|
-
128
|
662
|
-
129
|
663
|
-
130
|
664
|
-
131
|
665
|
-
132
|
666
|
-
133</pre>
|
667
|
-
</td>
|
668
|
-
<td>
|
669
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 115</span>
|
670
|
-
|
671
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
672
|
-
<span class='kw'>case</span> <span class='id identifier rubyid_cmd'>cmd</span>
|
673
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>create_user</span><span class='tstring_end'>"</span></span>
|
674
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_user'>create_user</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
675
|
-
|
676
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>delete_user</span><span class='tstring_end'>"</span></span>
|
677
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_user'>delete_user</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
678
|
-
|
679
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>create_vs</span><span class='tstring_end'>"</span></span>
|
680
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_vs'>create_vs</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
681
|
-
|
682
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>delete_vs</span><span class='tstring_end'>"</span></span>
|
683
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_vs'>delete_vs</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_cmd_opts'>cmd_opts</span><span class='rparen'>)</span>
|
166
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 10</span>
|
684
167
|
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
<span class='
|
168
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_cmd'>create_cmd</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
169
|
+
<span class='const'>Dtf</span><span class='op'>::</span><span class='const'>Command</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
170
|
+
<span class='kw'>rescue</span> <span class='const'>NameError</span>
|
171
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DTF has no registered command by that name.</span><span class='tstring_end'>"</span></span>
|
172
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Please see 'dtf -h' for the list of recognized commands.</span><span class='tstring_end'>"</span></span>
|
689
173
|
<span class='kw'>end</span></pre>
|
690
174
|
</td>
|
691
175
|
</tr>
|
@@ -697,7 +181,7 @@ options/parameters, stored in the 'cmd_opts' hash, of that sub-command.</p>
|
|
697
181
|
</div>
|
698
182
|
|
699
183
|
<div id="footer">
|
700
|
-
Generated on
|
184
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
701
185
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
702
186
|
0.8.2.1 (ruby-1.9.3).
|
703
187
|
</div>
|