Ruby Directory_watcher

Useful directory wather to automatically compile or generate object files.

Install Ruby Gem

gem install directory_watcher

Doc Online

Source Online

Pandoc Build Daemon Script

require 'directory_watcher'

dw = DirectoryWatcher.new '.', :pre_load => true
dw.glob = '*.md'
dw.add_observer {|*args| args.each {|event| puts event}}

dw.start
gets      # when the user hits "enter" the script will terminate
dw.stop