Ignore:
Timestamp:
Feb 22, 2010, 3:31:06 AM (15 years ago)
Author:
gdb
Message:
Watch specific files as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/locker-dev/locker/deploy/bin/rails

    r1469 r1484  
    133133   # You may want to also watch public or vendor, depending on your needs.
    134134   Thread.current[:watched_dirs] = ['app', 'config', 'db', 'lib']
     135
     136   # List of specific files to watch for changes.
     137   Thread.current[:watched_files] = ['public/dispatch.fcgi',
     138                                     'public/.htaccess']
    135139   # Sample filter: /(\.rb|\.erb)\$/.  Default filter: watch all files
    136140   Thread.current[:watched_extensions] = //
     
    176180   # Wait until the modify time changes, then reload.
    177181   while true
    178      reload if Thread.current[:watched_dirs].inject(false) {|z, dir| z || modified_dir(File.join(File.dirname(__FILE__), '..', dir))}
     182     dir_modified = Thread.current[:watched_dirs].inject(false) {|z, dir| z || modified_dir(File.join(File.dirname(__FILE__), '..', dir))}
     183     file_modified = Thread.current[:watched_files].inject(false) {|z, file| z || modified(File.join(File.dirname(__FILE__), '..', file))}
     184     reload if dir_modified || file_modified
    179185     Thread.current[:iterations] += 1
    180186     sleep 1
Note: See TracChangeset for help on using the changeset viewer.