lib/rb-fsevent/fsevent.rb in rb-fsevent-0.4.1 vs lib/rb-fsevent/fsevent.rb in rb-fsevent-0.4.2
- old
+ new
@@ -26,11 +26,12 @@
@options = []
end
end
def run
- while !pipe.eof?
+ @running = true
+ while @running && !pipe.eof?
if line = pipe.readline
modified_dir_paths = line.split(":").select { |dir| dir != "\n" }
callback.call(modified_dir_paths)
end
end
@@ -44,10 +45,10 @@
Process.kill("KILL", pipe.pid)
pipe.close
end
rescue IOError
ensure
- @pipe = false
+ @pipe = @running = nil
end
if RUBY_VERSION < '1.9'
def pipe
@pipe ||= IO.popen("#{self.class.watcher_path} #{options_string} #{shellescaped_paths}")