Class: EventMachine::FileTail::FileWatcher
- Inherits:
-
EventMachine::FileWatch
- Object
- EventMachine::FileWatch
- EventMachine::FileTail::FileWatcher
- 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
-
#file_deleted ⇒ Object
def file_moved.
-
#file_modified ⇒ Object
def initialize.
-
#file_moved ⇒ Object
def file_modified.
-
#initialize(block) ⇒ FileWatcher
constructor
A new instance of FileWatcher.
-
#unbind ⇒ Object
def file_deleted.
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_deleted ⇒ Object
def file_moved
436 437 438 |
# File 'lib/em/filetail.rb', line 436 def file_deleted @callback.call(:deleted) end |
#file_modified ⇒ Object
def initialize
428 429 430 |
# File 'lib/em/filetail.rb', line 428 def file_modified @callback.call(:modified) end |
#file_moved ⇒ Object
def file_modified
432 433 434 |
# File 'lib/em/filetail.rb', line 432 def file_moved @callback.call(:moved) end |
#unbind ⇒ Object
def file_deleted
440 441 442 |
# File 'lib/em/filetail.rb', line 440 def unbind @callback.call(:unbind) end |