public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Remove use of opts.on { |options[:name] } hash assignment. References 
#4440.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@4513 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Nicholas Seckar (author)
Thu Jun 29 13:35:26 -0700 2006
commit  c53ae000bf9574bfc4eceaed2f42f8b2418ddbc5
tree    c1c7a852606482ce46d061eaed7e688bd09b0b1f
parent  51f3283ef317f7a8e2e52a816703b2e1d61106c8
...
 
 
 
1
2
3
...
1
2
3
4
5
6
0
@@ -1,3 +1,6 @@
0
+* Remove use of opts.on { |options[:name] } style hash assignment. References #4440. [headius@headius.com]
0
+
0
+
0
 *1.1.3* (June 27th, 2006)
0
 
0
 * Updated to Active Record 1.14.3, Action Pack 1.12.2, ActionWebService 1.1.3, ActionMailer 1.2.2
...
4
5
6
7
8
 
 
9
10
11
...
4
5
6
 
 
7
8
9
10
11
0
@@ -4,8 +4,8 @@
0
 options = { :sandbox => false, :irb => irb }
0
 OptionParser.new do |opt|
0
   opt.banner = "Usage: console [environment] [options]"
0
- opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
0
- opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
0
+ opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v }
0
+ opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v }
0
   opt.parse!(ARGV)
0
 end
0
 
...
117
118
119
120
121
 
 
122
123
124
...
117
118
119
 
 
120
121
122
123
124
0
@@ -117,8 +117,8 @@
0
 
0
   opts.on(" Options:")
0
 
0
- opts.on("-a", "--action=name", "reload|graceful|kill (default: #{OPTIONS[:action]})", String) { |OPTIONS[:action]| }
0
- opts.on("-d", "--dispatcher=path", "default: #{OPTIONS[:dispatcher]}", String) { |OPTIONS[:dispatcher]| }
0
+ opts.on("-a", "--action=name", "reload|graceful|kill (default: #{OPTIONS[:action]})", String) { |v| OPTIONS[:action] = v }
0
+ opts.on("-d", "--dispatcher=path", "default: #{OPTIONS[:dispatcher]}", String) { |v| OPTIONS[:dispatcher] = v }
0
 
0
   opts.separator ""
0
 
...
65
66
67
68
69
70
71
72
 
 
 
 
 
73
74
75
...
65
66
67
 
 
 
 
 
68
69
70
71
72
73
74
75
0
@@ -65,11 +65,11 @@
0
 
0
   opts.on(" Options:")
0
 
0
- opts.on("-p", "--port=number", Integer, "Starting port number (default: #{OPTIONS[:port]})") { |OPTIONS[:port]| }
0
- opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |OPTIONS[:instances]| }
0
- opts.on("-r", "--repeat=seconds", Integer, "Repeat spawn attempts every n seconds (default: off)") { |OPTIONS[:repeat]| }
0
- opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |OPTIONS[:environment]| }
0
- opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |OPTIONS[:spawner]| }
0
+ opts.on("-p", "--port=number", Integer, "Starting port number (default: #{OPTIONS[:port]})") { |v| OPTIONS[:port] = v }
0
+ opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |v| OPTIONS[:instances] = v }
0
+ opts.on("-r", "--repeat=seconds", Integer, "Repeat spawn attempts every n seconds (default: off)") { |v| OPTIONS[:repeat] = v }
0
+ opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |v| OPTIONS[:environment] = v }
0
+ opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |v| OPTIONS[:spawner] = v }
0
   opts.on("-d", "--dispatcher=path", String, "default: #{OPTIONS[:dispatcher]}") { |dispatcher| OPTIONS[:dispatcher] = File.expand_path(dispatcher) }
0
 
0
   opts.separator ""
...
36
37
38
39
40
41
 
 
 
42
43
44
...
36
37
38
 
 
 
39
40
41
42
43
44
0
@@ -36,9 +36,9 @@
0
 
0
   opts.on(" Options:")
0
 
0
- opts.on("-c", "--command=path", String) { |OPTIONS[:command]| }
0
- opts.on("-i", "--interval=seconds", Float) { |OPTIONS[:interval]| }
0
- opts.on("-d", "--daemon") { |OPTIONS[:daemon]| }
0
+ opts.on("-c", "--command=path", String) { |v| OPTIONS[:command] = v }
0
+ opts.on("-i", "--interval=seconds", Float) { |v| OPTIONS[:interval] = v }
0
+ opts.on("-d", "--daemon") { |v| OPTIONS[:daemon] = v }
0
 
0
   opts.separator ""
0
 
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@
0
 
