user-choices 1.1.6 → 1.1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ Version 1.1.6.1
2
+ * fix the old style tokens for 'case' statement from ':' to 'then' for Ruby 1.9
3
+
1
4
  Version 1.1.6
2
5
  * Allow a :string type conversion (user request). It does nothing.
3
6
 
data/README.txt CHANGED
@@ -1 +1,3 @@
1
- The best introduction to user-choices is the tutorial[http://user-choices.rubyforge.org].
1
+ = user-choices
2
+
3
+ * The best introduction to user-choices is the tutorial[http://user-choices.rubyforge.org].
data/Rakefile CHANGED
@@ -11,20 +11,21 @@ PROJECT='user-choices'
11
11
  THIS_RELEASE=UserChoices::Version
12
12
 
13
13
 
14
- Hoe.new(PROJECT, THIS_RELEASE) do |p|
15
- p.rubyforge_name = PROJECT
16
- p.changes = "See History.txt"
17
- p.author = "Brian Marick"
18
- p.description = "Unified interface to command-line, environment, and configuration files."
19
- p.summary = p.description
20
- p.email = "marick@exampler.com"
21
- p.extra_deps = [['xml-simple', '>= 1.0.11'],
14
+ Hoe.spec(PROJECT) do |spec|
15
+ spec.rubyforge_name = PROJECT
16
+ spec.version = THIS_RELEASE
17
+ spec.changes = "See History.txt"
18
+ spec.author = "Brian Marick"
19
+ spec.description = "Unified interface to command-line, environment, and configuration files."
20
+ spec.summary = spec.description
21
+ spec.email = "marick@exampler.com"
22
+ spec.extra_deps = [['xml-simple', '>= 1.0.11'],
22
23
  ['s4t-utils', '>= 1.0.3'],
23
24
  ['builder', '>= 2.1.2']] # for testing
24
- p.test_globs = "test/**/*tests.rb"
25
- p.rdoc_pattern = %r{README.txt|History.txt|lib/user-choices.rb|lib/user-choices/.+\.rb}
26
- p.url = "http://user-choices.rubyforge.org"
27
- p.remote_rdoc_dir = 'rdoc'
25
+ spec.test_globs = "test/**/*tests.rb"
26
+ spec.extra_rdoc_files = ['README.txt', 'History.txt']
27
+ spec.url = "http://user-choices.rubyforge.org"
28
+ spec.remote_rdoc_dir = 'rdoc'
28
29
  end
29
30
 
30
31
  require 's4t-utils/rake-task-helpers'
@@ -1,242 +1,242 @@
1
- #header {
2
- width:750px;
3
- height:150px;
4
- color:#fff;
5
- font-size:50px;
6
- letter-spacing:-2px;
7
- margin:0;
8
- }
9
-
10
- .highlight {
11
- color:#F1Ca3f;
12
- }
13
-
14
- #headerLeft {
15
- background-color:#eaeaea;
16
- height:150px;
17
- width:150px;
18
- float:left;
19
- background:url("von-foerster.jpg") no-repeat !important;
20
- }
21
-
22
- #headerRight {
23
- background-color:#78300A;
24
- color:#fff;
25
- height:150px;
26
- margin-left:155px;
27
- background:url("tvline.gif") repeat !important;
28
- }
29
-
30
- #headerRight h1 {
31
- padding-top:25px;
32
- padding-left:10px;
33
- font-size:1.2em;
34
- letter-spacing:-4px;
35
- line-height:.6em;
36
- margin:0;
37
- }
38
-
39
- #headerRight h2 {
40
- padding-top:15px;
41
- padding-left:10px;
42
- font-size:0.4em;
43
- letter-spacing:-1px;
44
- line-height:1.2em;
45
- margin:0;
46
- }
47
-
48
- body {
49
- font-family:verdana;
50
- font-size:12px;
51
- margin:0;
52
- padding:0;
53
- }
54
-
55
- #pageBody {
56
- background-color:orange;
57
- font-family:verdana;
58
- margin:0;
59
- padding:20px;
60
- }
61
-
62
- #inlineTOC {
63
- float: right;
64
- list-style: none;
65
- background: #EBC851;
66
- margin-left: 1em;
67
- margin-bottom: 5pt;
68
- /* include-source: url(inlinetoc.html); */
69
- }
70
-
71
- #inlineTOC ul {
72
- list-style-type: none;
73
- padding-right: 1em;
74
- padding-left: 1em;
75
- }
76
-
77
- #inlineTOC a {
78
- font-weight:700;
79
- color:#765;
80
- text-decoration:none;
81
- }
82
-
83
- #inlineTOC A:hover {
84
- color:#333;
85
- }
86
-
87
-
88
-
89
- #container {
90
- width:750px;
91
- height:auto;
92
- background-color:#FFF;
93
- margin:0 auto auto;
94
- padding:0;
95
- }
96
-
97
- #nav {
98
- width:80%;
99
- font-family:Verdana, sans-serif;
100
- margin:2em;
101
- padding:5px;
102
- }
103
-
104
- #nav ul,#nav li {
105
- display:inline;
106
- color:#339;
107
- font-weight:700;
108
- margin:0;
109
- padding:0;
110
- }
111
-
112
- #nav li a {
113
- height:25px;
114
- width:25px;
115
- background-color:red;
116
- border:1px solid #000;
117
- }
118
-
119
- #logo {
120
- background-color:#FFF;
121
- text-align:left;
122
- width:750px;
123
- height:auto;
124
- padding-bottom:10px;
125
- padding-left:5px;
126
- font-size:30px;
127
- }
128
-
129
- #content {
130
- margin-top:50px;
131
- font-size:14px;
132
- text-decoration:none;
133
- width:750px;
134
- height:auto;
135
- border-bottom:1px solid #eaeaea;
136
- line-height:160%;
137
- }
138
-
139
- #content h2 {
140
- color:#000;
141
- font-size:15px;
142
- padding-left:2px;
143
- }
144
-
145
-
146
- blockquote {
147
- background-color:#f2f2f2;
148
- width:auto;
149
- margin-left:25px;
150
- margin-right:25px;
151
- display:block;
152
- padding:0.5em 0.5em 0.5em 1em;
153
- }
154
-
155
- #footer {
156
- color:gray;
157
- font-size:10px;
158
- text-decoration:none;
159
- padding-top:5px;
160
- }
161
-
162
- img.right {
163
- float:right;
164
- margin-left:5px;
165
- padding:5px;
166
- }
167
-
168
- img.left {
169
- float:left;
170
- margin-right:5px;
171
- padding:5px;
172
- }
173
-
174
- img.center {
175
- display: block;
176
- margin-left: auto;
177
- margin-right: auto
178
- }
179
-
180
- .normal {
181
- color:gray;
182
- text-decoration:none;
183
- }
184
-
185
- #outer-container {
186
- background-color:#fff;
187
- width:790px;
188
- border:1px solid #888;
189
- margin:auto;
190
- padding:15px 0;
191
- }
192
-
193
- #centerNav {
194
- padding-left:203px;
195
- }
196
-
197
- #headerNav {
198
- margin-top:5px;
199
- font-size:93%;
200
- background-color: #F1Ca3f;
201
- float:left;
202
- width:100%;
203
- line-height:normal;
204
- padding-bottom:-1px;
205
- }
206
-
207
- #headerNav UL {
208
- list-style-type:none;
209
- margin:0;
210
- padding:10px 10px 0;
211
- }
212
-
213
- #headerNav LI {
214
- background:url(left.gif) no-repeat left top;
215
- float:left;
216
- margin:0;
217
- padding:0 0 0 9px;
218
- }
219
-
220
- #headerNav A {
221
- display:block;
222
- font-weight:700;
223
- background:url(right.gif) no-repeat right top;
224
- color:#765;
225
- text-decoration:none;
226
- float:none;
227
- padding:5px 15px 4px 6px;
228
- }
229
-
230
- #headerNav A:hover {
231
- color:#333;
232
- }
233
-
234
- #headerNav #current {
235
- background-image:url(left_on.gif);
236
- }
237
-
238
- #headerNav #current A {
239
- background-image:url(right_on.gif);
240
- padding-bottom:5px;
241
- color:#333;
1
+ #header {
2
+ width:750px;
3
+ height:150px;
4
+ color:#fff;
5
+ font-size:50px;
6
+ letter-spacing:-2px;
7
+ margin:0;
8
+ }
9
+
10
+ .highlight {
11
+ color:#F1Ca3f;
12
+ }
13
+
14
+ #headerLeft {
15
+ background-color:#eaeaea;
16
+ height:150px;
17
+ width:150px;
18
+ float:left;
19
+ background:url("von-foerster.jpg") no-repeat !important;
20
+ }
21
+
22
+ #headerRight {
23
+ background-color:#78300A;
24
+ color:#fff;
25
+ height:150px;
26
+ margin-left:155px;
27
+ background:url("tvline.gif") repeat !important;
28
+ }
29
+
30
+ #headerRight h1 {
31
+ padding-top:25px;
32
+ padding-left:10px;
33
+ font-size:1.2em;
34
+ letter-spacing:-4px;
35
+ line-height:.6em;
36
+ margin:0;
37
+ }
38
+
39
+ #headerRight h2 {
40
+ padding-top:15px;
41
+ padding-left:10px;
42
+ font-size:0.4em;
43
+ letter-spacing:-1px;
44
+ line-height:1.2em;
45
+ margin:0;
46
+ }
47
+
48
+ body {
49
+ font-family:verdana;
50
+ font-size:12px;
51
+ margin:0;
52
+ padding:0;
53
+ }
54
+
55
+ #pageBody {
56
+ background-color:orange;
57
+ font-family:verdana;
58
+ margin:0;
59
+ padding:20px;
60
+ }
61
+
62
+ #inlineTOC {
63
+ float: right;
64
+ list-style: none;
65
+ background: #EBC851;
66
+ margin-left: 1em;
67
+ margin-bottom: 5pt;
68
+ /* include-source: url(inlinetoc.html); */
69
+ }
70
+
71
+ #inlineTOC ul {
72
+ list-style-type: none;
73
+ padding-right: 1em;
74
+ padding-left: 1em;
75
+ }
76
+
77
+ #inlineTOC a {
78
+ font-weight:700;
79
+ color:#765;
80
+ text-decoration:none;
81
+ }
82
+
83
+ #inlineTOC A:hover {
84
+ color:#333;
85
+ }
86
+
87
+
88
+
89
+ #container {
90
+ width:750px;
91
+ height:auto;
92
+ background-color:#FFF;
93
+ margin:0 auto auto;
94
+ padding:0;
95
+ }
96
+
97
+ #nav {
98
+ width:80%;
99
+ font-family:Verdana, sans-serif;
100
+ margin:2em;
101
+ padding:5px;
102
+ }
103
+
104
+ #nav ul,#nav li {
105
+ display:inline;
106
+ color:#339;
107
+ font-weight:700;
108
+ margin:0;
109
+ padding:0;
110
+ }
111
+
112
+ #nav li a {
113
+ height:25px;
114
+ width:25px;
115
+ background-color:red;
116
+ border:1px solid #000;
117
+ }
118
+
119
+ #logo {
120
+ background-color:#FFF;
121
+ text-align:left;
122
+ width:750px;
123
+ height:auto;
124
+ padding-bottom:10px;
125
+ padding-left:5px;
126
+ font-size:30px;
127
+ }
128
+
129
+ #content {
130
+ margin-top:50px;
131
+ font-size:14px;
132
+ text-decoration:none;
133
+ width:750px;
134
+ height:auto;
135
+ border-bottom:1px solid #eaeaea;
136
+ line-height:160%;
137
+ }
138
+
139
+ #content h2 {
140
+ color:#000;
141
+ font-size:15px;
142
+ padding-left:2px;
143
+ }
144
+
145
+
146
+ blockquote {
147
+ background-color:#f2f2f2;
148
+ width:auto;
149
+ margin-left:25px;
150
+ margin-right:25px;
151
+ display:block;
152
+ padding:0.5em 0.5em 0.5em 1em;
153
+ }
154
+
155
+ #footer {
156
+ color:gray;
157
+ font-size:10px;
158
+ text-decoration:none;
159
+ padding-top:5px;
160
+ }
161
+
162
+ img.right {
163
+ float:right;
164
+ margin-left:5px;
165
+ padding:5px;
166
+ }
167
+
168
+ img.left {
169
+ float:left;
170
+ margin-right:5px;
171
+ padding:5px;
172
+ }
173
+
174
+ img.center {
175
+ display: block;
176
+ margin-left: auto;
177
+ margin-right: auto
178
+ }
179
+
180
+ .normal {
181
+ color:gray;
182
+ text-decoration:none;
183
+ }
184
+
185
+ #outer-container {
186
+ background-color:#fff;
187
+ width:790px;
188
+ border:1px solid #888;
189
+ margin:auto;
190
+ padding:15px 0;
191
+ }
192
+
193
+ #centerNav {
194
+ padding-left:203px;
195
+ }
196
+
197
+ #headerNav {
198
+ margin-top:5px;
199
+ font-size:93%;
200
+ background-color: #F1Ca3f;
201
+ float:left;
202
+ width:100%;
203
+ line-height:normal;
204
+ padding-bottom:-1px;
205
+ }
206
+
207
+ #headerNav UL {
208
+ list-style-type:none;
209
+ margin:0;
210
+ padding:10px 10px 0;
211
+ }
212
+
213
+ #headerNav LI {
214
+ background:url(left.gif) no-repeat left top;
215
+ float:left;
216
+ margin:0;
217
+ padding:0 0 0 9px;
218
+ }
219
+
220
+ #headerNav A {
221
+ display:block;
222
+ font-weight:700;
223
+ background:url(right.gif) no-repeat right top;
224
+ color:#765;
225
+ text-decoration:none;
226
+ float:none;
227
+ padding:5px 15px 4px 6px;
228
+ }
229
+
230
+ #headerNav A:hover {
231
+ color:#333;
232
+ }
233
+
234
+ #headerNav #current {
235
+ background-image:url(left_on.gif);
236
+ }
237
+
238
+ #headerNav #current A {
239
+ background-image:url(right_on.gif);
240
+ padding-bottom:5px;
241
+ color:#333;
242
242
  }
