desc"Backs up your likely modified files so you can run the Rails 3 generator on your app with little risk"
task:backupdo
files=[".gitignore",
"app/controllers/application_controller.rb",
"app/helpers/application_helper.rb",
"config/routes.rb",
"config/environment.rb",
"config/environments/*",
"config/database.yml",
"doc/README_FOR_APP",
"test/test_helper.rb"]
puts
files.eachdo|f|
ifFile.exist?(f)
puts"#{CYAN}* #{CLEAR}backing up #{WHITE}#{f}#{CLEAR} to #{WHITE}#{f}.rails2#{CLEAR}"
FileUtils.cp(f,"#{f}.rails2")
end
end
puts
puts"This is a list of the files analyzed and backed up (if they existed);\nyou will probably not want the generator to replace them since\nyou probably modified them (but now they're safe if you accidentally do!)."