Skip to content
Browse files

functionally build the argv

  • Loading branch information...
1 parent 19ca095 commit bda6d6c2279e4b158bb552d151dd74d170d572c7 @tenderlove tenderlove committed Oct 30, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 railties/lib/rails/generators/rails/app/app_generator.rb
View
7 railties/lib/rails/generators/rails/app/app_generator.rb
@@ -350,15 +350,16 @@ def handle_rails_rc!(argv)
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

0 comments on commit bda6d6c

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