@@ -373,7 +373,7 @@ if $0 == __FILE__ <br />
373
373
  </p></dd>
374
374
 
375
375
  <dt><font style="color: #800020;">:type</font>
376
- => <i>:string</i></dt>
376
+ => <b><font style="color: #800020;">:string</font></b></dt>
377
377
  <dd><p>
378
378
  Leave the string alone. Since that's
379
379
  the default behavior, this case is only for
@@ -145,9 +145,9 @@ module UserChoices # :nodoc:
145
145
 
146
146
  def fill(arglist)
147
147
  case arglist.length
148
- when 0: # This is not considered an error because another source
148
+ when 0 then # This is not considered an error because another source
149
149
  # might fill in the value.
150
- when 1: @value_holder[@choice] = arglist[0]
150
+ when 1 then @value_holder[@choice] = arglist[0]
151
151
  else user_is_bewildered(arglist_arity_error(arglist.length, self.arity))
152
152
  end
153
153
  end
@@ -78,7 +78,7 @@ module UserChoices
78
78
 
79
79
  def convert(value)
80
80
  case value
81
- when String: eval(value.downcase)
81
+ when String then eval(value.downcase)
82
82
  else value
83
83
  end
84
84
  end
@@ -97,8 +97,8 @@ module UserChoices
97
97
 
