#!/usr/bin/env ruby =begin TORK-HERALD 1 2012-01-29 17.0.1 ============================================================================== NAME ------------------------------------------------------------------------------ tork-herald - reports modified files SYNOPSIS ------------------------------------------------------------------------------ `tork-herald` [*OPTION*]... DESCRIPTION ------------------------------------------------------------------------------ This program monitors the current working directory and prints relative paths of modified files in batches of single-line JSON arrays to the standard output stream. OPTIONS ------------------------------------------------------------------------------ `-h`, `--help` Display this help manual using man(1). SEE ALSO ------------------------------------------------------------------------------ tork(1), tork-driver(1), tork-master(1), tork-herald(1) =end ========================================================================= $0 = File.basename(__FILE__) # for easier identification in ps(1) output require 'binman' BinMan.help require 'guard' require 'guard/listener' require 'json' listener = Guard::Listener.select_and_init({}) listener.on_change {|files| puts JSON.dump(files) } STDOUT.sync = true # don't buffer puts() listener.start