mockko / livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
http://livereload.com/
1.18k stars 56 forks source link

Exclusions don't affect file monitoring (and also have to start with a '/') #12

Closed sjl closed 14 years ago

sjl commented 14 years ago

I put some exclusions in the .livereload file. livereload notices them but doesn't actually do anything with them.

Version:  1.3  (compatible with browser extension versions 1.3.x)
Port:     10083
Watching: /Users/sjl/src/project
  - extensions: .html .css .js .png .gif .jpg .php .php5 .py .rb .erb
  - excluding changes in: .png .gif .jpg */media/uploads/* */media/admin/* */media/ckeditor/* */media/filebrowser/* */media/pages/* */.git/* */.svn/* */.hg/*
/Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1266:in `watch_filename': Too many open files - failed to open file /Users/sjl/src/project/media/uploads/case-studies/foo/bar/baz.jpg for registering with kqueue: Too many open files (Errno::EMFILE)

Notice how the file (/Users/sjl/src/project/media/uploads/case-studies/foo/bar/baz.jpg) matches both an excluded extension and an excluded directory, but is still included.

mrrooijen commented 14 years ago

+1

I am experiencing the same issue. It's telling me it has too many files to watch (like the error above by sjl). So i decided to try and ignore the whole "upload" directory in the public folder with the following:

config.exclusions << '/public/system/*'

When I run livereload I see this:

  - excluding changes in: public/system/* */.git/* */.svn/* */.hg/*

But still get the following error:

/Users/Michael/.rvm/gems/ree-1.8.7-2010.02@r3/gems/eventmachine-0.12.10/lib/eventmachine.rb:1266:in `watch_filename': Too many open files - failed to open file /Users/Michael/Desktop/myapp/public/system/pictures/original/4c3cd4a08aa92a6094000011.jpg for registering with kqueue: Too many open files (Errno::EMFILE)
andreyvit commented 14 years ago

Sorry guys, DirectoryWatcher library does not support exclusions — they are used to filter out changes after those are reported by DirectoryWatcher to LiveReload. So no effect on the number of watched files.

fssm version is already in the works, wait a liiiiiitle bit more, please.

mrrooijen commented 14 years ago

Sounds good! : )

andreyvit commented 14 years ago

All of this should be fixed in LiveReload 1.4 (i.e., excluded directories are never traversed, and also exclusions don't have to start with a slash). Please update and test.