Module: Listen
- Defined in:
- lib/listen.rb,
lib/listen/adapter.rb,
lib/listen/version.rb,
lib/listen/listener.rb,
lib/listen/turnstile.rb,
lib/listen/adapters/bsd.rb,
lib/listen/adapters/linux.rb,
lib/listen/adapters/darwin.rb,
lib/listen/adapters/polling.rb,
lib/listen/adapters/windows.rb,
lib/listen/directory_record.rb
Defined Under Namespace
Modules: Adapters Classes: Adapter, DirectoryRecord, Listener, Turnstile
Constant Summary collapse
- VERSION =
'1.3.0'
Class Method Summary collapse
- ._init_listener(*args, &block) ⇒ Object
-
.to(*args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications on a either single directory or multiple directories.
-
.to!(*args) {|modified, added, removed| ... } ⇒ Object
Listens to file system modifications on a either single directory or multiple directories.
Class Method Details
._init_listener(*args, &block) ⇒ Object
50 51 52 |
# File 'lib/listen.rb', line 50 def self._init_listener(*args, &block) Listener.new(*args, &block) end |
.to(*args) {|modified, added, removed| ... } ⇒ Listen::Listener
Listens to file system modifications on a either single directory or multiple directories. When calling this method, the current thread is not blocked.
26 27 28 29 30 |
# File 'lib/listen.rb', line 26 def self.to(*args, &block) listener = _init_listener(*args, &block) block ? listener.start : listener end |
.to!(*args) {|modified, added, removed| ... } ⇒ Object
Listens to file system modifications on a either single directory or multiple directories. When calling this method, the current thread is blocked.
44 45 46 |
# File 'lib/listen.rb', line 44 def self.to!(*args, &block) _init_listener(*args, &block).start! end |