dtf 0.2.8 → 0.2.9
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/app/models/analysis_case.rb +3 -0
- data/app/models/case_test.rb +1 -0
- data/app/models/user.rb +1 -0
- data/app/models/verification_suite.rb +11 -10
- data/doc/AnalysisCase.html +16 -1
- data/doc/CaseTest.html +13 -1
- data/doc/Dtf.html +2 -2
- data/doc/Dtf/Command.html +83 -82
- data/doc/Dtf/ErrorSystem.html +47 -19
- data/doc/Dtf/OptionsParser.html +41 -22
- data/doc/User.html +12 -1
- data/doc/VerificationSuite.html +22 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/dtf.rb +25 -10
- data/lib/dtf/version.rb +1 -1
- metadata +1 -1
data/app/models/analysis_case.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
+
# AnalysisCase defines the 'test premise', which is broken down into steps called CaseTests
|
4
|
+
#
|
5
|
+
# AnalysisCases own CaseTests. Users own each CaseTest through its AnalysisCase
|
3
6
|
class AnalysisCase < ActiveRecord::Base
|
4
7
|
|
5
8
|
attr_accessible :name, :description
|
data/app/models/case_test.rb
CHANGED
data/app/models/user.rb
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
+
# VerificationSuite is the core container class.
|
4
|
+
#
|
5
|
+
# ASSOCIATIONS BREAKDOWN: It contains many AnalysisCases. Each AnalysisCase contains
|
6
|
+
# multiple case_tests, owned by both the User and the AnalysisCase. The goal is to
|
7
|
+
# make 'packs' of tests which Users can share between Suites, grouped by Cases, and
|
8
|
+
# even share those Tests between Cases.
|
9
|
+
#
|
10
|
+
# Also, Users should be able to share their individual Test(s), AnalysisCase(s), through
|
11
|
+
# their VerificationSuite(s) with other Users for inclusion in their own AnalysisCase(s)
|
12
|
+
# and Suite(s) allowing for mix-and-match batching.
|
13
|
+
|
3
14
|
class VerificationSuite < ActiveRecord::Base
|
4
15
|
|
5
16
|
attr_accessible :name, :description
|
@@ -9,14 +20,4 @@ class VerificationSuite < ActiveRecord::Base
|
|
9
20
|
has_many :analysis_cases, :dependent => :destroy
|
10
21
|
has_many :case_tests, :through => :analysis_cases, :dependent => :destroy
|
11
22
|
|
12
|
-
# ASSOCIATIONS BREAKDOWN
|
13
|
-
# ----------------------
|
14
|
-
# Each VerificationSuite is comprised of many AnalysisCases, Each AnalysisCase
|
15
|
-
# contain multiple case_tests, owned by both the User and the AnalysisCase.
|
16
|
-
# The goal is to make 'packs' of tests which Users can share between Suites,
|
17
|
-
# grouped by Cases, and even share those Tests between Cases. Also, Users
|
18
|
-
# should be able to share their individual Test(s), AnalysisCase(s), and
|
19
|
-
# VerificationSuite(s) with other Users for inclusion in their own
|
20
|
-
# AnalysisCase(s) and Suite(s) allowing for mix-and-match batching.
|
21
|
-
|
22
23
|
end
|
data/doc/AnalysisCase.html
CHANGED
@@ -101,8 +101,23 @@
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
103
103
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>AnalysisCase defines the 'test premise', which is broken down into steps
|
108
|
+
called CaseTests</p>
|
109
|
+
|
110
|
+
<p>AnalysisCases own CaseTests. Users own each CaseTest through its
|
111
|
+
AnalysisCase</p>
|
104
112
|
|
105
113
|
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
106
121
|
|
107
122
|
|
108
123
|
|
@@ -114,7 +129,7 @@
|
|
114
129
|
</div>
|
115
130
|
|
116
131
|
<div id="footer">
|
117
|
-
Generated on Thu Sep 20
|
132
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
118
133
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
134
|
0.8.2.1 (ruby-1.9.3).
|
120
135
|
</div>
|
data/doc/CaseTest.html
CHANGED
@@ -101,7 +101,19 @@
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
103
103
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>CaseTest is the recording of each individual step of an AnalysisCase's
|
108
|
+
'test premise'</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
104
115
|
|
116
|
+
</div>
|
105
117
|
|
106
118
|
|
107
119
|
|
@@ -114,7 +126,7 @@
|
|
114
126
|
</div>
|
115
127
|
|
116
128
|
<div id="footer">
|
117
|
-
Generated on Thu Sep 20
|
129
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
118
130
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
131
|
0.8.2.1 (ruby-1.9.3).
|
120
132
|
</div>
|
data/doc/Dtf.html
CHANGED
@@ -104,7 +104,7 @@
|
|
104
104
|
<dt id="VERSION-constant" class="">VERSION =
|
105
105
|
|
106
106
|
</dt>
|
107
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.2.
|
107
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.2.8</span><span class='tstring_end'>"</span></span></pre></dd>
|
108
108
|
|
109
109
|
</dl>
|
110
110
|
|
@@ -120,7 +120,7 @@
|
|
120
120
|
</div>
|
121
121
|
|
122
122
|
<div id="footer">
|
123
|
-
Generated on Thu Sep 20
|
123
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
124
124
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
125
125
|
0.8.2.1 (ruby-1.9.3).
|
126
126
|
</div>
|
data/doc/Dtf/Command.html
CHANGED
@@ -103,8 +103,8 @@
|
|
103
103
|
<div class="discussion">
|
104
104
|
|
105
105
|
<p>Dtf::Command contains all sub-commands availabe in the DTF master gem. All
|
106
|
-
methods
|
107
|
-
|
106
|
+
methods receive the @cmd and @cmd_opts returned by
|
107
|
+
Dtf::OptionsParser.parse_cmds()</p>
|
108
108
|
|
109
109
|
|
110
110
|
</div>
|
@@ -293,31 +293,31 @@ and <b>must</b> be unique in the system.</p>
|
|
293
293
|
<pre class="lines">
|
294
294
|
|
295
295
|
|
296
|
-
128
|
297
|
-
129
|
298
|
-
130
|
299
|
-
131
|
300
|
-
132
|
301
|
-
133
|
302
|
-
134
|
303
|
-
135
|
304
|
-
136
|
305
|
-
137
|
306
|
-
138
|
307
|
-
139
|
308
|
-
140
|
309
|
-
141
|
310
|
-
142
|
311
296
|
143
|
312
297
|
144
|
313
298
|
145
|
314
299
|
146
|
315
300
|
147
|
316
301
|
148
|
317
|
-
149
|
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
318
|
</td>
|
319
319
|
<td>
|
320
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
320
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 143</span>
|
321
321
|
|
322
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
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>
|
@@ -388,23 +388,23 @@ Verification Suite's use. e.g. --description "RSpec Verification"</p>
|
|
388
388
|
<pre class="lines">
|
389
389
|
|
390
390
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
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
405
|
</td>
|
406
406
|
<td>
|
407
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
407
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 231</span>
|
408
408
|
|
409
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
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>
|
@@ -470,21 +470,6 @@ which is the generic in-house User shipped with DTF.</p>
|
|
470
470
|
<pre class="lines">
|
471
471
|
|
472
472
|
|
473
|
-
167
|
474
|
-
168
|
475
|
-
169
|
476
|
-
170
|
477
|
-
171
|
478
|
-
172
|
479
|
-
173
|
480
|
-
174
|
481
|
-
175
|
482
|
-
176
|
483
|
-
177
|
484
|
-
178
|
485
|
-
179
|
486
|
-
180
|
487
|
-
181
|
488
473
|
182
|
489
474
|
183
|
490
475
|
184
|
@@ -503,10 +488,25 @@ which is the generic in-house User shipped with DTF.</p>
|
|
503
488
|
197
|
504
489
|
198
|
505
490
|
199
|
506
|
-
200
|
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
507
|
</td>
|
508
508
|
<td>
|
509
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
509
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 182</span>
|
510
510
|
|
511
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
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>
|
@@ -582,19 +582,19 @@ the Verification Suite you wish to delete, as provided by @vs.id</p>
|
|
582
582
|
<pre class="lines">
|
583
583
|
|
584
584
|
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
585
|
+
253
|
586
|
+
254
|
587
|
+
255
|
588
|
+
256
|
589
|
+
257
|
590
|
+
258
|
591
|
+
259
|
592
|
+
260
|
593
|
+
261
|
594
|
+
262</pre>
|
595
595
|
</td>
|
596
596
|
<td>
|
597
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
597
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 253</span>
|
598
598
|
|
599
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
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>
|
@@ -629,8 +629,9 @@ execute and then hands off to the appropriate method. All methods are a 1:1
|
|
629
629
|
match in their name. e.g 'create_user' sub-command is matched to the
|
630
630
|
'create_user' method of this class.</p>
|
631
631
|
|
632
|
-
<p>This method requires, and processes, 2 arguments. The
|
633
|
-
|
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>
|
634
635
|
|
635
636
|
|
636
637
|
</div>
|
@@ -644,28 +645,28 @@ any 'cmd_opts' of that sub-command.</p>
|
|
644
645
|
<pre class="lines">
|
645
646
|
|
646
647
|
|
647
|
-
100
|
648
|
-
101
|
649
|
-
102
|
650
|
-
103
|
651
|
-
104
|
652
|
-
105
|
653
|
-
106
|
654
|
-
107
|
655
|
-
108
|
656
|
-
109
|
657
|
-
110
|
658
|
-
111
|
659
|
-
112
|
660
|
-
113
|
661
|
-
114
|
662
648
|
115
|
663
649
|
116
|
664
650
|
117
|
665
|
-
118
|
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>
|
666
667
|
</td>
|
667
668
|
<td>
|
668
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
669
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 115</span>
|
669
670
|
|
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>
|
671
672
|
<span class='kw'>case</span> <span class='id identifier rubyid_cmd'>cmd</span>
|
@@ -696,7 +697,7 @@ any 'cmd_opts' of that sub-command.</p>
|
|
696
697
|
</div>
|
697
698
|
|
698
699
|
<div id="footer">
|
699
|
-
Generated on Thu Sep 20
|
700
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
700
701
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
701
702
|
0.8.2.1 (ruby-1.9.3).
|
702
703
|
</div>
|
data/doc/Dtf/ErrorSystem.html
CHANGED
@@ -99,7 +99,18 @@
|
|
99
99
|
</dl>
|
100
100
|
<div class="clear"></div>
|
101
101
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Dtf::ErrorSystem is DTF's custom error management class</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
102
112
|
|
113
|
+
</div>
|
103
114
|
|
104
115
|
|
105
116
|
|
@@ -131,7 +142,9 @@
|
|
131
142
|
|
132
143
|
|
133
144
|
|
134
|
-
<span class="summary_desc"><div class='inline'
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Reusable object error display method.</p>
|
147
|
+
</div></span>
|
135
148
|
|
136
149
|
</li>
|
137
150
|
|
@@ -154,7 +167,7 @@
|
|
154
167
|
|
155
168
|
|
156
169
|
<span class="summary_desc"><div class='inline'>
|
157
|
-
<p>Reusable error response method.</p>
|
170
|
+
<p>Reusable error raising and response method.</p>
|
158
171
|
</div></span>
|
159
172
|
|
160
173
|
</li>
|
@@ -178,22 +191,38 @@
|
|
178
191
|
|
179
192
|
|
180
193
|
|
181
|
-
</h3><
|
194
|
+
</h3><div class="docstring">
|
195
|
+
<div class="discussion">
|
196
|
+
|
197
|
+
<p>Reusable object error display method.</p>
|
198
|
+
|
199
|
+
<p>Takes an Object as arg and displays that Object's full error messages. Will
|
200
|
+
return the @user object's full error messages, 1 per line.</p>
|
201
|
+
|
202
|
+
<p>Example usage: Dtf::ErrorSystem.display_errors(@user)</p>
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
<div class="tags">
|
208
|
+
|
209
|
+
|
210
|
+
</div><table class="source_code">
|
182
211
|
<tr>
|
183
212
|
<td>
|
184
213
|
<pre class="lines">
|
185
214
|
|
186
215
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
216
|
+
27
|
217
|
+
28
|
218
|
+
29
|
219
|
+
30
|
220
|
+
31
|
221
|
+
32
|
222
|
+
33</pre>
|
194
223
|
</td>
|
195
224
|
<td>
|
196
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
225
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 27</span>
|
197
226
|
|
198
227
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_display_errors'>display_errors</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
|
199
228
|
<span class='comment'># TODO: Refactor error display to take sub-command as an arg
|
@@ -219,7 +248,8 @@
|
|
219
248
|
</h3><div class="docstring">
|
220
249
|
<div class="discussion">
|
221
250
|
|
222
|
-
<p>Reusable error response method
|
251
|
+
<p>Reusable error raising and response method. Returns exit status code of '1'
|
252
|
+
via abort().</p>
|
223
253
|
|
224
254
|
|
225
255
|
</div>
|
@@ -233,25 +263,23 @@
|
|
233
263
|
<pre class="lines">
|
234
264
|
|
235
265
|
|
236
|
-
11
|
237
|
-
12
|
238
266
|
13
|
239
267
|
14
|
240
268
|
15
|
241
269
|
16
|
242
270
|
17
|
243
|
-
18
|
271
|
+
18
|
272
|
+
19</pre>
|
244
273
|
</td>
|
245
274
|
<td>
|
246
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
275
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 13</span>
|
247
276
|
|
248
277
|
<span class='kw'>def</span> <span class='kw'>self</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>
|
249
278
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span>
|
250
279
|
<span class='kw'>rescue</span>
|
251
280
|
<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'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> did not receive all required options.</span><span class='tstring_end'>"</span></span>
|
252
281
|
<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'>Please execute \'dtf </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> -h\' for more information.</span><span class='tstring_end'>"</span></span>
|
253
|
-
<span class='
|
254
|
-
</span> <span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
282
|
+
<span class='id identifier rubyid_abort'>abort</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
255
283
|
<span class='kw'>end</span></pre>
|
256
284
|
</td>
|
257
285
|
</tr>
|
@@ -263,7 +291,7 @@
|
|
263
291
|
</div>
|
264
292
|
|
265
293
|
<div id="footer">
|
266
|
-
Generated on Thu Sep 20
|
294
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
267
295
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
268
296
|
0.8.2.1 (ruby-1.9.3).
|
269
297
|
</div>
|
data/doc/Dtf/OptionsParser.html
CHANGED
@@ -102,7 +102,8 @@
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
104
|
|
105
|
-
<p>
|
105
|
+
<p>Dtf::OptionsParser is DTF's command/options/parameters parsing class. It
|
106
|
+
also doubles as DTF's help system.</p>
|
106
107
|
|
107
108
|
|
108
109
|
</div>
|
@@ -165,7 +166,9 @@
|
|
165
166
|
|
166
167
|
|
167
168
|
|
168
|
-
<span class="summary_desc"><div class='inline'
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>ARGV parsing method and options builder.</p>
|
171
|
+
</div></span>
|
169
172
|
|
170
173
|
</li>
|
171
174
|
|
@@ -188,27 +191,28 @@
|
|
188
191
|
|
189
192
|
|
190
193
|
|
191
|
-
</h3><
|
194
|
+
</h3><div class="docstring">
|
195
|
+
<div class="discussion">
|
196
|
+
|
197
|
+
<p>ARGV parsing method and options builder. Method depends on Trollop gem.</p>
|
198
|
+
|
199
|
+
<p>Dynamically builds, and returns, the @cmd_opts Hash based on contents of
|
200
|
+
@cmd, and provides the help system for options/parameters.</p>
|
201
|
+
|
202
|
+
<p>Returned Values: @cmd [Type: String] and @cmd_opts [Type: Hash]</p>
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
<div class="tags">
|
208
|
+
|
209
|
+
|
210
|
+
</div><table class="source_code">
|
192
211
|
<tr>
|
193
212
|
<td>
|
194
213
|
<pre class="lines">
|
195
214
|
|
196
215
|
|
197
|
-
34
|
198
|
-
35
|
199
|
-
36
|
200
|
-
37
|
201
|
-
38
|
202
|
-
39
|
203
|
-
40
|
204
|
-
41
|
205
|
-
42
|
206
|
-
43
|
207
|
-
44
|
208
|
-
45
|
209
|
-
46
|
210
|
-
47
|
211
|
-
48
|
212
216
|
49
|
213
217
|
50
|
214
218
|
51
|
@@ -245,10 +249,25 @@
|
|
245
249
|
82
|
246
250
|
83
|
247
251
|
84
|
248
|
-
85
|
252
|
+
85
|
253
|
+
86
|
254
|
+
87
|
255
|
+
88
|
256
|
+
89
|
257
|
+
90
|
258
|
+
91
|
259
|
+
92
|
260
|
+
93
|
261
|
+
94
|
262
|
+
95
|
263
|
+
96
|
264
|
+
97
|
265
|
+
98
|
266
|
+
99
|
267
|
+
100</pre>
|
249
268
|
</td>
|
250
269
|
<td>
|
251
|
-
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line
|
270
|
+
<pre class="code"><span class="info file"># File 'lib/dtf.rb', line 49</span>
|
252
271
|
|
253
272
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_cmds'>parse_cmds</span>
|
254
273
|
<span class='comment'># Global options default to '--version|-v' and '--help|-h'
|
@@ -300,7 +319,7 @@
|
|
300
319
|
<span class='const'>Trollop</span><span class='op'>::</span><span class='id identifier rubyid_die'>die</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown DTF sub-command: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@cmd</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
301
320
|
<span class='kw'>end</span>
|
302
321
|
|
303
|
-
<span class='kw'>return</span> <span class='ivar'>@cmd</span><span class='comma'>,</span> <span class='ivar'>@cmd_opts</span> <span class='comment'>#
|
322
|
+
<span class='kw'>return</span> <span class='ivar'>@cmd</span><span class='comma'>,</span> <span class='ivar'>@cmd_opts</span> <span class='comment'># Explicitly return @cmd and its @cmd_opts
|
304
323
|
</span><span class='kw'>end</span></pre>
|
305
324
|
</td>
|
306
325
|
</tr>
|
@@ -312,7 +331,7 @@
|
|
312
331
|
</div>
|
313
332
|
|
314
333
|
<div id="footer">
|
315
|
-
Generated on Thu Sep 20
|
334
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
316
335
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
317
336
|
0.8.2.1 (ruby-1.9.3).
|
318
337
|
</div>
|
data/doc/User.html
CHANGED
@@ -101,7 +101,18 @@
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
103
103
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>User class owns all Verification Suites in the DTF system</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
104
114
|
|
115
|
+
</div>
|
105
116
|
|
106
117
|
|
107
118
|
|
@@ -114,7 +125,7 @@
|
|
114
125
|
</div>
|
115
126
|
|
116
127
|
<div id="footer">
|
117
|
-
Generated on Thu Sep 20
|
128
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
118
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
130
|
0.8.2.1 (ruby-1.9.3).
|
120
131
|
</div>
|
data/doc/VerificationSuite.html
CHANGED
@@ -101,7 +101,28 @@
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
103
103
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>VerificationSuite is the core container class.</p>
|
108
|
+
|
109
|
+
<p>ASSOCIATIONS BREAKDOWN: It contains many AnalysisCases. Each AnalysisCase
|
110
|
+
contains multiple case_tests, owned by both the User and the AnalysisCase.
|
111
|
+
The goal is to make 'packs' of tests which Users can share between Suites,
|
112
|
+
grouped by Cases, and even share those Tests between Cases.</p>
|
113
|
+
|
114
|
+
<p>Also, Users should be able to share their individual Test(s),
|
115
|
+
AnalysisCase(s), through their VerificationSuite(s) with other Users for
|
116
|
+
inclusion in their own AnalysisCase(s) and Suite(s) allowing for
|
117
|
+
mix-and-match batching.</p>
|
118
|
+
|
104
119
|
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
<div class="tags">
|
123
|
+
|
124
|
+
|
125
|
+
</div>
|
105
126
|
|
106
127
|
|
107
128
|
|
@@ -114,7 +135,7 @@
|
|
114
135
|
</div>
|
115
136
|
|
116
137
|
<div id="footer">
|
117
|
-
Generated on Thu Sep 20
|
138
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
118
139
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
140
|
0.8.2.1 (ruby-1.9.3).
|
120
141
|
</div>
|
data/doc/_index.html
CHANGED
@@ -190,7 +190,7 @@
|
|
190
190
|
</div>
|
191
191
|
|
192
192
|
<div id="footer">
|
193
|
-
Generated on Thu Sep 20
|
193
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
194
194
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
195
195
|
0.8.2.1 (ruby-1.9.3).
|
196
196
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -247,7 +247,7 @@ Options:
|
|
247
247
|
</div></div>
|
248
248
|
|
249
249
|
<div id="footer">
|
250
|
-
Generated on Thu Sep 20
|
250
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
251
251
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
252
252
|
0.8.2.1 (ruby-1.9.3).
|
253
253
|
</div>
|
data/doc/index.html
CHANGED
@@ -247,7 +247,7 @@ Options:
|
|
247
247
|
</div></div>
|
248
248
|
|
249
249
|
<div id="footer">
|
250
|
-
Generated on Thu Sep 20
|
250
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
251
251
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
252
252
|
0.8.2.1 (ruby-1.9.3).
|
253
253
|
</div>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on Thu Sep 20
|
108
|
+
Generated on Thu Sep 20 10:37:21 2012 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
110
|
0.8.2.1 (ruby-1.9.3).
|
111
111
|
</div>
|
data/lib/dtf.rb
CHANGED
@@ -1,22 +1,29 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require "dtf/version"
|
4
|
-
require 'trollop'
|
4
|
+
require 'trollop'
|
5
5
|
|
6
6
|
module Dtf
|
7
7
|
load "#{File.join(File.dirname(__FILE__), "/config/environment.rb")}"
|
8
8
|
|
9
|
+
# Dtf::ErrorSystem is DTF's custom error management class
|
9
10
|
class ErrorSystem
|
10
|
-
# Reusable error response method
|
11
|
+
# Reusable error raising and response method.
|
12
|
+
# Returns exit status code of '1' via abort().
|
11
13
|
def self.raise_error(cmd)
|
12
14
|
raise ArgumentError
|
13
15
|
rescue
|
14
16
|
$stderr.puts "ERROR! #{cmd} did not receive all required options."
|
15
17
|
$stderr.puts "Please execute \'dtf #{cmd} -h\' for more information."
|
16
|
-
# Set non-zero exit value on error, for scripting use.
|
17
18
|
abort()
|
18
19
|
end
|
19
20
|
|
21
|
+
# Reusable object error display method.
|
22
|
+
#
|
23
|
+
# Takes an Object as arg and displays that Object's full error messages.
|
24
|
+
# Will return the @user object's full error messages, 1 per line.
|
25
|
+
#
|
26
|
+
# Example usage: Dtf::ErrorSystem.display_errors(@user)
|
20
27
|
def self.display_errors(obj)
|
21
28
|
# TODO: Refactor error display to take sub-command as an arg
|
22
29
|
# and display obj.errors.full_messages.each properly for each arg type.
|
@@ -25,12 +32,20 @@ module Dtf
|
|
25
32
|
end
|
26
33
|
end
|
27
34
|
|
28
|
-
end
|
35
|
+
end
|
29
36
|
|
37
|
+
# Dtf::OptionsParser is DTF's command/options/parameters parsing class.
|
38
|
+
# It also doubles as DTF's help system.
|
30
39
|
class OptionsParser
|
31
40
|
# List of all sub-commands known within the Help System
|
32
41
|
SUB_COMMANDS = %w(create_user delete_user create_vs delete_vs)
|
33
42
|
|
43
|
+
# ARGV parsing method and options builder. Method depends on Trollop gem.
|
44
|
+
#
|
45
|
+
# Dynamically builds, and returns, the @cmd_opts Hash based on contents of @cmd,
|
46
|
+
# and provides the help system for options/parameters.
|
47
|
+
#
|
48
|
+
# Returned Values: @cmd [Type: String] and @cmd_opts [Type: Hash]
|
34
49
|
def self.parse_cmds
|
35
50
|
# Global options default to '--version|-v' and '--help|-h'
|
36
51
|
global_opts = Trollop::options do
|
@@ -81,14 +96,13 @@ module Dtf
|
|
81
96
|
Trollop::die "Unknown DTF sub-command: #{@cmd.inspect}"
|
82
97
|
end
|
83
98
|
|
84
|
-
return @cmd, @cmd_opts #
|
99
|
+
return @cmd, @cmd_opts # Explicitly return @cmd and its @cmd_opts
|
85
100
|
end
|
86
|
-
end
|
101
|
+
end
|
87
102
|
|
88
103
|
|
89
104
|
# Dtf::Command contains all sub-commands availabe in the DTF master gem.
|
90
|
-
# All methods
|
91
|
-
# They are what was captured in the ivars in Dtf::HelpSystem
|
105
|
+
# All methods receive the @cmd and @cmd_opts returned by Dtf::OptionsParser.parse_cmds()
|
92
106
|
class Command
|
93
107
|
|
94
108
|
# Process both the requested command and all/any parameters.
|
@@ -96,7 +110,8 @@ module Dtf
|
|
96
110
|
# off to the appropriate method. All methods are a 1:1 match in their name.
|
97
111
|
# e.g 'create_user' sub-command is matched to the 'create_user' method of this class.
|
98
112
|
#
|
99
|
-
# This method requires, and processes, 2 arguments. The
|
113
|
+
# This method requires, and processes, 2 arguments. The first is a String, the second is a Hash.
|
114
|
+
# They are the 'cmd' to process and any options/parameters, stored in the 'cmd_opts' hash, of that sub-command.
|
100
115
|
def self.process(cmd, cmd_opts)
|
101
116
|
case cmd
|
102
117
|
when "create_user"
|
@@ -246,6 +261,6 @@ module Dtf
|
|
246
261
|
end
|
247
262
|
end
|
248
263
|
|
249
|
-
end
|
264
|
+
end
|
250
265
|
|
251
266
|
end # End of module
|
data/lib/dtf/version.rb
CHANGED