aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands
diff options
context:
space:
mode:
authorAmparo Luna <amparo.m.luna@gmail.com>2013-02-01 14:59:29 -0500
committerAmparo Luna <amparo.m.luna@gmail.com>2013-02-01 23:17:41 -0500
commit5f1dc8e3b74d4f4deb0617be6190a32256f4fe18 (patch)
tree57e0f6b5ecf0dd57d51fb982ab5a198d951b2932 /railties/lib/rails/commands
parent9d2187efb7da3c531997eb0261bc39cf48a69821 (diff)
downloadrails-5f1dc8e3b74d4f4deb0617be6190a32256f4fe18.tar.gz
rails-5f1dc8e3b74d4f4deb0617be6190a32256f4fe18.tar.bz2
rails-5f1dc8e3b74d4f4deb0617be6190a32256f4fe18.zip
Add --rc option to support the load of a custom rc file
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r--railties/lib/rails/commands/application.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb
index 8c1b20571c..92c9f9deb9 100644
--- a/railties/lib/rails/commands/application.rb
+++ b/railties/lib/rails/commands/application.rb
@@ -10,7 +10,13 @@ if ARGV.first != "new"
else
ARGV.shift
unless ARGV.delete("--no-rc")
- railsrc = File.join(File.expand_path("~"), ".railsrc")
+ customrc = ARGV.index('--rc')
+ railsrc = if customrc
+ ARGV.delete_at(customrc)
+ ARGV.delete_at(customrc)
+ 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