Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring events while executing action #30

Open
afeld opened this issue Aug 9, 2011 · 1 comment
Open

Ignoring events while executing action #30

afeld opened this issue Aug 9, 2011 · 1 comment

Comments

@afeld
Copy link

afeld commented Aug 9, 2011

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!

@cvoltz
Copy link

cvoltz commented Mar 22, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants