Module: Jekyll::Watcher

Defined in:
lib/starter_web/_plugins/symlink_watcher.rb

Instance Method Summary collapse

Instance Method Details



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/starter_web/_plugins/symlink_watcher.rb', line 32

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