lib/fluent/plugin/out_test.rb in fluentd-0.10.35 vs lib/fluent/plugin/out_test.rb in fluentd-0.10.36

- old
+ new

@@ -14,65 +14,61 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # module Fluent + class TestOutput < Output + Plugin.register_output('test', self) + def initialize + @emit_streams = [] + @name = nil + end -class TestOutput < Output - Plugin.register_output('test', self) + attr_reader :emit_streams, :name - def initialize - @emit_streams = [] - @name = nil - end + def emits + all = [] + @emit_streams.each {|tag,events| + events.each {|time,record| + all << [tag, time, record] + } + } + all + end - attr_reader :emit_streams, :name - - def emits - all = [] - @emit_streams.each {|tag,events| - events.each {|time,record| - all << [tag, time, record] + def events + all = [] + @emit_streams.each {|tag,events| + all.concat events } - } - all - end + all + end - def events - all = [] - @emit_streams.each {|tag,events| - all.concat events - } - all - end - - def records - all = [] - @emit_streams.each {|tag,events| - events.each {|time,record| - all << record + def records + all = [] + @emit_streams.each {|tag,events| + events.each {|time,record| + all << record + } } - } - all - end + all + end - def configure(conf) - if name = conf['name'] - @name = name + def configure(conf) + if name = conf['name'] + @name = name + end end - end - def start - end + def start + end - def shutdown - end + def shutdown + end - def emit(tag, es, chain) - chain.next - @emit_streams << [tag, es.to_a] + def emit(tag, es, chain) + chain.next + @emit_streams << [tag, es.to_a] + end end -end - - end