aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-04 13:09:13 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-04 13:09:13 -0800
commit5720de7a39983db3ec63dce85049f5435927a86f (patch)
tree4fa53fb1844ed96635a95fd0fc2b48f971286d61
parent65113fd2c8d5bcee2fab60d28ccdb912ceaa4367 (diff)
parent51030364ec2b5f74381725aa49f73af34d690f8c (diff)
downloadrails-5720de7a39983db3ec63dce85049f5435927a86f.tar.gz
rails-5720de7a39983db3ec63dce85049f5435927a86f.tar.bz2
rails-5720de7a39983db3ec63dce85049f5435927a86f.zip
Merge pull request #9174 from robertomiranda/railsrc-cli-option
Use --rc=PATH instead of --rc PATH
-rw-r--r--railties/lib/rails/commands/application.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb
index 7d84d3ae0e..2ff29418c6 100644
--- a/railties/lib/rails/commands/application.rb
+++ b/railties/lib/rails/commands/application.rb
@@ -10,8 +10,12 @@ if ARGV.first != "new"
else
ARGV.shift
unless ARGV.delete("--no-rc")
- customrc = ARGV.index('--rc')
- railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc')
+ customrc = ARGV.index{ |x| x.include?("--rc=") }
+ railsrc = if customrc
+ File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
+ 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