user-choices 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ Version 1.1.3
2
+ * Bugfix: PosixCommandLineSource was not uniformly treated as a
3
+ CommandLineSource.
4
+ * activesupport includes xmlsimple in its vendor directory, which can
5
+ lead to "constant already defined" warnings. Don't require xmlsimple
6
+ if it's already been required under a different name. We bow before you,
7
+ ActiveSupport!
8
+
1
9
  Version 1.1.2
2
10
  * Another stupid typo.
3
11
 
@@ -54,7 +54,7 @@ module UserChoices
54
54
  source = source_class.new
55
55
  message_sends(messages_and_args).each { | send_me | source.send(*send_me) }
56
56
  @sources << source
57
- @command_line_source = source if source_class == CommandLineSource
57
+ @command_line_source = source if source_class <= CommandLineSource
58
58
  end
59
59
 
60
60
  # Once sources and choices have been described, this builds and
@@ -1,4 +1,4 @@
1
- require 'xmlsimple'
1
+ require 'xmlsimple' unless self.class.const_defined?("XmlSimple") # ActiveSupport includes it in /vendor. Grr.
2
2
  require 'yaml'
3
3
  require 's4t-utils'
4
4
  include S4tUtils
@@ -1,3 +1,3 @@
1
1
  module UserChoices
2
- Version = '1.1.2'
2
+ Version = '1.1.3'
3
3
  end
@@ -111,7 +111,7 @@ class TestDefaultsAndTypes < Test::Unit::TestCase
111
111
  def test_missing_required_arg_is_caught_by_command_line
