Skip to content

Commit

Permalink
Catch new files.
Browse files Browse the repository at this point in the history
Any files that are 'new' when the watch loop updates the files list
will be automatically added to the 'changed' list.
  • Loading branch information
jbarnette committed Jan 28, 2009
1 parent 337a9a6 commit 4cacbac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/lather/watcher.rb
Expand Up @@ -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
Expand Down

0 comments on commit 4cacbac

Please sign in to comment.