Index: trunk/locker/deploy/bin/rails
===================================================================
--- trunk/locker/deploy/bin/rails	(revision 1487)
+++ trunk/locker/deploy/bin/rails	(revision 1488)
@@ -130,6 +130,11 @@
 
 t2 = Thread.new do
-   # List of directories to watch for changes before reload
-   Thread.current[:watched_dirs] = ['app', 'config', 'db', 'lib', 'public']
+   # List of directories to watch for changes before reload.
+   # You may want to also watch public or vendor, depending on your needs.
+   Thread.current[:watched_dirs] = ['app', 'config', 'db', 'lib']
+
+   # List of specific files to watch for changes.
+   Thread.current[:watched_files] = ['public/dispatch.fcgi',
+				     'public/.htaccess']
    # Sample filter: /(\.rb|\.erb)\$/.  Default filter: watch all files
    Thread.current[:watched_extensions] = //
@@ -169,5 +174,8 @@
      Thread.current[:modifications] = {}
      Thread.current[:iterations] = 0
-     RailsFCGIHandler.reload!
+     # This is a kludge, but at the same time it works.
+     # Will kill the current FCGI process so that it is reloaded
+     # at next request.
+     raise RuntimeError
    end
 
@@ -175,5 +183,7 @@
    # Wait until the modify time changes, then reload.
    while true
-     reload if Thread.current[:watched_dirs].inject(false) {|z, dir| z || modified_dir(File.join(File.dirname(__FILE__), '..', dir))}
+     dir_modified = Thread.current[:watched_dirs].inject(false) {|z, dir| z || modified_dir(File.join(File.dirname(__FILE__), '..', dir))}
+     file_modified = Thread.current[:watched_files].inject(false) {|z, file| z || modified(File.join(File.dirname(__FILE__), '..', file))}
+     reload if dir_modified || file_modified
      Thread.current[:iterations] += 1
      sleep 1