0
   opts.on("-e", "--environment=name", String,
0
           "Specifies the environment for the runner to operate under (test/development/production).",
0
- "Default: development") { |options[:environment]| }
0
+ "Default: development") { |v| options[:environment] = v }
0
 
0
   opts.separator ""
0
 
...
19
20
21
22
 
23
24
25
 
26
27
28
 
29
30
31
...
36
37
38
39
 
40
41
42
...
19
20
21
 
22
23
24
 
25
26
27
 
28
29
30
31
...
36
37
38
 
39
40
41
42
0
@@ -19,13 +19,13 @@
0
 
0
   opts.on("-p", "--port=port", Integer,
0
           "Runs Rails on the specified port.",
0
- "Default: 3000") { |OPTIONS[:port]| }
0
+ "Default: 3000") { |v| OPTIONS[:port] = v }
0
   opts.on("-b", "--binding=ip", String,
0
           "Binds Rails to the specified ip.",
0
- "Default: 0.0.0.0") { |OPTIONS[:ip]| }
0
+ "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v }
0
   opts.on("-e", "--environment=name", String,
0
           "Specifies the environment to run this server under (test/development/production).",
0
- "Default: development") { |OPTIONS[:environment]| }
0
+ "Default: development") { |v| OPTIONS[:environment] = v }
0
   opts.on("-m", "--mime-types=filename", String,
0
                   "Specifies an Apache style mime.types configuration file to be used for mime types",
0
                   "Default: none") { |mime_types_file| OPTIONS[:mime_types] = WEBrick::HTTPUtils::load_mime_types(mime_types_file) }
0
@@ -36,7 +36,7 @@
0
 
0
   opts.on("-c", "--charset=charset", String,
0
           "Set default charset for output.",
0
- "Default: UTF-8") { |OPTIONS[:charset]| }
0
+ "Default: UTF-8") { |v| OPTIONS[:charset] = v }
0
 
0
   opts.separator ""
0
 
...
96
97
98
99
 
100
101
102
103
 
104
105
106
107
 
108
109
110
...
96
97
98
 
99
100
101
102
 
103
104
105
106
 
107
108
109
110
0
@@ -96,15 +96,15 @@
0
       opt.separator 'Options:'
0
       opt.on("-r", "--ruby=path", String,
0
              "Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).",
0
- "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| }
0
+ "Default: #{DEFAULT_SHEBANG}") { |v| options[:shebang] = v }
0
 
0
       opt.on("-d", "--database=name", String,
0
             "Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).",
0
- "Default: mysql") { |options[:db]| }
0
+ "Default: mysql") { |v| options[:db] = v }
0
 
0
       opt.on("-f", "--freeze",
0
             "Freeze Rails in vendor/rails from the gems generating the skeleton",
0
- "Default: false") { |options[:freeze]| }
0
+ "Default: false") { |v| options[:freeze] = v }
0
     end
0
     
0
     def mysql_socket_location
...
29
30
31
32
 
33
34
...
29
30
31
 
32
33
34
0
@@ -29,7 +29,7 @@
0
       opt.separator ''
0
       opt.separator 'Options:'
0
       opt.on("--skip-migration",
0
- "Don't generate a migration file for this model") { |options[:skip_migration]| }
0
+ "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
0
     end
0
 end
...
121
122
123
124
 
125
126
127
128
129
 
 
 
130
131
132
...
121
122
123
 
124
125
126
 
 
 
127
128
129
130
131
132
0
@@ -121,12 +121,12 @@
0
           opt.separator ''
0
           opt.separator 'General Options:'
0
 
0
- opt.on('-p', '--pretend', 'Run but do not make any changes.') { |options[:pretend]| }
0
+ opt.on('-p', '--pretend', 'Run but do not make any changes.') { |v| options[:pretend] = v }
0
           opt.on('-f', '--force', 'Overwrite files that already exist.') { options[:collision] = :force }
0
           opt.on('-s', '--skip', 'Skip files that already exist.') { options[:collision] = :skip }
0
- opt.on('-q', '--quiet', 'Suppress normal output.') { |options[:quiet]| }
0
- opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |options[:backtrace]| }
0
- opt.on('-h', '--help', 'Show this help message.') { |options[:help]| }
0
+ opt.on('-q', '--quiet', 'Suppress normal output.') { |v| options[:quiet] = v }
0
+ opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |v| options[:backtrace] = v }
0
+ opt.on('-h', '--help', 'Show this help message.') { |v| options[:help] = v }
0
           opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') do
0
             options[:svn] = `svn status`.inject({}) do |opt, e|
0
               opt[e.chomp[7..-1]] = true

Comments

    No one has commented yet.