Listen

Constants

VERSION

Public Class Methods

_init_listener(*args, &block) click to toggle source

@private

# File lib/listen.rb, line 50
def self._init_listener(*args, &block)
  Listener.new(*args, &block)
end
to(*args, &block) click to toggle source

Listens to file system modifications on a either single directory or multiple directories. When calling this method, the current thread is not blocked.

@param (see Listen::Listener#new)

@yield [modified, added, removed] the changed files @yieldparam [Array<String>] modified the list of modified files @yieldparam [Array<String>] added the list of added files @yieldparam [Array<String>] removed the list of removed files

@return [Listen::Listener] the file listener if no block given

# File lib/listen.rb, line 26
def self.to(*args, &block)
  listener = _init_listener(*args, &block)

  block ? listener.start : listener
end
to!(*args, &block) click to toggle source

Listens to file system modifications on a either single directory or multiple directories. When calling this method, the current thread is blocked.

@param (see Listen::Listener#new)

@yield [modified, added, removed] the changed files @yieldparam [Array<String>] modified the list of modified files @yieldparam [Array<String>] added the list of added files @yieldparam [Array<String>] removed the list of removed files

@since 1.0.0

# File lib/listen.rb, line 44
def self.to!(*args, &block)
  _init_listener(*args, &block).start!
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.