dtf 0.3.5 → 0.3.6
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/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
@@ -0,0 +1,320 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Dtf::Command::CreateUser
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Dtf.html" title="Dtf (module)">Dtf</a></span></span> » <span class='title'><span class='object_link'><a href="../Command.html" title="Dtf::Command (module)">Command</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">CreateUser</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Dtf::Command::CreateUser
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
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::CreateUser</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/dtf.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>This sub-command is used to add a User to the Test Framework system</p>
|
106
|
+
|
107
|
+
<p>Required Parameters are:</p>
|
108
|
+
|
109
|
+
<pre class="code ruby"><code>--user-name [String], --full-name [String], --email-address [String]</code></pre>
|
110
|
+
|
111
|
+
<p>'--user-name' is used to specify the user_name of the created User, and
|
112
|
+
<b>must</b> be unique in the system. '--full-name' is the Real Name of the
|
113
|
+
created User. '--email-address' is the email address of the created User,
|
114
|
+
and <b>must</b> be unique in the system.</p>
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
<div class="tags">
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<h2>
|
131
|
+
Instance Method Summary
|
132
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
133
|
+
</h2>
|
134
|
+
|
135
|
+
<ul class="summary">
|
136
|
+
|
137
|
+
<li class="public ">
|
138
|
+
<span class="summary_signature">
|
139
|
+
|
140
|
+
<a href="#execute-instance_method" title="#execute (instance method)">- (Object) <strong>execute</strong> </a>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
155
|
+
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="public ">
|
160
|
+
<span class="summary_signature">
|
161
|
+
|
162
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (CreateUser) <strong>initialize</strong>(cmd_name, options) </a>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</span>
|
167
|
+
|
168
|
+
|
169
|
+
<span class="note title constructor">constructor</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<span class="summary_desc"><div class='inline'>
|
179
|
+
<p>A new instance of CreateUser.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
</ul>
|
186
|
+
|
187
|
+
|
188
|
+
<div id="constructor_details" class="method_details_list">
|
189
|
+
<h2>Constructor Details</h2>
|
190
|
+
|
191
|
+
<div class="method_details first">
|
192
|
+
<h3 class="signature first" id="initialize-instance_method">
|
193
|
+
|
194
|
+
- (<tt><span class='object_link'><a href="" title="Dtf::Command::CreateUser (class)">CreateUser</a></span></tt>) <strong>initialize</strong>(cmd_name, options)
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</h3><div class="docstring">
|
201
|
+
<div class="discussion">
|
202
|
+
|
203
|
+
<p>A new instance of CreateUser</p>
|
204
|
+
|
205
|
+
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
<div class="tags">
|
209
|
+
|
210
|
+
|
211
|
+
</div><table class="source_code">
|
212
|
+
<tr>
|
213
|
+
<td>
|
214
|
+
<pre class="lines">
|
215
|
+
|
216
|
+
|
217
|
+
49
|
218
|
+
50
|
219
|
+
51
|
220
|
+
52</pre>
|
221
|
+
</td>
|
222
|
+
<td>
|
223
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 49</span>
|
224
|
+
|
225
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_name'>cmd_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
226
|
+
<span class='ivar'>@cmd_name</span> <span class='op'>=</span> <span class='id identifier rubyid_cmd_name'>cmd_name</span>
|
227
|
+
<span class='ivar'>@cmd_opts</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
228
|
+
<span class='kw'>end</span></pre>
|
229
|
+
</td>
|
230
|
+
</tr>
|
231
|
+
</table>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
<div id="instance_method_details" class="method_details_list">
|
238
|
+
<h2>Instance Method Details</h2>
|
239
|
+
|
240
|
+
|
241
|
+
<div class="method_details first">
|
242
|
+
<h3 class="signature first" id="execute-instance_method">
|
243
|
+
|
244
|
+
- (<tt>Object</tt>) <strong>execute</strong>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</h3><table class="source_code">
|
251
|
+
<tr>
|
252
|
+
<td>
|
253
|
+
<pre class="lines">
|
254
|
+
|
255
|
+
|
256
|
+
54
|
257
|
+
55
|
258
|
+
56
|
259
|
+
57
|
260
|
+
58
|
261
|
+
59
|
262
|
+
60
|
263
|
+
61
|
264
|
+
62
|
265
|
+
63
|
266
|
+
64
|
267
|
+
65
|
268
|
+
66
|
269
|
+
67
|
270
|
+
68
|
271
|
+
69
|
272
|
+
70
|
273
|
+
71
|
274
|
+
72
|
275
|
+
73
|
276
|
+
74
|
277
|
+
75</pre>
|
278
|
+
</td>
|
279
|
+
<td>
|
280
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 54</span>
|
281
|
+
|
282
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span>
|
283
|
+
<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='ivar'>@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>
|
284
|
+
<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='ivar'>@cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
285
|
+
<span class='label'>full_name:</span> <span class='ivar'>@cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:full_name</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
286
|
+
<span class='label'>email_address:</span> <span class='ivar'>@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>
|
287
|
+
|
288
|
+
<span class='comment'># Check to make sure user was actually saved to the db
|
289
|
+
</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>
|
290
|
+
<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='ivar'>@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='ivar'>@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>
|
291
|
+
<span class='kw'>else</span>
|
292
|
+
<span class='comment'># Oops, it wasn't! Notify user and display any error message(s)
|
293
|
+
</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='ivar'>@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>
|
294
|
+
<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>
|
295
|
+
<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>
|
296
|
+
<span class='kw'>end</span>
|
297
|
+
<span class='comment'># Now throw a proper error code to the system, while exiting the script
|
298
|
+
</span> <span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
299
|
+
<span class='kw'>end</span>
|
300
|
+
<span class='kw'>else</span>
|
301
|
+
<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='ivar'>@cmd_name</span><span class='rparen'>)</span> <span class='comment'># This error here is thrown when not all params are provided
|
302
|
+
</span> <span class='kw'>end</span>
|
303
|
+
<span class='kw'>end</span></pre>
|
304
|
+
</td>
|
305
|
+
</tr>
|
306
|
+
</table>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div id="footer">
|
314
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
315
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
316
|
+
0.8.2.1 (ruby-1.9.3).
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</body>
|
320
|
+
</html>
|
@@ -0,0 +1,311 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Dtf::Command::CreateVs
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Dtf.html" title="Dtf (module)">Dtf</a></span></span> » <span class='title'><span class='object_link'><a href="../Command.html" title="Dtf::Command (module)">Command</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">CreateVs</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Dtf::Command::CreateVs
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
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::CreateVs</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/dtf.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>This sub-command generates, adds, and associates a Verification Suite in
|
106
|
+
the Testing Framework system.</p>
|
107
|
+
|
108
|
+
<p>Required Parameters are:</p>
|
109
|
+
|
110
|
+
<pre class="code ruby"><code>--user-name [String], --name [String]</code></pre>
|
111
|
+
|
112
|
+
<p>'--user-name' is the user_name of the User that should own this
|
113
|
+
Verification Suite. '--name' is the descriptive name of the Verification
|
114
|
+
Suite.</p>
|
115
|
+
|
116
|
+
<p>Options are:</p>
|
117
|
+
|
118
|
+
<pre class="code ruby"><code>--description [String]</code></pre>
|
119
|
+
|
120
|
+
<p>This <b>optional</b> parameter is for providing a description of the
|
121
|
+
Verification Suite's use. e.g. --description "RSpec Verification"</p>
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
<div class="tags">
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>
|
138
|
+
Instance Method Summary
|
139
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
140
|
+
</h2>
|
141
|
+
|
142
|
+
<ul class="summary">
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="#execute-instance_method" title="#execute (instance method)">- (Object) <strong>execute</strong> </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
162
|
+
|
163
|
+
</li>
|
164
|
+
|
165
|
+
|
166
|
+
<li class="public ">
|
167
|
+
<span class="summary_signature">
|
168
|
+
|
169
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (CreateVs) <strong>initialize</strong>(cmd_name, options) </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
<span class="note title constructor">constructor</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
186
|
+
<p>A new instance of CreateVs.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
</ul>
|
193
|
+
|
194
|
+
|
195
|
+
<div id="constructor_details" class="method_details_list">
|
196
|
+
<h2>Constructor Details</h2>
|
197
|
+
|
198
|
+
<div class="method_details first">
|
199
|
+
<h3 class="signature first" id="initialize-instance_method">
|
200
|
+
|
201
|
+
- (<tt><span class='object_link'><a href="" title="Dtf::Command::CreateVs (class)">CreateVs</a></span></tt>) <strong>initialize</strong>(cmd_name, options)
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</h3><div class="docstring">
|
208
|
+
<div class="discussion">
|
209
|
+
|
210
|
+
<p>A new instance of CreateVs</p>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
<div class="tags">
|
216
|
+
|
217
|
+
|
218
|
+
</div><table class="source_code">
|
219
|
+
<tr>
|
220
|
+
<td>
|
221
|
+
<pre class="lines">
|
222
|
+
|
223
|
+
|
224
|
+
92
|
225
|
+
93
|
226
|
+
94
|
227
|
+
95</pre>
|
228
|
+
</td>
|
229
|
+
<td>
|
230
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 92</span>
|
231
|
+
|
232
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd_name'>cmd_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
233
|
+
<span class='ivar'>@cmd_name</span> <span class='op'>=</span> <span class='id identifier rubyid_cmd_name'>cmd_name</span>
|
234
|
+
<span class='ivar'>@cmd_opts</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
235
|
+
<span class='kw'>end</span></pre>
|
236
|
+
</td>
|
237
|
+
</tr>
|
238
|
+
</table>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
<div id="instance_method_details" class="method_details_list">
|
245
|
+
<h2>Instance Method Details</h2>
|
246
|
+
|
247
|
+
|
248
|
+
<div class="method_details first">
|
249
|
+
<h3 class="signature first" id="execute-instance_method">
|
250
|
+
|
251
|
+
- (<tt>Object</tt>) <strong>execute</strong>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</h3><table class="source_code">
|
258
|
+
<tr>
|
259
|
+
<td>
|
260
|
+
<pre class="lines">
|
261
|
+
|
262
|
+
|
263
|
+
97
|
264
|
+
98
|
265
|
+
99
|
266
|
+
100
|
267
|
+
101
|
268
|
+
102
|
269
|
+
103
|
270
|
+
104
|
271
|
+
105
|
272
|
+
106
|
273
|
+
107
|
274
|
+
108
|
275
|
+
109
|
276
|
+
110</pre>
|
277
|
+
</td>
|
278
|
+
<td>
|
279
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 97</span>
|
280
|
+
|
281
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span>
|
282
|
+
<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='ivar'>@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>
|
283
|
+
<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='ivar'>@cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:user_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
284
|
+
<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='ivar'>@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='ivar'>@cmd_opts</span><span class='lbracket'>[</span><span class='symbol'>:description</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
285
|
+
<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>
|
286
|
+
<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='ivar'>@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='ivar'>@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>
|
287
|
+
<span class='kw'>else</span>
|
288
|
+
<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>
|
289
|
+
<span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
290
|
+
<span class='kw'>end</span>
|
291
|
+
<span class='kw'>else</span>
|
292
|
+
<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='ivar'>@cmd_name</span><span class='rparen'>)</span>
|
293
|
+
<span class='kw'>end</span>
|
294
|
+
<span class='kw'>end</span></pre>
|
295
|
+
</td>
|
296
|
+
</tr>
|
297
|
+
</table>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
<div id="footer">
|
305
|
+
Generated on Mon Oct 1 20:33:52 2012 by
|
306
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
307
|
+
0.8.2.1 (ruby-1.9.3).
|
308
|
+
</div>
|
309
|
+
|
310
|
+
</body>
|
311
|
+
</html>
|