Put mtime (maybe ctime is updated on linux when moving a file)

This commit is contained in:
Thibaud Guillaume-Gentil 2011-09-03 14:43:25 +02:00
parent 68efb0d52f
commit 5978e875df
2 changed files with 3 additions and 2 deletions

View File

@ -84,7 +84,7 @@ module Guard
end
def modified_files(dirs, options = {})
last_event = @last_event.dup
last_event = @last_event
update_last_event
files = potentially_modified_files(dirs, options).select { |path| file_modified?(path, last_event) }
p "modified_files"
@ -150,6 +150,7 @@ module Guard
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
p "File.ctime == last_event"
res = file_content_modified?(path, sha1_checksum(path))

View File

@ -4,6 +4,6 @@ require 'guard/listeners/polling'
describe Guard::Polling do
subject { Guard::Polling }
it_should_behave_like "a listener that reacts to #on_change", 2
it_should_behave_like "a listener that reacts to #on_change"
it_should_behave_like "a listener scoped to a specific directory"
end