Polling#watch_change should use listener directory, not Dir.pwd

This commit is contained in:
Rob Eanes 2011-08-12 10:03:06 -05:00
parent 63ca5f0b70
commit e846068e89

View File

@ -22,7 +22,7 @@ module Guard
def watch_change
until @stop
start = Time.now.to_f
files = modified_files([Dir.pwd], :all => true)
files = modified_files([@directory], :all => true)
@callback.call(files) unless files.empty?
nap_time = @latency - (Time.now.to_f - start)
sleep(nap_time) if nap_time > 0