waiting on file system event don't block process on linux now (guard can be stopped, spec run but don't pass)

This commit is contained in:
Yann Lugrin 2010-10-21 16:04:57 +08:00 committed by Thibaud Guillaume-Gentil
parent 2191bc1088
commit 8a63b94247

View File

@ -45,13 +45,16 @@ module Guard
def watch_change
while !@stop
inotify.process
unless files.empty?
files.map! { |file| file.gsub("#{Dir.pwd}/", '') }
callback.call(files)
files.clear
if IO.select([notifier.to_io], [], [], latency)
notifier.process
unless files.empty?
files.map! { |file| file.gsub("#{Dir.pwd}/", '') }
callback.call(files)
files.clear
end
sleep latency
end
sleep latency
end
end