Class: EventMachine::FileTail::FileWatcher

Inherits:
EventMachine::FileWatch
  • Object
show all
Defined in:
lib/event_machine/tail/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.



421
422
423
424
425
# File 'lib/event_machine/tail/filetail.rb', line 421

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



435
436
437
# File 'lib/event_machine/tail/filetail.rb', line 435

def file_deleted
  @callback.call(:deleted)
end

#file_modifiedObject

def initialize



427
428
429
# File 'lib/event_machine/tail/filetail.rb', line 427

def file_modified
  @callback.call(:modified)
end

#file_movedObject

def file_modified



431
432
433
# File 'lib/event_machine/tail/filetail.rb', line 431

def file_moved
  @callback.call(:moved)
end

#unbindObject

def file_deleted



439
440
441
# File 'lib/event_machine/tail/filetail.rb', line 439

def unbind
  @callback.call(:unbind)
end