Permalink
Browse files

Add --rc option to support the load of a custom rc file

  • Loading branch information...
1 parent 9d2187e commit 5f1dc8e3b74d4f4deb0617be6190a32256f4fe18 @amparo-luna amparo-luna 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
@@ -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*
@@ -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 5f1dc8e

Please sign in to comment.