Upgrade the Listen gem

This commit is contained in:
Sam
2017-04-13 10:26:07 -04:00
parent ef093b1610
commit 22214f5e5c
4 changed files with 13 additions and 5 deletions

View File

@@ -179,12 +179,14 @@ class Autospec::Manager
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
Thread.new do
begin
Listen.to("#{path}/#{watch}", options) do |modified, added, _|
listener = Listen.to("#{path}/#{watch}", options) do |modified, added, _|
paths = [modified, added].flatten
paths.compact!
paths.map!{|long| long[(path.length+1)..-1]}
process_change(paths)
end
listener.start
sleep
rescue => e
puts "FAILED to listen on changes to #{path}/#{watch}"
puts e