fluent/fluentd — pull request #352 by repeatedly (2014-06-16 03:19:52+00:00)
Title: Change TextParser call api

This change is needed for supporting multi events in one log.
Current `TextParser#parse`(`XXXParser#call`) API is below:

```rb
time, record = parser.parse(text)
```

In this API, we can't treat netflow like multi-event log without trick.
We have several approaches to resolve the problem:

1. parser.parse returns `array` value
2. parser.parse receives EventStream object
3. parser.parse accepts block

I compared above approaches and I think 3 is better.

At 1, users should check return value type. It seems complicated
At 2, I can't imagine the clear API
At 3, users write only `parser.parse(text) { |time, record| ... }` to accept popular one event log and multi-event log

So I decided to use 3. and `TextParser#parse` supports two call approaches, `t, r = parser.parse(text)` and `parser.parse(text) { |t, r| ... }`.

What do you think?