Class: Loghandler::Tailer
- Inherits:
-
EventMachine::FileTail
- Object
- EventMachine::FileTail
- Loghandler::Tailer
- Defined in:
- lib/loghandler/tailer.rb
Instance Method Summary collapse
-
#initialize(options, channel) ⇒ Tailer
constructor
A new instance of Tailer.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(options, channel) ⇒ Tailer
Returns a new instance of Tailer.
2 3 4 5 6 |
# File 'lib/loghandler/tailer.rb', line 2 def initialize(,channel) @options = @channel = channel super([:file]) end |
Instance Method Details
#receive_data(data) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/loghandler/tailer.rb', line 8 def receive_data(data) data.each_line do |line| line.split("\n").each do |sline| @channel.push sline end end end |