Permalink
Browse files

Catch new files.

Any files that are 'new' when the watch loop updates the files list
will be automatically added to the 'changed' list.
  • Loading branch information...
1 parent 337a9a6 commit 4cacbac1deff5740d2cd5d02fb89b94d47eee478 @jbarnette committed Jan 28, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/lather/watcher.rb
@@ -28,8 +28,9 @@ def go!
private
def update_files
- @files = find_files
- changed = []
+ refreshed = find_files
+ changed = refreshed.keys - @files.keys # seed new files
+ @files = refreshed
@files.each do |file, mtime|
changed << file if mtime > @timestamp

0 comments on commit 4cacbac

Please sign in to comment.