Module: RuVim::FileWatcher

Defined in:
lib/ruvim/file_watcher.rb

Defined Under Namespace

Classes: InotifyWatcher, PollingWatcher

Class Method Summary collapse

Class Method Details

.create(path, &on_event) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ruvim/file_watcher.rb', line 5

def self.create(path, &on_event)
  if InotifyWatcher.available? && File.exist?(path)
    InotifyWatcher.new(path, &on_event)
  else
    PollingWatcher.new(path, &on_event)
  end
end