Allow options pass through for Listen.to call #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, first of all thanks for this gem! I really like the way it piggybacks the modern rails features.
Now that we don't get too romantic here, I did head into some troubles. Not per se because of the gem itself but as we all know the rabbit hole can sometimes go pretty deep when planet align just perfectly.
Issue
Problem is that when running on virtualized environment that is using some not-so-inotify-friendly partition systems, the default mechanisms for detecting changes might fail altogether, and silently. There are multiple hoops that might end up causing this, but in my case it's this specific Windows computer that I'm developing on from time to time.
Environment
My problematic environment is:
Windows -> WSL -> Docker (docker compose + volumes mounted from Windows disks) -> Alpine Linux running RoR
Listen the silence
Now, the awesome guard gem listen (respect to ppl behind that too!) tries to handle problematic situations gracefully but might need a bit more help to function proper.
In the docs of listen gem, they nicely suggest to use wdm gem if you're on windows, but as it is obvious from my actual environment above, wdm gem does not really help in this case as my running environment is linux, but the underlying filesystem is actually NTFS so wdm did not scratch the itch.
What
So, I did a little stab at the code to enable passing options that Listen.to takes to be able to force the polling mechanism (and meanwhile at it, just pass through other options as well if given).