Skip to content
Browse files

Merge pull request #9147 from amparo-luna/custom_rc

Add --rc option to support the load of a custom rc file
  • Loading branch information...
2 parents 3e1f231 + 5f1dc8e commit 9cb386d9d6af513ca09b55df7765e3d38488e2ff @guilleiguaran guilleiguaran committed Feb 1, 2013
Showing with 11 additions and 1 deletion.
  1. +4 −0 railties/CHANGELOG.md
  2. +7 −1 railties/lib/rails/commands/application.rb
View
4 railties/CHANGELOG.md
@@ -1,5 +1,9 @@
## Rails 4.0.0 (unreleased) ##
+* Add --rc option to support the load of a custom rc file during the generation of a new app.
+
+ *Amparo Luna*
+
* Add --no-rc option to skip the loading of railsrc file during the generation of a new app.
*Amparo Luna*
View
8 railties/lib/rails/commands/application.rb
@@ -10,7 +10,13 @@
else
ARGV.shift
unless ARGV.delete("--no-rc")
- railsrc = File.join(File.expand_path("~"), ".railsrc")
+ customrc = ARGV.index('--rc')
+ railsrc = if customrc
+ ARGV.delete_at(customrc)
+ ARGV.delete_at(customrc)
+ else
+ File.join(File.expand_path("~"), '.railsrc')
+ end
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten

0 comments on commit 9cb386d

Please sign in to comment.
Something went wrong with that request. Please try again.