提供手工打包zip的命令
This commit is contained in:
parent
1ff6372d61
commit
db707dd408
|
@ -0,0 +1,16 @@
|
||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
namespace :zip do
|
||||||
|
desc "手工打包作品"
|
||||||
|
task :pack => :environment do
|
||||||
|
homework = HomeworkCommon.find ENV["ID"]
|
||||||
|
file_count = 0
|
||||||
|
homework.student_works.map { |work| file_count += work.attachments.count}
|
||||||
|
if file_count > 0
|
||||||
|
zipfile = zip_homework_common homework
|
||||||
|
else
|
||||||
|
zipfile = {:message => "no file"}
|
||||||
|
end
|
||||||
|
puts "out: #{zipfile}"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue