Class: FseventsToVm::Watch
- Inherits:
-
Object
- Object
- FseventsToVm::Watch
- Defined in:
- lib/fsevents_to_vm/watch.rb
Instance Method Summary collapse
-
#initialize(*listen_dirs) ⇒ Watch
constructor
A new instance of Watch.
- #run ⇒ Object
Constructor Details
#initialize(*listen_dirs) ⇒ Watch
Returns a new instance of Watch.
5 6 7 8 |
# File 'lib/fsevents_to_vm/watch.rb', line 5 def initialize(*listen_dirs) @listen_dirs = listen_dirs @fs = FSEvent.new end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/fsevents_to_vm/watch.rb', line 10 def run @fs.watch(@listen_dirs, file_events: true) do |files| files.each do |file| event = build_event(file) yield event if event end end @fs.run end |