Changeset 7837
- Timestamp:
- 10/11/07 15:15:32 (2 years ago)
- Files:
-
- trunk/railties/lib/rails_generator/commands.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/lib/rails_generator/commands.rb
r7666 r7837 94 94 # Ask the user interactively whether to force collision. 95 95 def force_file_collision?(destination, src, dst, file_options = {}, &block) 96 $stdout.print "overwrite #{destination}? [Ynaqd] "97 case $stdin.gets 98 when / d/i96 $stdout.print "overwrite #{destination}? (enter \"h\" for help) [Ynaqdh] " 97 case $stdin.gets.chomp 98 when /\Ad\z/i 99 99 Tempfile.open(File.basename(destination), File.dirname(dst)) do |temp| 100 100 temp.write render_file(src, file_options, &block) … … 104 104 puts "retrying" 105 105 raise 'retry diff' 106 when / a/i106 when /\Aa\z/i 107 107 $stdout.puts "forcing #{spec.name}" 108 108 options[:collision] = :force 109 when / q/i109 when /\Aq\z/i 110 110 $stdout.puts "aborting #{spec.name}" 111 111 raise SystemExit 112 when /n/i then :skip 113 else :force 112 when /\An\z/i then :skip 113 when /\Ay\z/i then :force 114 else 115 $stdout.puts <<-HELP 116 Y - yes, overwrite 117 n - no, do not overwrite 118 a - all, overwrite this and all others 119 q - quit, abort 120 d - diff, show the differences between the old and the new 121 h - help, show this help 122 HELP 123 raise 'retry' 114 124 end 115 125 rescue