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
Batch changes (and remove options[:every]
)
#115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you. I'll look into tests, they also looks correct.
Oh, I see errors like:
I think it's easy to fix. Let me know when there will be complicate fails. |
Tests should work better after #116 (the second commit), so I recommend you to update (rebase) your branch. |
Thanks for the review! I have a few questions, but I'll work on some of the comments you gave and push it up soon 😄 |
Hm it looks like there's a flaky test here. I had the same issue locally, but I didn't look into it much. Interestingly as I was running it repeatedly, I got a slightly different error.
|
Oh, thank you. I usually see fails like this (from your branch): https://github.com/filewatcher/filewatcher/pull/115/checks?check_run_id=603280959 I'm trying to improve the situation in #119, but… with macOS, JRuby, CLI, files, threads, etc — it's very hard! Sorry about this. I'll notice about updates. |
@zachahn sorry, but there are conflicts again… CI should pass faster and more accurate! Please, update the PR if you have a chance. I can try to help if you want. |
@AlexWayfer No worries! Rebased and pushed |
Pretty nice PR, thank you. I'm waiting for your response about new debug method. |
@AlexWayfer Updated! I opted to use |
@zachahn I see a fail with Ruby 2.5: https://cirrus-ci.com/task/5304049320853504?command=test#L1175 And it seems syntax error for this version, not something phantom. So, can you please fix it? |
Strange! The only thing I changed was that debugging thing, so I'm inclined to believe it's a flaky test. Did you try rerunning the test? (Here's a diff showing what I changed, but since I rebased I'm not sure how long this link will work https://github.com/filewatcher/filewatcher/compare/929c5da3..d9f8914c. And it looks like 929c5da passed for Ruby 2.5) I see that the test expects one hash, but it received two hashes. I'm not sure if this is the best way, but perhaps the best way to proceed would be to update the test to merge all the hashes together with something like I won't have time to look at this for the next few days. I'd appreciate it if you have a chance to fix it! I think I checked the box that lets maintainers push onto this branch. But otherwise I'll take a look at it later this week. |
No. Now I've tried and it passes. Hm…
I've understood the reason: there were two Filewatcher's triggers instead of expected one. I think, it's maybe OK to do
OK, thank you for your work and messages. I've tried and pushed a commit to this PR, so let's see. |
This removes the `every` option when initializing Filewatcher. Though backwards incompatible, it's fairly simple to emulate the previous behavior. filewatcher.watch do |changes| # to emulate every=true changes.each do |filename, event| # ... end # to emulate every=false filename, event = changes.first # ... end
Now it looks correct and passing, thank you again for your contributions. |
Thank you for taking a look and fixing it! Happy to contribute, it was a pleasure :) |
We forgot to update the README… |
The CLI option
--every
remains unchanged.