98
98
  def convert(value)
99
99
  case value
100
- when String: value.split(',')
101
- when Array: value
100
+ when String then value.split(',')
101
+ when Array then value
102
102
  end
103
103
  end
104
104
 
@@ -60,7 +60,7 @@ module UserChoices # :nodoc
60
60
 
61
61
  def pretty_value(value)
62
62
  case value
63
- when Array: value.inspect
63
+ when Array then value.inspect
64
64
  else "'#{value}'"
65
65
  end
66
66
  end
@@ -262,8 +262,8 @@ module UserChoices # :nodoc
262
262
 
263
263
  def ensure_element_is_string(collection, key)
264
264
  case collection[key]
265
- when Hash: ensure_hash_values_are_strings(collection[key])
266
- when Array: ensure_array_values_are_strings(collection[key])
265
+ when Hash then ensure_hash_values_are_strings(collection[key])
266
+ when Array then ensure_array_values_are_strings(collection[key])
267
267
  else collection[key] = collection[key].to_s
268
268
  end
269
269
  end
@@ -1,3 +1,3 @@
1
1
  module UserChoices
2
- Version = '1.1.6'
2
+ Version = '1.1.6.1'
3
3
  end
metadata CHANGED
@@ -1,33 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: user-choices
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.1.6
7
- date: 2007-11-19 00:00:00 -06:00
8
- summary: Unified interface to command-line, environment, and configuration files.
9
- require_paths:
10
- - lib
11
- email: marick@exampler.com
12
- homepage: http://user-choices.rubyforge.org
13
- rubyforge_project: user-choices
14
- description: Unified interface to command-line, environment, and configuration files.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.1.6.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Brian Marick
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-15 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: xml-simple
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.0.11
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: s4t-utils
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.3
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: builder
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.1.2
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: hoe
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 2.3.3
54
+ version:
55
+ description: Unified interface to command-line, environment, and configuration files.
56
+ email: marick@exampler.com
57
+ executables: []
58
+
59
+ extensions: []
60
+
61
+ extra_rdoc_files:
62
+ - History.txt
63
+ - LICENSE.txt
64
+ - Manifest.txt
65
+ - README.txt
66
+ - examples/older/README.txt
67
+ - examples/tutorial/css/LICENSE.txt
31
68
  files:
