bin/tork-herald in tork-18.2.0 vs bin/tork-herald in tork-18.2.1

- old
+ new

@@ -1,9 +1,9 @@ #!/usr/bin/env ruby =begin ======================================================================= -# TORK-HERALD 1 2012-03-27 18.2.0 +# TORK-HERALD 1 2012-07-05 18.2.1 ## NAME tork-herald - reports modified files @@ -31,13 +31,13 @@ $0 = File.basename(__FILE__) # for easier identification in ps(1) output require 'binman' BinMan.help -require 'guard' -require 'guard/listener' require 'json' +STDOUT.sync = true # flush puts() output immediately after writing -listener = Guard::Listener.select_and_init({}) -listener.on_change {|files| puts JSON.dump(files) } -STDOUT.sync = true # don't buffer puts() -listener.start +require 'listen' +Listen.to('.', :relative_paths => true) do |modified, added, removed| + files = modified + added + puts JSON.dump(files) unless files.empty? +end.start