7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/inkcite/uploader.rb', line 7
def self.upload email
times = []
['source.html', 'source.txt', 'helpers.tsv'].each do |file|
file = email.project_file(file)
times << File.mtime(file).to_i if File.exist?(file)
end
local_images = email.image_dir
if File.exist?(local_images)
Dir.foreach(local_images) do |file|
times << File.mtime(File.join(local_images, file)).to_i unless file.starts_with?('.')
end
end
last_update = times.max
last_upload = email.meta(:last_upload).to_i
self.do_upload(email, false) if last_update > last_upload
end
|