class Middleman::CoreExtensions::FileWatcher
def initialize(app, config={}, &block)
def initialize(app, config={}, &block) super # Setup source collection. @sources = ::Middleman::Sources.new(app, disable_watcher: app.config[:watcher_disable], force_polling: app.config[:force_polling], latency: app.config[:watcher_latency]) # Add default ignores. IGNORES.each do |key, value| @sources.ignore key, :all, value end # Watch current source. start_watching(app.config[:source]) # Expose API to app and config. app.add_to_instance(:files, &method(:sources)) app.add_to_config_context(:files, &method(:sources)) end