avoid dynamic use of singleton methods in pipeline compilation

This commit is contained in:
Joao Duarte 2016-05-16 16:48:41 +01:00
parent 98abb22258
commit ce473ab502

View file

@ -396,7 +396,7 @@ module LogStash; module Config; module AST
if type == "filter"
i = LogStash::Config::AST.defered_conditionals_index += 1
source = <<-CODE
define_singleton_method :cond_func_#{i} do |input_events|
@generated_objects[:cond_func_#{i}] = lambda do |input_events|
result = []
input_events.each do |event|
events = [event]
@ -410,7 +410,7 @@ module LogStash; module Config; module AST
LogStash::Config::AST.defered_conditionals << source
<<-CODE
events = cond_func_#{i}(events)
events = @generated_objects[:cond_func_#{i}].call(events)
CODE
else # Output
<<-CODE