Module: Jekyll::Watcher

Defined in:
symlink_watcher.rb

Instance Method Summary collapse

Instance Method Details



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'symlink_watcher.rb', line 24

def build_listener_with_symlinks(site, options)
  src = options["source"]
  dirs = [src]
  Find.find(src).each do |f|
    next if f == "#{src}/_drafts" and not options["show_drafts"]    # TODO(willnorris): filter ignored files

    dirs << f if File.directory?(f) and File.symlink?(f)
  end

  require "listen"
  Listen.to(
    *dirs,
    :ignore => listen_ignore_paths(options),
    :force_polling => options['force_polling'],
    &(listen_handler(site))
  )
end