Class RGen::Util::FileChangeDetector
In: lib/rgen/util/file_change_detector.rb
Parent: Object

The FileChangeDetector detects changes in a set of files. Changes are detected between successive calls to check_files with a give set of files. Changes include files being added, removed or having changed their content.

Methods

check_files   new  

Constants

FileInfo = Struct.new(:timestamp, :digest)

Public Class methods

Create a FileChangeDetector, options include:

 :file_added
   a proc which is called when a file is added, receives the filename

 :file_removed
   a proc which is called when a file is removed, receives the filename

 :file_changed
   a proc which is called when a file is changed, receives the filename

Public Instance methods

Checks if any of the files has changed compared to the last call of check_files. When called for the first time on a new object, all files will be reported as being added.

[Validate]