module Middleman::CoreExtensions::FileWatcher

Constants

IGNORE_LIST

Public Class Methods

included(app)
Alias for: registered
registered(app) click to toggle source

Once registered

# File lib/middleman-core/core_extensions/file_watcher.rb, line 29
def registered(app)
  app.send :include, InstanceMethods

  app.config.define_setting :file_watcher_ignore, IGNORE_LIST, 'Regexes for paths that should be ignored when they change.'

  # Before parsing config, load the data/ directory
  app.before_configuration do
    files.reload_path(config[:data_dir])
  end

  app.after_configuration do
    config[:file_watcher_ignore] << %r{^#{config[:build_dir]}(\/|$)}
  end

  # After config, load everything else
  app.ready do
    files.reload_path('.')
  end
end
Also aliased as: included