From 784ed154c3d1d9b6e7f0202dcf10d76d938849b0 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Sat, 2 Feb 2013 00:36:43 -0500 Subject: Refactor --rc option --- railties/lib/rails/commands/application.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb index 92c9f9deb9..7d84d3ae0e 100644 --- a/railties/lib/rails/commands/application.rb +++ b/railties/lib/rails/commands/application.rb @@ -11,12 +11,7 @@ else ARGV.shift unless ARGV.delete("--no-rc") customrc = ARGV.index('--rc') - railsrc = if customrc - ARGV.delete_at(customrc) - ARGV.delete_at(customrc) - else - File.join(File.expand_path("~"), '.railsrc') - end + railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc') 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