diff options
author | Amparo Luna <amparo.m.luna@gmail.com> | 2013-01-31 19:30:47 -0500 |
---|---|---|
committer | Amparo Luna <amparo.m.luna@gmail.com> | 2013-01-31 19:30:47 -0500 |
commit | a1e1af9b2170c83d0f913f0cea2be0aec05a30fd (patch) | |
tree | c3f256093d33daca1e89d094a9ffc5d04f7229b7 /railties/lib | |
parent | 83eccde1e2aeb925a670899d862572e960a76329 (diff) | |
download | rails-a1e1af9b2170c83d0f913f0cea2be0aec05a30fd.tar.gz rails-a1e1af9b2170c83d0f913f0cea2be0aec05a30fd.tar.bz2 rails-a1e1af9b2170c83d0f913f0cea2be0aec05a30fd.zip |
Add --no-rc option to skip the loading of railsrc file
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/commands/application.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb index 2d9708e5b5..b4c7356159 100644 --- a/railties/lib/rails/commands/application.rb +++ b/railties/lib/rails/commands/application.rb @@ -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 |