Permalink
Browse files

avoid object creation if there is no rc file

  • Loading branch information...
1 parent f7ae6e1 commit b0645ea04c7f75769b106d96a4fbb4e8cc2a258c @tenderlove tenderlove committed Oct 30, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/generators/rails/app/app_generator.rb
@@ -363,14 +363,14 @@ def railsrc(argv)
end
def read_rc_file(railsrc)
- return [] unless File.exists?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
extra_args
end
def insert_railsrc_into_argv!(argv, railsrc)
+ return argv unless File.exists?(railsrc)
extra_args = read_rc_file railsrc
argv.take(1) + extra_args + argv.drop(1)
end

0 comments on commit b0645ea

Please sign in to comment.