rake task added

This commit is contained in:
Harry Bomrah 2013-04-09 01:05:54 +08:00
parent 96b6f7e3fd
commit 4eefca8531
3 changed files with 21 additions and 11 deletions

View File

@ -844,7 +844,6 @@ var orbitDesktop = function(dom){
x = parseInt(shape[0].substr(1,1));
y = parseInt(shape[1].substr(1,1));
}else{
console.log(row + " : " + col);
x = parseInt(shape[0].substr(1,1));
if(total_x % 2 == 0){
row = row + y;

View File

@ -8,10 +8,10 @@ defaults: &defaults
development:
<<: *defaults
database: test_site
database: test_site_harry
test:
<<: *defaults
database: test_site
database: test_site_harry
# set these environment variables on your prod server
production:

View File

@ -1,13 +1,24 @@
# encoding: utf-8
namespace :desktop do
task :destroy_build_desktop => :environment do
Desktop.all.destroy_all
u = User.all
u.each do |us|
x = us.initialize_desktop
x.save!
puts "Desktop created for " + us.email.to_s
namespace :tiles do
task :destroy_build_tiles => :environment do
Tile.destroy_all
secs = Section.all
dws = DesktopWidget.all
secs.each do |sec,x|
grp = sec.groups.first
t = Tile.new(data_category: "app", data_content: "wikibooks", position: 1, shape: "w1 h1", title: "WikiBooks")
grp.tiles+=[t]
t = Tile.new(data_category: "app", data_content: "envocab", position: 2, shape: "w1 h1", title: "English Vocabulary")
grp.tiles+=[t]
@i = 3
dws.each do |dw|
t = Tile.new(data_category: "widget", position: @i,desktop_widget_id: dw.id)
@i = @i + 1
grp.tiles+=[t]
end
grp.save!
end
puts "Section " + x + " done!"
end
end