FIX: autospec not monitoring correctly
This commit is contained in:
parent
e53f110c83
commit
29f6d960c6
|
@ -159,14 +159,21 @@ class Autospec::Manager
|
|||
path = File.expand_path(File.dirname(__FILE__) + "../../..")
|
||||
|
||||
# to speed up boot we use a thread
|
||||
Thread.new do
|
||||
["spec", "lib", "app", "config", "test", "vendor", "plugins"].each do |watch|
|
||||
|
||||
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
|
||||
Thread.new do
|
||||
begin
|
||||
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
|
||||
rescue => e
|
||||
puts "FAILED to listen on changes to #{path}/#{watch}"
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue