aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-02-02 00:36:43 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-02-02 00:36:43 -0500
commit784ed154c3d1d9b6e7f0202dcf10d76d938849b0 (patch)
tree60c11d99f176cc4eb4a33bc26ac955022da522d5
parent9cb386d9d6af513ca09b55df7765e3d38488e2ff (diff)
downloadrails-784ed154c3d1d9b6e7f0202dcf10d76d938849b0.tar.gz
rails-784ed154c3d1d9b6e7f0202dcf10d76d938849b0.tar.bz2
rails-784ed154c3d1d9b6e7f0202dcf10d76d938849b0.zip
Refactor --rc option
-rw-r--r--railties/lib/rails/commands/application.rb7
1 files changed, 1 insertions, 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