Module: Listen

Defined in:
lib/listen.rb,
lib/listen/adapter.rb,
lib/listen/version.rb,
lib/listen/listener.rb,
lib/listen/adapters/linux.rb,
lib/listen/adapters/darwin.rb,
lib/listen/adapters/polling.rb,
lib/listen/adapters/windows.rb

Defined Under Namespace

Modules: Adapters Classes: Adapter, Listener

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.to(*args) {|modified, added, removed| ... } ⇒ Listen::Listener

Listen to file system modifications.

Parameters:

  • dir (String, Pathname)

    the directory to watch

  • options (Hash)

    the listen options

Yields:

  • (modified, added, removed)

    the changed files

Yield Parameters:

  • modified (Array<String>)

    the list of modified files

  • added (Array<String>)

    the list of added files

  • removed (Array<String>)

    the list of removed files

Returns:



21
22
23
24
# File 'lib/listen.rb', line 21

def self.to(*args, &block)
  listener = Listener.new(*args, &block)
  block ? listener.start : listener
end