Skip to content

Commit

Permalink
Add --no-rc option to skip the loading of railsrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
amparo-luna committed Feb 1, 2013
1 parent 83eccde commit a1e1af9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions railties/CHANGELOG.md
@@ -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

Expand Down
14 changes: 8 additions & 6 deletions railties/lib/rails/commands/application.rb
Expand Up @@ -9,12 +9,14 @@
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

Expand Down

0 comments on commit a1e1af9

Please sign in to comment.