32
69
  - History.txt
33
70
  - LICENSE.txt
@@ -76,6 +113,35 @@ files:
76
113
  - test/conversion-tests.rb
77
114
  - test/source-tests.rb
78
115
  - test/user-choices-slowtests.rb
116
+ has_rdoc: true
117
+ homepage: http://user-choices.rubyforge.org
118
+ licenses: []
119
+
120
+ post_install_message:
121
+ rdoc_options:
122
+ - --main
123
+ - README.txt
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: "0"
131
+ version:
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: "0"
137
+ version:
138
+ requirements: []
139
+
140
+ rubyforge_project: user-choices
141
+ rubygems_version: 1.3.5
142
+ signing_key:
143
+ specification_version: 3
144
+ summary: Unified interface to command-line, environment, and configuration files.
79
145
  test_files:
80
146
  - test/arglist-strategy-tests.rb
81
147
  - test/builder-tests.rb
@@ -83,56 +149,3 @@ test_files:
83
149
  - test/conversion-tests.rb
84
150
  - test/source-tests.rb
85
151
  - test/user-choices-slowtests.rb
86
- rdoc_options:
87
- - --main
88
- - README.txt
89
- extra_rdoc_files:
90
- - History.txt
91
- - LICENSE.txt
92
- - Manifest.txt
93
- - README.txt
94
- - examples/older/README.txt
95
- - examples/tutorial/css/LICENSE.txt
96
- executables: []
97
-
98
- extensions: []
99
-
100
- requirements: []
101
-
102
- dependencies:
103
- - !ruby/object:Gem::Dependency
104
- name: xml-simple
105
- version_requirement:
106
- version_requirements: !ruby/object:Gem::Version::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: 1.0.11
111
- version:
112
- - !ruby/object:Gem::Dependency
113
- name: s4t-utils
114
- version_requirement:
115
- version_requirements: !ruby/object:Gem::Version::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: 1.0.3
120
- version:
121
- - !ruby/object:Gem::Dependency
122
- name: builder
123
- version_requirement:
124
- version_requirements: !ruby/object:Gem::Version::Requirement
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 2.1.2
129
- version:
130
- - !ruby/object:Gem::Dependency
131
- name: hoe
132
- version_requirement:
133
- version_requirements: !ruby/object:Gem::Version::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: 1.3.0
138
- version: