Class: Wtails::Tail::Reader
- Inherits:
-
EventMachine::FileTail
- Object
- EventMachine::FileTail
- Wtails::Tail::Reader
- Defined in:
- lib/wtails/tail.rb
Instance Method Summary collapse
-
#initialize(path, startpos = -1)) ⇒ Reader
constructor
A new instance of Reader.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(path, startpos = -1)) ⇒ Reader
Returns a new instance of Reader.
21 22 23 24 |
# File 'lib/wtails/tail.rb', line 21 def initialize(path, startpos=-1) super(path, startpos) @buffer = BufferedTokenizer.new end |
Instance Method Details
#receive_data(data) ⇒ Object
26 27 28 29 30 |
# File 'lib/wtails/tail.rb', line 26 def receive_data(data) @buffer.extract(data).each do |line| Wtails.channel(path) << line end end |