This commit is contained in:
Thibaud Guillaume-Gentil 2011-09-03 22:37:50 +02:00
parent e1472cb0c4
commit f91622adc5

View File

@ -87,8 +87,6 @@ module Guard
last_event = @last_event last_event = @last_event
update_last_event update_last_event
files = potentially_modified_files(dirs, options).select { |path| file_modified?(path, last_event) } files = potentially_modified_files(dirs, options).select { |path| file_modified?(path, last_event) }
# p "modified_files"
# p files
relativize_paths(files) relativize_paths(files)
end end
@ -147,27 +145,15 @@ module Guard
# both values down to the second for the comparison. # both values down to the second for the comparison.
# ctime is used only on == comparaison to always catches Rails 3.1 Assets pipelined on Mac OSX # ctime is used only on == comparaison to always catches Rails 3.1 Assets pipelined on Mac OSX
def file_modified?(path, last_event) def file_modified?(path, last_event)
# p path
# p @last_event.to_i
# p last_event.to_i
# p File.ctime(path).to_i
# p File.mtime(path).to_i
if File.ctime(path).to_i == last_event.to_i if File.ctime(path).to_i == last_event.to_i
# p "File.ctime == last_event" file_content_modified?(path, sha1_checksum(path))
res = file_content_modified?(path, sha1_checksum(path))
# p res.to_s
res
elsif File.mtime(path).to_i > last_event.to_i elsif File.mtime(path).to_i > last_event.to_i
# p "File.ctime > last_event"
set_sha1_checksums_hash(path, sha1_checksum(path)) set_sha1_checksums_hash(path, sha1_checksum(path))
# p "true"
true true
else else
# p "false"
false false
end end
rescue rescue
# p "false"
false false
end end