Object
add a directory to be watched @param dir the directory to watch @param expression the glob pattern to search under the watched directory
# File lib/rerun/watcher.rb, line 36 def add_directory(dir, expression="**/*") if FileTest.exists?(dir) && FileTest.readable?(dir) then @directories << Directory.new(dir, expression) else raise InvalidDirectoryError, "Dir '#{dir}' either doesnt exist or isnt readable" end end
add a specific file to the watch list @param file the file to watch
# File lib/rerun/watcher.rb, line 50 def add_file(file) if FileTest.exists?(file) && FileTest.readable?(file) then @files << file else raise InvalidFileError, "File '#{file}' either doesnt exist or isnt readable" end end
wait for the filewatcher to finish
# File lib/rerun/watcher.rb, line 104 def join @thread.join() if @thread rescue Interrupt => e # don't care end
# File lib/rerun/watcher.rb, line 62 def prime @first_time = true @found = Hash.new() examine @first_time = false end
# File lib/rerun/watcher.rb, line 44 def remove_directory(dir) @directories.delete(dir) end
# File lib/rerun/watcher.rb, line 58 def remove_file(file) @files.delete(file) end
Generated with the Darkfish Rdoc Generator 2.