watchr icon indicating copy to clipboard operation
watchr copied to clipboard

New files not automatically watched.

Open jhelwig opened this issue 15 years ago • 23 comments

New files are not automatically picked up to be watched. watchr must be stopped & re-started for saved changes in new files to match a watched pattern.

Ubuntu w/ ext3 fs watchr 0.5.7 rev 0.3.1

Not really a big deal. autotest has the same problem.

jhelwig avatar Oct 24 '09 15:10 jhelwig

+1 would also like to be notified if this gets fixed.

rsanheim avatar Oct 26 '09 05:10 rsanheim

Detecting new files is currently not supported. This is mainly due to how rev works in the backend. It's pretty much the #1 feature I want to implement though, so it will be in there soon-(ish). There are various ways to go about it though and I still have to see which one's the most appropriate.

I'll leave this issue open until the feature gets added.

mynyml avatar Nov 06 '09 14:11 mynyml

@jhelwig btw, as a temporary workaround there are two options:

  • touch/save the script file (it will rescan for files matching the patterns)
  • add a signal handler in your script that touches the script file for you. you can use the #path method for that (system "touch #{path}").

mynyml avatar Nov 06 '09 14:11 mynyml

Steven Parkes has a fork of watchr that uses EventMachine to get this functionality instead of rev. Last I spoke with him, I got the impression that it was functional, but there was still some work that he wanted to do.

http://github.com/smparkes/watchr

jhelwig avatar Nov 06 '09 15:11 jhelwig

Thanks. Yeah I'm aware of his fork, playing with it atm actually. I've tried having an EM backend twice before (one attempt is still in a branch http://github.com/mynyml/watchr/blob/em/lib/watchr/event_handlers/unix.rb) so i'm pretty interested in his approach.

One other solution I was considering is using inotify and kqueue directly (the earliest version of watchr used inotify directly http://github.com/mynyml/watchr/blob/f0a0b3045f4458cb973eb708cce3d4b3905ce2fe/lib/watchr/event_handlers/linux.rb) instead of the rev wrapper, since it allows more flexibility, including watching directories. That power would come with potential maintenance headaches though, so at this point smparkes's solution seems to be the most interesting one.

mynyml avatar Nov 06 '09 16:11 mynyml

Touching or reloading the script isn't really an option for me since that throws away the state I've been collecting up to that point. Would be nice to have this solved in rev.

graaff avatar Dec 10 '09 09:12 graaff

Any news on this front?

anlek avatar Jul 20 '10 17:07 anlek

+1 for this as well.

I'm currently using a custom ruby project to run all my tests, linting, and compilation. I would love to abandon it in favour of watchr, but I can't without the ability to detect new files.

karl avatar Oct 03 '10 11:10 karl

Did anything change ?

paneq avatar May 22 '11 10:05 paneq

Has there been any progress with monitoring for new files?

jmazzi avatar Jul 12 '11 13:07 jmazzi

I just started using Guard.

anlek avatar Jul 12 '11 21:07 anlek

+1

ropez avatar Sep 26 '11 06:09 ropez

still doesn't care about new files

installero avatar Sep 30 '11 08:09 installero

+1

wulftone avatar Dec 22 '11 03:12 wulftone

+1

mikebranderhorst avatar Dec 23 '11 11:12 mikebranderhorst

+1 need it

vkovalskiy avatar Jan 11 '12 13:01 vkovalskiy

Me too!

shaggyone avatar Apr 18 '12 04:04 shaggyone

+1

samsamm777 avatar May 23 '12 10:05 samsamm777

+1, bummer this was never implemented

eshilts avatar Aug 30 '12 22:08 eshilts

+1 need it desperately

anbiniyar avatar Oct 12 '12 08:10 anbiniyar

use Guard instead.

samsamm777 avatar Dec 14 '12 17:12 samsamm777

It's seem like still not supported by watchr.

zw963 avatar Jan 07 '14 03:01 zw963

Touching the script doesn't cause new files to be detected for me. Can someone confirm or deny this?

szhu avatar May 11 '15 01:05 szhu