aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-30 16:46:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-30 16:46:17 -0700
commitbda6d6c2279e4b158bb552d151dd74d170d572c7 (patch)
tree341b3b9e840c3052ad0d1a2d1f56024909b466c1 /railties/lib
parent19ca0952bbdcf744f12d2bedb267dff20618e149 (diff)
downloadrails-bda6d6c2279e4b158bb552d151dd74d170d572c7.tar.gz
rails-bda6d6c2279e4b158bb552d151dd74d170d572c7.tar.bz2
rails-bda6d6c2279e4b158bb552d151dd74d170d572c7.zip
functionally build the argv
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 718be02f30..f0cbac6a3a 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -350,15 +350,16 @@ module Rails
if argv.find { |arg| arg == '--no-rc' }
argv.reject { |arg| arg == '--no-rc' }
else
- insert_railsrc_into_argv!(argv, railsrc(argv))
+ railsrc(argv) { |argv, rc| insert_railsrc_into_argv!(argv, rc) }
end
end
def railsrc(argv)
if (customrc = argv.index{ |x| x.include?("--rc=") })
- File.expand_path(argv.delete_at(customrc).gsub(/--rc=/, ""))
+ fname = File.expand_path(argv[customrc].gsub(/--rc=/, ""))
+ yield(argv.take(customrc) + argv.drop(customrc + 1), fname)
else
- self.class.default_rc_file
+ yield argv, self.class.default_rc_file
end
end