mirror of
https://github.com/github/rails.git
synced 2026-01-30 08:48:06 -05:00
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
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -30,13 +30,13 @@ ARGV.options do |opts|
|
||||
"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 @@ ARGV.options do |opts|
|
||||
"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 @@ ARGV.options do |opts|
|
||||
"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 ""
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ require 'optparse'
|
||||
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
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
|
||||
@@ -121,9 +121,9 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
|
||||
@@ -91,12 +91,12 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
@@ -36,9 +36,9 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ ARGV.options do |opts|
|
||||
|
||||
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 @@ ARGV.options do |opts|
|
||||
|
||||
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 ""
|
||||
|
||||
|
||||
@@ -97,15 +97,15 @@ class AppGenerator < Rails::Generator::Base
|
||||
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
|
||||
|
||||
@@ -29,6 +29,6 @@ class ModelGenerator < Rails::Generator::NamedBase
|
||||
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
|
||||
|
||||
@@ -120,16 +120,16 @@ module Rails
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user