112
112
  with_command_args("") {
113
113
  b = ChoicesBuilder.new
114
- b.add_source(CommandLineSource, :usage, 'foo')
114
+ b.add_source(PosixCommandLineSource, :usage, 'foo')
115
115
  b.add_choice(:targets) { |command_line |
116
116
  command_line.uses_arg
117
117
  }
@@ -145,7 +145,7 @@ class TestDefaultsAndTypes < Test::Unit::TestCase
145
145
  def test_extra_optional_arg_is_caught_by_command_line
146
146
  with_command_args("one extra") {
147
147
  b = ChoicesBuilder.new
148
- b.add_source(CommandLineSource, :usage, 'foo')
148
+ b.add_source(PosixCommandLineSource, :usage, 'foo')
149
149
  b.add_choice(:targets) { |command_line |
150
150
  command_line.uses_optional_arg
151
151
  }
@@ -387,7 +387,7 @@ class YamlConfigFileSourceTestCase < Test::Unit::TestCase
387
387
  | host:
388
388
  | - a.com
389
389
  | - b.com
390
- | listarg: 1,2, 3
390
+ | list-arg: 1,2, 3
391
391
  ".trim('|')
392
392
  end
393
393
 
@@ -423,7 +423,7 @@ class YamlConfigFileSourceTestCase < Test::Unit::TestCase
423
423
  assert_equal("true", choices[:reverse])
424
424
  assert_equal("53", choices[:maximum])
425
425
  assert_equal(['a.com', 'b.com'], choices[:host])
426
- assert_equal("1,2, 3", choices[:listarg])
426
+ assert_equal("1,2, 3", choices[:list_arg])
427
427
  }
428
428
  end
429
429
 
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>currentDocument</key>
6
- <string>lib/user-choices/arglist-strategies.rb</string>
6
+ <string>History.txt</string>
7
7
  <key>documents</key>
8
8
  <array>
9
9
  <dict>
@@ -13,6 +13,8 @@
13
13
  <string>user-choices</string>
14
14
  <key>regexFolderFilter</key>
15
15
  <string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
16
+ <key>selected</key>
17
+ <true/>
16
18
  <key>sourceDirectory</key>
17
19
  <string></string>
18
20
  </dict>
@@ -21,296 +23,14 @@
21
23
  <integer>246</integer>
22
24
  <key>metaData</key>
23
25
  <dict>
24
- <key>LICENSE.txt</key>
25
- <dict>
26
- <key>caret</key>
27
- <dict>
28
- <key>column</key>
29
- <integer>8</integer>
30
- <key>line</key>
31
- <integer>14</integer>
32
- </dict>
33
- <key>firstVisibleColumn</key>
34
- <integer>0</integer>
35
- <key>firstVisibleLine</key>
36
- <integer>0</integer>
37
- </dict>
38
- <key>Manifest.txt</key>
39
- <dict>
40
- <key>caret</key>
41
- <dict>
42
- <key>column</key>
43
- <integer>0</integer>
44
- <key>line</key>
45
- <integer>4</integer>
46
- </dict>
47
- <key>firstVisibleColumn</key>
48
- <integer>0</integer>
49
- <key>firstVisibleLine</key>
50
- <integer>0</integer>
51
- </dict>
52
- <key>README.txt</key>
26
+ <key>History.txt</key>
53
27
  <dict>
54
28
  <key>caret</key>
55
29
  <dict>
56
30
  <key>column</key>
57
- <integer>89</integer>
58
- <key>line</key>
59
31
  <integer>0</integer>
60
- </dict>
61
- <key>firstVisibleColumn</key>
62
- <integer>0</integer>
63
- <key>firstVisibleLine</key>
64
- <integer>0</integer>
65
- </dict>
66
- <key>Rakefile</key>
67
- <dict>
68
- <key>caret</key>
69
- <dict>
70
- <key>column</key>
71
- <integer>0</integer>
72
- <key>line</key>
73
- <integer>0</integer>
74
- </dict>
75
- <key>firstVisibleColumn</key>
76
- <integer>0</integer>
77
- <key>firstVisibleLine</key>
78
- <integer>0</integer>
79
- </dict>
80
- <key>Rakefile.hoe</key>
81
- <dict>
82
- <key>caret</key>
83
- <dict>
84
- <key>column</key>
85
- <integer>62</integer>
86
- <key>line</key>
87
- <integer>17</integer>
88
- </dict>
89
- <key>firstVisibleColumn</key>
90
- <integer>0</integer>
91
- <key>firstVisibleLine</key>
92
- <integer>0</integer>
93
- </dict>
94
- <key>examples/older/command-line.rb</key>
95
- <dict>
96
- <key>caret</key>
97
- <dict>
98
- <key>column</key>
99
- <integer>48</integer>
100
- <key>line</key>
101
- <integer>4</integer>
102
- </dict>
103
- <key>columnSelection</key>
104
- <false/>
105
- <key>firstVisibleColumn</key>
106
- <integer>0</integer>
107
- <key>firstVisibleLine</key>
108
- <integer>0</integer>
109
- <key>selectFrom</key>
110
- <dict>
111
- <key>column</key>
112
- <integer>55</integer>
113
- <key>line</key>
114
- <integer>4</integer>
115
- </dict>
116
- <key>selectTo</key>
117
- <dict>
118
- <key>column</key>
119
- <integer>48</integer>
120
- <key>line</key>
121
- <integer>4</integer>
122
- </dict>
123
- </dict>
124
- <key>examples/older/default-values.rb</key>
125
- <dict>
126
- <key>caret</key>
127
- <dict>
128
- <key>column</key>
129
- <integer>55</integer>
130
- <key>line</key>
131
- <integer>4</integer>
132
- </dict>
133
- <key>firstVisibleColumn</key>
134
- <integer>0</integer>
135
- <key>firstVisibleLine</key>
136
- <integer>0</integer>
137
- </dict>
138
- <key>examples/older/multiple-sources.rb</key>
139
- <dict>
140
- <key>caret</key>
141
- <dict>
142
- <key>column</key>
143
- <integer>55</integer>
144
- <key>line</key>
145
- <integer>4</integer>
146
- </dict>
147
- <key>firstVisibleColumn</key>
148
- <integer>0</integer>
149
- <key>firstVisibleLine</key>
150
- <integer>0</integer>
151
- </dict>
152
- <key>examples/older/postprocess.rb</key>
153
- <dict>
154
- <key>caret</key>
155
- <dict>
156
- <key>column</key>
157
- <integer>55</integer>
158
- <key>line</key>
159
- <integer>4</integer>
160
- </dict>
161
- <key>firstVisibleColumn</key>
162
- <integer>0</integer>
163
- <key>firstVisibleLine</key>
164
- <integer>0</integer>
165
- </dict>
166
- <key>examples/older/switches.rb</key>
167
- <dict>
168
- <key>caret</key>
169
- <dict>
170
- <key>column</key>
171
- <integer>55</integer>
172
- <key>line</key>
173
- <integer>4</integer>
174
- </dict>
175
- <key>firstVisibleColumn</key>
176
- <integer>0</integer>
177
- <key>firstVisibleLine</key>
178
- <integer>0</integer>
179
- </dict>
180
- <key>examples/older/two-args.rb</key>
181
- <dict>
182
- <key>caret</key>
183
- <dict>
184
- <key>column</key>
185
- <integer>55</integer>
186
- <key>line</key>
187
- <integer>4</integer>
188
- </dict>
189
- <key>firstVisibleColumn</key>
190
- <integer>0</integer>
191
- <key>firstVisibleLine</key>
192
- <integer>0</integer>
193
- </dict>
194
- <key>examples/older/types.rb</key>
195
- <dict>
196
- <key>caret</key>
197
- <dict>
198
- <key>column</key>
199
- <integer>55</integer>
200
- <key>line</key>
201
- <integer>4</integer>
202
- </dict>
203
- <key>firstVisibleColumn</key>
204
- <integer>0</integer>
205
- <key>firstVisibleLine</key>
206
- <integer>0</integer>
207
- </dict>
208
- <key>examples/tutorial/index.html</key>
209
- <dict>
210
- <key>caret</key>
211
- <dict>
212
- <key>column</key>
213
- <integer>466</integer>
214
- <key>line</key>
215
- <integer>16</integer>
216
- </dict>
217
- <key>firstVisibleColumn</key>
218
- <integer>0</integer>
219
- <key>firstVisibleLine</key>
220
- <integer>0</integer>
221
- </dict>
222
- <key>examples/tutorial/tutorial1.rb</key>
223
- <dict>
224
- <key>caret</key>
225
- <dict>
226
- <key>column</key>
227
- <integer>12</integer>
228
- <key>line</key>
229
- <integer>14</integer>
230
- </dict>
231
- <key>firstVisibleColumn</key>
232
- <integer>0</integer>
233
- <key>firstVisibleLine</key>
234
- <integer>6</integer>
235
- </dict>
236
- <key>examples/tutorial/tutorial2.rb</key>
237
- <dict>
238
- <key>caret</key>
239
- <dict>
240
- <key>column</key>
241
- <integer>55</integer>
242
32
  <key>line</key>
243
- <integer>12</integer>
244
- </dict>
245
- <key>firstVisibleColumn</key>
246
- <integer>0</integer>
247
- <key>firstVisibleLine</key>
248
- <integer>0</integer>
249
- </dict>
250
- <key>examples/tutorial/tutorial3.rb</key>
251
- <dict>
252
- <key>caret</key>
253
- <dict>
254
- <key>column</key>
255
- <integer>55</integer>
256
- <key>line</key>
257
- <integer>12</integer>
258
- </dict>
259
- <key>firstVisibleColumn</key>
260
- <integer>0</integer>
261
- <key>firstVisibleLine</key>
262
- <integer>0</integer>
263
- </dict>
264
- <key>examples/tutorial/tutorial4.rb</key>
265
- <dict>
266
- <key>caret</key>
267
- <dict>
268
- <key>column</key>
269
- <integer>55</integer>
270
- <key>line</key>
271
- <integer>12</integer>
272
- </dict>
273
- <key>firstVisibleColumn</key>
274
- <integer>0</integer>
275
- <key>firstVisibleLine</key>
276
- <integer>0</integer>
277
- </dict>
278
- <key>examples/tutorial/tutorial5.rb</key>
279
- <dict>
280
- <key>caret</key>
281
- <dict>
282
- <key>column</key>
283
- <integer>55</integer>
284
- <key>line</key>
285
- <integer>11</integer>
286
- </dict>
287
- <key>firstVisibleColumn</key>
288
- <integer>0</integer>
289
- <key>firstVisibleLine</key>
290
- <integer>0</integer>
291
- </dict>
292
- <key>examples/tutorial/tutorial6.rb</key>
293
- <dict>
294
- <key>caret</key>
295
- <dict>
296
- <key>column</key>
297
- <integer>55</integer>
298
- <key>line</key>
299
- <integer>11</integer>
300
- </dict>
301
- <key>firstVisibleColumn</key>
302
- <integer>0</integer>
303
- <key>firstVisibleLine</key>
304
- <integer>0</integer>
305
- </dict>
306
- <key>examples/tutorial/tutorial7.rb</key>
307
- <dict>
308
- <key>caret</key>
309
- <dict>
310
- <key>column</key>
311
- <integer>55</integer>
312
- <key>line</key>
313
- <integer>11</integer>
33
+ <integer>10</integer>
314
34
  </dict>
315
35
  <key>firstVisibleColumn</key>
316
36
  <integer>0</integer>
@@ -329,91 +49,49 @@
329
49
  <key>firstVisibleColumn</key>
330
50
  <integer>0</integer>
331
51
  <key>firstVisibleLine</key>
332
- <integer>0</integer>
52
+ <integer>97</integer>
333
53
  </dict>
334
54
  <key>lib/user-choices/arglist-strategies.rb</key>
335
55
  <dict>
336
56
  <key>caret</key>
337
57
  <dict>
338
58
  <key>column</key>
339
- <integer>50</integer>
59
+ <integer>5</integer>
340
60
  <key>line</key>
341
- <integer>173</integer>
61
+ <integer>160</integer>
342
62
  </dict>
343
63
  <key>firstVisibleColumn</key>
344
64
  <integer>0</integer>
345
65
  <key>firstVisibleLine</key>
346
- <integer>0</integer>
66
+ <integer>111</integer>
347
67
  </dict>
348
68
  <key>lib/user-choices/builder.rb</key>
349
69
  <dict>
350
70
  <key>caret</key>
351
71
  <dict>
352
72
  <key>column</key>
353
- <integer>28</integer>
73
+ <integer>53</integer>
354
74
  <key>line</key>
355
75
  <integer>56</integer>
356
76
  </dict>
357
77
  <key>firstVisibleColumn</key>
358
78
  <integer>0</integer>
359
79
  <key>firstVisibleLine</key>
360
- <integer>57</integer>
361
- </dict>
362
- <key>lib/user-choices/command-line-source.rb</key>
363
- <dict>
364
- <key>caret</key>
365
- <dict>
366
- <key>column</key>
367
- <integer>0</integer>
368
- <key>line</key>
369
- <integer>184</integer>
370
- </dict>
371
- <key>firstVisibleColumn</key>
372
80
  <integer>0</integer>
373
- <key>firstVisibleLine</key>
374
- <integer>46</integer>
375
81
  </dict>
376
- <key>lib/user-choices/command.rb</key>
377
- <dict>
378
- <key>caret</key>
379
- <dict>
380
- <key>column</key>
381
- <integer>26</integer>
382
- <key>line</key>
383
- <integer>11</integer>
384
- </dict>
385
- <key>firstVisibleColumn</key>
386
- <integer>0</integer>
387
- <key>firstVisibleLine</key>
388
- <integer>0</integer>
389
- </dict>
390
- <key>lib/user-choices/conversions.rb</key>
391
- <dict>
392
- <key>caret</key>
393
- <dict>
394
- <key>column</key>
395
- <integer>0</integer>
396
- <key>line</key>
397
- <integer>151</integer>
398
- </dict>
399
- <key>firstVisibleColumn</key>
400
- <integer>0</integer>
401
- <key>firstVisibleLine</key>
402
- <integer>122</integer>
403
- </dict>
404
- <key>lib/user-choices/ruby-extensions.rb</key>
82
+ <key>lib/user-choices/command-line-source.rb</key>
405
83
  <dict>
406
84
  <key>caret</key>
407
85
  <dict>
408
86
  <key>column</key>
409
- <integer>5</integer>
87
+ <integer>31</integer>
410
88
  <key>line</key>
411
- <integer>17</integer>
89
+ <integer>56</integer>
412
90
  </dict>
413
91
  <key>firstVisibleColumn</key>
414
92
  <integer>0</integer>
415
93
  <key>firstVisibleLine</key>
416
- <integer>0</integer>
94
+ <integer>107</integer>
417
95
  </dict>
418
96
  <key>lib/user-choices/sources.rb</key>
419
97
  <dict>
@@ -422,35 +100,21 @@
422
100
  <key>column</key>
423
101
  <integer>0</integer>
424
102
  <key>line</key>
425
- <integer>10</integer>
426
- </dict>
427
- <key>firstVisibleColumn</key>
428
- <integer>0</integer>
429
- <key>firstVisibleLine</key>
430
- <integer>237</integer>
431
- </dict>
432
- <key>lib/user-choices/version.rb</key>
433
- <dict>
434
- <key>caret</key>
435
- <dict>
436
- <key>column</key>
437
103
  <integer>0</integer>
438
- <key>line</key>
439
- <integer>3</integer>
440
104
  </dict>
441
105
  <key>firstVisibleColumn</key>
442
106
  <integer>0</integer>
443
107
  <key>firstVisibleLine</key>
444
108
  <integer>0</integer>
445
109
  </dict>
446
- <key>test/arglist-strategy-tests.rb</key>
110
+ <key>lib/user-choices/version.rb</key>
447
111
  <dict>
448
112
  <key>caret</key>
449
113
  <dict>
450
114
  <key>column</key>
451
- <integer>0</integer>
115
+ <integer>18</integer>
452
116
  <key>line</key>
453
- <integer>23</integer>
117
+ <integer>1</integer>
454
118
  </dict>
455
119
  <key>firstVisibleColumn</key>
456
120
  <integer>0</integer>
@@ -464,126 +128,43 @@
464
128
  <key>column</key>
465
129
  <integer>5</integer>
466
130
  <key>line</key>
467
- <integer>107</integer>
468
- </dict>
469
- <key>firstVisibleColumn</key>
470
- <integer>0</integer>
471
- <key>firstVisibleLine</key>
472
- <integer>516</integer>
473
- </dict>
474
- <key>test/command-line-source-tests.rb</key>
475
- <dict>
476
- <key>caret</key>
477
- <dict>
478
- <key>column</key>
479
- <integer>0</integer>
480
- <key>line</key>
481
- <integer>412</integer>
482
- </dict>
483
- <key>firstVisibleColumn</key>
484
- <integer>0</integer>
485
- <key>firstVisibleLine</key>
486
- <integer>390</integer>
487
- </dict>
488
- <key>test/conversion-tests.rb</key>
489
- <dict>
490
- <key>caret</key>
491
- <dict>
492
- <key>column</key>
493
- <integer>50</integer>
494
- <key>line</key>
495
- <integer>101</integer>
131
+ <integer>83</integer>
496
132
  </dict>
497
133
  <key>firstVisibleColumn</key>
498
134
  <integer>0</integer>
499
135
  <key>firstVisibleLine</key>
500
- <integer>103</integer>
501
- </dict>
502
- <key>test/set-standalone-test-paths.rb</key>
503
- <dict>
504
- <key>caret</key>
505
- <dict>
506
- <key>column</key>
507
- <integer>0</integer>
508
- <key>line</key>
509
- <integer>5</integer>
510
- </dict>
511
- <key>firstVisibleColumn</key>
512
- <integer>0</integer>
513
- <key>firstVisibleLine</key>
514
- <integer>0</integer>
136
+ <integer>138</integer>
515
137
  </dict>
516
138
  <key>test/source-tests.rb</key>
517
139
  <dict>
518
140
  <key>caret</key>
519
141
  <dict>
520
142
  <key>column</key>
521
- <integer>0</integer>
522
- <key>line</key>
523
- <integer>0</integer>
524
- </dict>
525
- <key>firstVisibleColumn</key>
526
- <integer>0</integer>
527
- <key>firstVisibleLine</key>
528
- <integer>0</integer>
529
- </dict>
530
- <key>test/user-choices-slowtests.rb</key>
531
- <dict>
532
- <key>caret</key>
533
- <dict>
534
- <key>column</key>
535
- <integer>50</integer>
143
+ <integer>25</integer>
536
144
  <key>line</key>
537
- <integer>113</integer>
145
+ <integer>399</integer>
538
146
  </dict>
539
147
  <key>firstVisibleColumn</key>
540
148
  <integer>0</integer>
541
149
  <key>firstVisibleLine</key>
542
- <integer>87</integer>
150
+ <integer>378</integer>
543
151
  </dict>
544
152
  </dict>
545
153
  <key>openDocuments</key>
546
154
  <array>
547
- <string>test/conversion-tests.rb</string>
548
- <string>test/set-standalone-test-paths.rb</string>
549
- <string>test/source-tests.rb</string>
550
- <string>examples/older/command-line.rb</string>
551
- <string>examples/older/default-values.rb</string>
552
- <string>examples/older/multiple-sources.rb</string>
553
- <string>examples/older/postprocess.rb</string>
554
- <string>examples/older/switches.rb</string>
555
- <string>examples/older/two-args.rb</string>
556
- <string>examples/older/types.rb</string>
557
- <string>examples/tutorial/tutorial1.rb</string>
558
- <string>examples/tutorial/tutorial2.rb</string>
559
- <string>examples/tutorial/tutorial3.rb</string>
560
- <string>examples/tutorial/tutorial4.rb</string>
561
- <string>examples/tutorial/tutorial5.rb</string>
562
- <string>examples/tutorial/tutorial6.rb</string>
563
- <string>examples/tutorial/tutorial7.rb</string>
564
- <string>test/user-choices-slowtests.rb</string>
565
- <string>examples/tutorial/index.html</string>
566
- <string>LICENSE.txt</string>
567
- <string>README.txt</string>
568
- <string>test/arglist-strategy-tests.rb</string>
569
- <string>Rakefile</string>
570
- <string>Rakefile.hoe</string>
571
155
  <string>lib/user-choices/command-line-source.rb</string>
572
156
  <string>lib/user-choices/builder.rb</string>
573
157
  <string>test/builder-tests.rb</string>
574
- <string>test/command-line-source-tests.rb</string>
575
- <string>lib/user-choices/command.rb</string>
158
+ <string>test/source-tests.rb</string>
159
+ <string>History.txt</string>
576
160
  <string>lib/user-choices.rb</string>
577
- <string>lib/user-choices/sources.rb</string>
578
161
  <string>lib/user-choices/version.rb</string>
579
- <string>lib/user-choices/ruby-extensions.rb</string>
162
+ <string>lib/user-choices/sources.rb</string>
580
163
  <string>lib/user-choices/arglist-strategies.rb</string>
581
- <string>Manifest.txt</string>
582
- <string>lib/user-choices/conversions.rb</string>
583
164
  </array>
584
165
  <key>showFileHierarchyDrawer</key>
585
166
  <true/>
586
167
  <key>windowFrame</key>
587
- <string>{{5, 0}, {861, 778}}</string>
168
+ <string>{{8, 0}, {861, 778}}</string>
588
169
  </dict>
589
170
  </plist>
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: user-choices
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.2
7
- date: 2007-09-15 00:00:00 -05:00
6
+ version: 1.1.3
7
+ date: 2007-09-19 00:00:00 -05:00
8
8
  summary: Unified interface to command-line, environment, and configuration files.
9
9
  require_paths:
10
10
  - lib