Method: Listen.to
- Defined in:
- lib/listen.rb
.to(*args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications on a either single directory or multiple directories.
When :forward_to is specified, this listener will broadcast modifications over TCP.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/listen.rb', line 23 def to(*args, &block) boot_celluloid @stopping = false = args.last.is_a?(Hash) ? args.last : {} if target = .delete(:forward_to) Listener.new(target, :broadcaster, *args, &block) else Listener.new(*args, &block) end end |