watchr icon indicating copy to clipboard operation
watchr copied to clipboard

Ignoring events while executing action

Open afeld opened this issue 14 years ago • 1 comments

So for various reasons I have a project that requires a build, and the files are generated in the same directory as the source files. Watchr is currently responding to every file change as they are regenerated, so I was wondering if there is a way to ignore incoming events while an action is being executed. Essentially, I want to do this:

watch('.*') do |match|
  @rule.ignore = true
  # run build
  @rule.ignore = false 
end

Any ideas are appreciated (other than making a separate build directory - I know, I know). Thanks!

afeld avatar Aug 09 '11 18:08 afeld

I would also like this feature. In my case, I use Unity (a unit testing framework for C) for unit testing and as part of the build, I run a script that automatically updates the test files to make sure the TEST_GROUP_RUNNER has all of the tests listed and updates the script runner to ensure it has all groups listed in the RUN_TEST_GROUP. I have watchr setup to watch the test files so when I save a change in my editor, the files are updated, built, and the test is run. The problem is that watchr sees that the files have changed and executes the sequence again, so it ends up in a loop. With the ability to tell watchr to temporarily stop checking for updates temporarily, I could get watchr to ignore the automatic updates and thus not get into a loop.

cvoltz avatar Mar 22 '12 15:03 cvoltz