guard / rb-inotify

A thorough inotify wrapper for Ruby using FFI.
MIT License
312 stars 64 forks source link

Avoid exception in case of closing a file watched by notifier, like t… #50

Closed nishidy closed 8 years ago

nishidy commented 8 years ago

…rapping SIGINT to close the file without exception.

To continue after watching file is stopped without exception.

trap :INT do
    notifier.close
    file.close
end

notifier.run

# continue after watching file is stopped
...
nishidy commented 8 years ago

47

nex3 commented 8 years ago

This looks pretty good! Just a little more documentation and I'll merge it in.

nishidy commented 8 years ago

Sorry for my late response. Updated as @nex3 suggested. Check, please.