Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove opts.on { |options[:option_name] } style hash assignment. Closes

#4440.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4502 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 81a6a60dc6dff2ad8c2a45bf17fc40e760224e30 1 parent c02d1f7
@seckar seckar authored
View
2  railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Remove opts.on { |options[:option_name] } style hash assignment. Closes #4440. [nicksieger@gmail.com]
+
* Mongrel support for script/server. #5475 [jeremydurham@gmail.com]
* Fix script/plugin so it doesn't barf on invalid URLs [Rick]
View
10 railties/lib/breakpoint_client.rb
@@ -30,13 +30,13 @@
"connections from the server.",
"Default: Find a good URI automatically.",
"Example: -c druby://localhost:12345"
- ) { |Options[:ClientURI]| }
+ ) { |v| Options[:ClientURI] = v }
opts.on("-s", "--server-uri=uri",
"Connect to the server specified at the",
"specified uri.",
"Default: druby://localhost:42531"
- ) { |Options[:ServerURI]| }
+ ) { |v| Options[:ServerURI] = v }
opts.on("-R", "--retry-delay=delay", Integer,
"Automatically try to reconnect to the",
@@ -45,14 +45,14 @@
"A value of 0 disables automatical",
"reconnecting completely.",
"Default: 10"
- ) { |Options[:RetryDelay]| }
+ ) { |v| Options[:RetryDelay] = v }
opts.on("-P", "--[no-]permanent",
"Run the breakpoint client in permanent mode.",
"This means that the client will keep continue",
"running even after the server has closed the",
"connection. Useful for example in Rails."
- ) { |Options[:Permanent]| }
+ ) { |v| Options[:Permanent] = v }
opts.on("-V", "--[no-]verbose",
"Run the breakpoint client in verbose mode.",
@@ -60,7 +60,7 @@
"individual breakpoints. This might help in seeing",
"that the breakpoint client is still alive, but adds",
"quite a bit of clutter."
- ) { |Options[:Verbose]| }
+ ) { |v| Options[:Verbose] = v }
opts.separator ""
View
4 railties/lib/commands/console.rb
@@ -4,8 +4,8 @@
options = { :sandbox => false, :irb => irb }
OptionParser.new do |opt|
opt.banner = "Usage: console [environment] [options]"
- opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
- opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
+ opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v }
+ opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v }
opt.parse!(ARGV)
end
View
6 railties/lib/commands/process/inspector.rb
@@ -54,9 +54,9 @@ def pid_files
opts.on(" Options:")
- opts.on("-s", "--ps=command", "default: #{OPTIONS[:ps]}", String) { |OPTIONS[:ps]| }
- opts.on("-p", "--pidpath=path", "default: #{OPTIONS[:pid_path]}", String) { |OPTIONS[:pid_path]| }
- opts.on("-r", "--pattern=pattern", "default: #{OPTIONS[:pattern]}", String) { |OPTIONS[:pattern]| }
+ opts.on("-s", "--ps=command", "default: #{OPTIONS[:ps]}", String) { |v| OPTIONS[:ps] = v }
+ opts.on("-p", "--pidpath=path", "default: #{OPTIONS[:pid_path]}", String) { |v| OPTIONS[:pid_path] = v }
+ opts.on("-r", "--pattern=pattern", "default: #{OPTIONS[:pattern]}", String) { |v| OPTIONS[:pattern] = v }
opts.separator ""
View
6 railties/lib/commands/process/reaper.rb
@@ -121,9 +121,9 @@ def pid_files
opts.on(" Options:")
- opts.on("-a", "--action=name", "reload|graceful|kill (default: #{OPTIONS[:action]})", String) { |OPTIONS[:action]| }
- opts.on("-p", "--pidpath=path", "default: #{OPTIONS[:pid_path]}", String) { |OPTIONS[:pid_path]| }
- opts.on("-r", "--pattern=pattern", "default: #{OPTIONS[:pattern]}", String) { |OPTIONS[:pattern]| }
+ opts.on("-a", "--action=name", "reload|graceful|kill (default: #{OPTIONS[:action]})", String) { |v| OPTIONS[:action] = v }
+ opts.on("-p", "--pidpath=path", "default: #{OPTIONS[:pid_path]}", String) { |v| OPTIONS[:pid_path] = v }
+ opts.on("-r", "--pattern=pattern", "default: #{OPTIONS[:pattern]}", String) { |v| OPTIONS[:pattern] = v }
opts.separator ""
View
12 railties/lib/commands/process/spawner.rb
@@ -91,12 +91,12 @@ def self.spawn(port)
opts.on(" Options:")
- opts.on("-p", "--port=number", Integer, "Starting port number (default: #{OPTIONS[:port]})") { |OPTIONS[:port]| }
- opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |OPTIONS[:instances]| }
- opts.on("-r", "--repeat=seconds", Integer, "Repeat spawn attempts every n seconds (default: off)") { |OPTIONS[:repeat]| }
- opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |OPTIONS[:environment]| }
- opts.on("-n", "--process=name", String, "default: #{OPTIONS[:process]}") { |OPTIONS[:process]| }
- opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |OPTIONS[:spawner]| }
+ opts.on("-p", "--port=number", Integer, "Starting port number (default: #{OPTIONS[:port]})") { |v| OPTIONS[:port] = v }
+ opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |v| OPTIONS[:instances] = v }
+ opts.on("-r", "--repeat=seconds", Integer, "Repeat spawn attempts every n seconds (default: off)") { |v| OPTIONS[:repeat] = v }
+ opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |v| OPTIONS[:environment] = v }
+ opts.on("-n", "--process=name", String, "default: #{OPTIONS[:process]}") { |v| OPTIONS[:process] = v }
+ opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |v| OPTIONS[:spawner] = v }
opts.on("-d", "--dispatcher=path", String, "default: #{OPTIONS[:dispatcher]}") { |dispatcher| OPTIONS[:dispatcher] = File.expand_path(dispatcher) }
opts.separator ""
View
6 railties/lib/commands/process/spinner.rb
@@ -36,9 +36,9 @@ def daemonize #:nodoc:
opts.on(" Options:")
- opts.on("-c", "--command=path", String) { |OPTIONS[:command]| }
- opts.on("-i", "--interval=seconds", Float) { |OPTIONS[:interval]| }
- opts.on("-d", "--daemon") { |OPTIONS[:daemon]| }
+ opts.on("-c", "--command=path", String) { |v| OPTIONS[:command] = v }
+ opts.on("-i", "--interval=seconds", Float) { |v| OPTIONS[:interval] = v }
+ opts.on("-d", "--daemon") { |v| OPTIONS[:daemon] = v }
opts.separator ""
View
2  railties/lib/commands/runner.rb
@@ -10,7 +10,7 @@
opts.on("-e", "--environment=name", String,
"Specifies the environment for the runner to operate under (test/development/production).",
- "Default: development") { |options[:environment]| }
+ "Default: development") { |v| options[:environment] = v }
opts.separator ""
View
8 railties/lib/commands/servers/webrick.rb
@@ -19,13 +19,13 @@
opts.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.",
- "Default: 3000") { |OPTIONS[:port]| }
+ "Default: 3000") { |v| OPTIONS[:port] = v }
opts.on("-b", "--binding=ip", String,
"Binds Rails to the specified ip.",
- "Default: 0.0.0.0") { |OPTIONS[:ip]| }
+ "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v }
opts.on("-e", "--environment=name", String,
"Specifies the environment to run this server under (test/development/production).",
- "Default: development") { |OPTIONS[:environment]| }
+ "Default: development") { |v| OPTIONS[:environment] = v }
opts.on("-m", "--mime-types=filename", String,
"Specifies an Apache style mime.types configuration file to be used for mime types",
"Default: none") { |mime_types_file| OPTIONS[:mime_types] = WEBrick::HTTPUtils::load_mime_types(mime_types_file) }
@@ -36,7 +36,7 @@
opts.on("-c", "--charset=charset", String,
"Set default charset for output.",
- "Default: UTF-8") { |OPTIONS[:charset]| }
+ "Default: UTF-8") { |v| OPTIONS[:charset] = v }
opts.separator ""
View
6 railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -97,15 +97,15 @@ def add_options!(opt)
opt.separator 'Options:'
opt.on("-r", "--ruby=path", String,
"Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).",
- "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| }
+ "Default: #{DEFAULT_SHEBANG}") { |v| options[:shebang] = v }
opt.on("-d", "--database=name", String,
"Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).",
- "Default: mysql") { |options[:db]| }
+ "Default: mysql") { |v| options[:db] = v }
opt.on("-f", "--freeze",
"Freeze Rails in vendor/rails from the gems generating the skeleton",
- "Default: false") { |options[:freeze]| }
+ "Default: false") { |v| options[:freeze] = v }
end
def mysql_socket_location
View
2  railties/lib/rails_generator/generators/components/model/model_generator.rb
@@ -29,6 +29,6 @@ def add_options!(opt)
opt.separator ''
opt.separator 'Options:'
opt.on("--skip-migration",
- "Don't generate a migration file for this model") { |options[:skip_migration]| }
+ "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
end
end
View
8 railties/lib/rails_generator/options.rb
@@ -120,16 +120,16 @@ def add_general_options!(opt)
opt.separator ''
opt.separator 'Rails Info:'
opt.on('-v', '--version', 'Show the Rails version number and quit.')
- opt.on('-h', '--help', 'Show this help message and quit.') { |options[:help]| }
+ opt.on('-h', '--help', 'Show this help message and quit.') { |v| options[:help] = v }
opt.separator ''
opt.separator 'General Options:'
- opt.on('-p', '--pretend', 'Run but do not make any changes.') { |options[:pretend]| }
+ opt.on('-p', '--pretend', 'Run but do not make any changes.') { |v| options[:pretend] = v }
opt.on('-f', '--force', 'Overwrite files that already exist.') { options[:collision] = :force }
opt.on('-s', '--skip', 'Skip files that already exist.') { options[:collision] = :skip }
- opt.on('-q', '--quiet', 'Suppress normal output.') { |options[:quiet]| }
- opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |options[:backtrace]| }
+ opt.on('-q', '--quiet', 'Suppress normal output.') { |v| options[:quiet] = v }
+ opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |v| options[:backtrace] = v }
opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') do
options[:svn] = `svn status`.inject({}) do |opt, e|
opt[e.chomp[7..-1]] = true
Please sign in to comment.
Something went wrong with that request. Please try again.