aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands/application.rb')
-rw-r--r--railties/lib/rails/commands/application.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb
index 1cf23a8b92..60d1aed73a 100644
--- a/railties/lib/rails/commands/application.rb
+++ b/railties/lib/rails/commands/application.rb
@@ -9,6 +9,14 @@ if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
+ railsrc = File.join(File.expand_path("~"), ".railsrc")
+ if File.exist?(railsrc)
+ extra_args_string = File.open(railsrc).read
+ extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
+ puts "Using #{extra_args.join(" ")} from #{railsrc}"
+ ARGV << extra_args
+ ARGV.flatten!
+ end
end
require 'rubygems' if ARGV.include?("--dev")