Class: EventMachine::FileTail::FileWatcher

Inherits:
EventMachine::FileWatch
  • Object
show all
Defined in:
lib/em/filetail.rb

Overview

Internal usage only. This class is used by EventMachine::FileTail to watch files you are tailing.

See also: EventMachine::FileTail#watch

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ FileWatcher

Returns a new instance of FileWatcher.



422
423
424
425
426
# File 'lib/em/filetail.rb', line 422

def initialize(block)
  @logger = Logger.new(STDERR)
  @logger.level = ($DEBUG and Logger::DEBUG or Logger::WARN)
  @callback = block
end

Instance Method Details

#file_deletedObject

def file_moved



436
437
438
# File 'lib/em/filetail.rb', line 436

def file_deleted
  @callback.call(:deleted)
end

#file_modifiedObject

def initialize



428
429
430
# File 'lib/em/filetail.rb', line 428

def file_modified
  @callback.call(:modified)
end

#file_movedObject

def file_modified



432
433
434
# File 'lib/em/filetail.rb', line 432

def file_moved
  @callback.call(:moved)
end

#unbindObject

def file_deleted



440
441
442
# File 'lib/em/filetail.rb', line 440

def unbind
  @callback.call(:unbind)
end