From 9ff627cfaa85d66559eba81696b3c56960bceb83 Mon Sep 17 00:00:00 2001 From: Marian Schubert Date: Wed, 26 Jan 2011 12:15:43 +0000 Subject: [PATCH] Return unique filenames from Linux listener so that we don't get duplicate entries for same file. This solves problem with commonly used Linux editors (e.g. Vim, Emacs) that generate multiple inotify events on file save. http://schettino72.wordpress.com/2010/03/07/inotify-text-editors-emacs-vim/ --- lib/guard/listeners/linux.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/guard/listeners/linux.rb b/lib/guard/listeners/linux.rb index d4d13ad..6436d59 100644 --- a/lib/guard/listeners/linux.rb +++ b/lib/guard/listeners/linux.rb @@ -60,6 +60,7 @@ module Guard update_last_event unless files.empty? + files.uniq! files.map! { |file| file.gsub("#{Dir.pwd}/", '') } callback.call(files) files.clear