1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add --no-rc option to skip the loading of railsrc file

This commit is contained in:
Amparo Luna 2013-01-31 19:30:47 -05:00
parent 83eccde1e2
commit a1e1af9b21
2 changed files with 12 additions and 6 deletions

View file

@ -1,5 +1,9 @@
## Rails 4.0.0 (unreleased) ##
* Add --no-rc option to skip the loading of railsrc file during the generation of a new app.
*Amparo Luna*
* Fixes database.yml when creating a new rails application with '.'
Fix #8304

View file

@ -9,12 +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.insert(1, *extra_args)
unless ARGV.delete("--no-rc")
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.insert(1, *extra_args)
end
end
end