Module: Listen
- Defined in:
- lib/listen.rb,
lib/listen/cli.rb,
lib/listen/file.rb,
lib/listen/change.rb,
lib/listen/record.rb,
lib/listen/adapter.rb,
lib/listen/version.rb,
lib/listen/listener.rb,
lib/listen/silencer.rb,
lib/listen/directory.rb,
lib/listen/adapter/bsd.rb,
lib/listen/adapter/tcp.rb,
lib/listen/tcp/message.rb,
lib/listen/adapter/base.rb,
lib/listen/tcp/listener.rb,
lib/listen/adapter/linux.rb,
lib/listen/adapter/darwin.rb,
lib/listen/adapter/polling.rb,
lib/listen/adapter/windows.rb,
lib/listen/tcp/broadcaster.rb
Defined Under Namespace
Modules: Adapter, TCP Classes: CLI, Change, Directory, File, Forwarder, Listener, Record, Silencer
Constant Summary collapse
- VERSION =
'2.6.2'
Class Attribute Summary collapse
-
.stopping ⇒ Object
Returns the value of attribute stopping.
Class Method Summary collapse
- .boot_celluloid ⇒ Object private
-
.on(target, *args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications broadcast over TCP.
-
.stop ⇒ Object
Stop all listeners.
-
.to(*args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications on a either single directory or multiple directories.
Class Attribute Details
.stopping ⇒ Object
Returns the value of attribute stopping.
7 8 9 |
# File 'lib/listen.rb', line 7 def stopping @stopping end |
Class Method Details
.boot_celluloid ⇒ Object (private)
57 58 59 |
# File 'lib/listen.rb', line 57 def boot_celluloid Celluloid.boot unless Celluloid.running? end |
.on(target, *args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications broadcast over TCP.
51 52 53 |
# File 'lib/listen.rb', line 51 def on(target, *args, &block) TCP::Listener.new(target, :recipient, *args, &block) end |
.stop ⇒ Object
Stop all listeners
35 36 37 38 |
# File 'lib/listen.rb', line 35 def stop @stopping = true Celluloid.shutdown end |
.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.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/listen.rb', line 22 def to(*args, &block) boot_celluloid @stopping = false = args.last.is_a?(Hash) ? args.last : {} if target = .delete(:forward_to) TCP::Listener.new(target, :broadcaster, *args, &block) else Listener.new(*args, &block) end end |