From 51030364ec2b5f74381725aa49f73af34d690f8c Mon Sep 17 00:00:00 2001 From: robertomiranda Date: Mon, 4 Feb 2013 12:57:12 -0500 Subject: Use --rc= instead of --rc --- railties/lib/rails/commands/application.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb index 7d84d3ae0e..2ff29418c6 100644 --- a/railties/lib/rails/commands/application.rb +++ b/railties/lib/rails/commands/application.rb @@ -10,8 +10,12 @@ if ARGV.first != "new" else ARGV.shift unless ARGV.delete("--no-rc") - customrc = ARGV.index('--rc') - railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc') + customrc = ARGV.index{ |x| x.include?("--rc=") } + railsrc = if customrc + File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, "")) + else + File.join(File.expand_path("~"), '.railsrc') + end if File.exist?(railsrc) extra_args_string = File.read(railsrc) extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten -- cgit v1.2.3