Method: FileSystemWatcher#initialize

Defined in:
lib/filesystemwatcher/filesystemwatcher.rb

#initialize(dir = nil, expression = "**/*") ⇒ FileSystemWatcher

Returns a new instance of FileSystemWatcher.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 22

def initialize(dir=nil, expression="**/*")
  @sleepTime = 5
  @useMD5 = false
  @priority = 0
  @stopWhen = nil

  @directories = Array.new()
  @files = Array.new()

  @foundFiles = nil
  @firstLoad = true
  @watchThread = nil
  
  initializeState()

  if dir then
    addDirectory(dir, expression)
  end
end