Module: FSWatcher

Defined in:
lib/filesystemwatcher/filesystemwatcher.rb

Overview

Util classes for the FileSystemWatcher

Defined Under Namespace

Classes: Directory, FoundFile, InvalidDirectoryError, InvalidFileError

Class Method Summary collapse

Class Method Details

.genFileMD5(fileName) ⇒ Object

utility function for generating md5s from a files contents



288
289
290
291
292
293
294
295
296
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 288

def FSWatcher.genFileMD5(fileName)
  if FileTest.file?(fileName) then      
    f = File.open(fileName)
    contents = f.read()
    f.close()
    return MD5.new(contents) if contents
  end
  return nil
end