rosa-build/lib/tasks/import.rake

15 lines
453 B
Ruby
Raw Normal View History

2011-10-29 22:58:48 +01:00
namespace :import do
desc "Load projects"
task :projects => :environment do
open('http://dl.dropbox.com/u/984976/PackageList.txt').readlines.each do |name|
name.chomp!
print "Import #{name}..."
owner = User.find(2) # vsharshov@gmail.com
# owner = Group.find(1) # Core Team
puts Project.create(:name => name, :unixname => name) {|p| p.owner = owner} ? "Ok!" : "Fail!"
sleep 1
end
puts 'DONE'
end
end