Permalink
Browse files

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

  • Loading branch information...
1 parent 83eccde commit a1e1af9b2170c83d0f913f0cea2be0aec05a30fd @amparo-luna amparo-luna committed Feb 1, 2013
Showing with 12 additions and 6 deletions.
  1. +4 −0 railties/CHANGELOG.md
  2. +8 −6 railties/lib/rails/commands/application.rb
View
4 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
View
14 railties/lib/rails/commands/application.rb
@@ -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

0 comments on commit a1e1af9

Please sign in to comment.