rosa-build/db/seeds.rb

40 lines
1.2 KiB
Ruby
Raw Normal View History

2011-03-09 16:16:48 +00:00
require 'digest/md5'
TEST_USERS =
[
['yaroslav@markin.net' , 'Yaroslav Markin'] ,
['timothy.tsvetkov@gmail.com' , 'Timothy Tsvetkov'] ,
['alexey.nayden@gmail.com' , 'Alexey Nayden']
]
TEST_USERS.each do |tuser|
email = tuser[0]
next if User.find_by_email(email)
name = tuser[1]
pass = Digest::MD5.hexdigest(name)[0..6]
2011-03-29 23:16:04 +01:00
user = User.create! :name => name, :email => email, :password => pass, :password_confirmation => pass
2011-03-09 16:16:48 +00:00
puts "Created user #{name} (#{email}) and password #{pass}"
end
2011-03-10 13:45:19 +00:00
2011-03-12 14:15:30 +00:00
=begin
TEST_PLATFORMS = %w(cooker Mandriva2010-10 Mandriva2011.4)
2011-03-10 13:45:19 +00:00
TEST_PROJECTS = %w(gcc glibc mysql-dev ruby ruby1.9 mc mesa avrdude vim gvim openssh-server openssh nethack binutils build-essentials rpm rpmtools ffmpeg mkvtoolnix libogg mpg123 openbox openoffice.org)
TEST_PLATFORMS.each do |platform|
p = Platform.find_or_create_by_name(platform)
TEST_PROJECTS.each do |project|
pr = Project.find_or_initialize_by_platform_id_and_name(p.id, project)
pr.unixname = pr.name
2011-03-10 13:45:19 +00:00
puts "#{project} added to #{platform}" if pr.new_record?
pr.save!
end
end
2011-03-12 14:15:30 +00:00
=end
ARCHES = %w(i586 i686 x86_64 mips powerpc)
ARCHES.each do |arch|
Arch.find_or_create_by_name arch
end