class Middleman::CoreExtensions::FileWatcher::API

def run_callbacks(path, callbacks_name)

Returns:
  • (void) -

Parameters:
  • callbacks_name (Symbol) -- The name of the callbacks method
  • path (Pathname) -- The file that was changed
def run_callbacks(path, callbacks_name)
  path = path.relative_path_from(@app.root_path).to_s if path.is_a? Pathname
  self.send(callbacks_name).each do |callback, matcher|
    next if path.match(%r{^#{@app.build_dir}/})
    next unless matcher.nil? || path.match(matcher)
    @app.instance_exec(path, &callback)
  end
end