instiki/lib/tasks/upgrade_instiki.rake
James Herdman 64d305f2a8 Don't make ANY assumptions about the environment. Use the model and
Rails to do as much work as possible.
2009-08-29 14:20:08 -04:00

16 lines
436 B
Ruby

task :upgrade_instiki => :environment do
Web.all.each do |web|
public_path = Rails.root.join("public", web.address)
if public_path.exist?
webs_path = Rails.root.join("webs", web.address)
if webs_path.exist?
puts "Warning! The directory #{webs_path} already exists. Skipping."
else
public_path.rename(webs_path)
puts "Moved #{public_path} to #{webs_path}"
end
end
end
end