Class: Lookbook::FileWatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/lookbook/file_watcher.rb

Class Method Summary collapse

Class Method Details

.evented?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/lookbook/file_watcher.rb', line 14

def evented?
  !(file_watcher <= ActiveSupport::FileUpdateChecker)
end

.newObject



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

def new(...)
  if evented?
    Lookbook.logger.debug "Using `EventedFileUpdateChecker` for file watching"
  else
    Lookbook.logger.debug "The 'listen' gem was not found. Using `FileUpdateChecker` for file watching"
  end

  file_watcher.new(...)
end