Skip to content

Commit

Permalink
Undo unnecessary indendation change
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Nov 25, 2015
1 parent 5aff6ac commit 9f36ef1
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions logstash-core/lib/logstash/config/config_ast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ def compile_initializer


code << <<-CODE
#{name} = #{plugin.compile_initializer}
#{name} = #{plugin.compile_initializer}
@#{plugin.plugin_type}s << #{name}
CODE

# The flush method for this filter.
if plugin.plugin_type == "filter"

code << <<-CODE
#{name}_flush = lambda do |options, &block|
#{name}_flush = lambda do |options, &block|
@logger.debug? && @logger.debug(\"Flushing\", :plugin => #{name})
events = #{name}.flush(options)
Expand Down Expand Up @@ -232,18 +232,18 @@ def compile_initializer

def compile
case plugin_type
when "input"
return "start_input(#{variable_name})"
when "filter"
return <<-CODE
when "input"
return "start_input(#{variable_name})"
when "filter"
return <<-CODE
events = #{variable_name}.multi_filter(events)
CODE
when "output"
return "targeted_outputs << #{variable_name}\n"
when "codec"
settings = attributes.recursive_select(Attribute).collect(&:compile).reject(&:empty?)
attributes_code = "LogStash::Util.hash_merge_many(#{settings.map { |c| "{ #{c} }" }.join(", ")})"
return "plugin(#{plugin_type.inspect}, #{plugin_name.inspect}, #{attributes_code})"
CODE
when "output"
return "targeted_outputs << #{variable_name}\n"
when "codec"
settings = attributes.recursive_select(Attribute).collect(&:compile).reject(&:empty?)
attributes_code = "LogStash::Util.hash_merge_many(#{settings.map { |c| "{ #{c} }" }.join(", ")})"
return "plugin(#{plugin_type.inspect}, #{plugin_name.inspect}, #{attributes_code})"
end
end

Expand Down Expand Up @@ -406,7 +406,7 @@ def cond_func_#{i}(input_events)
CODE
else # Output
<<-CODE
#{super}
#{super}
end
CODE
end
Expand Down Expand Up @@ -527,19 +527,19 @@ def _inspect(indent="")
tv = "...#{tv[-20..-1]}" if tv.size > 20

indent +
self.class.to_s.sub(/.*:/,'') +
self.class.to_s.sub(/.*:/,'') +
em.map{|m| "+"+m.to_s.sub(/.*:/,'')}*"" +
" offset=#{interval.first}" +
", #{tv.inspect}" +
im +
(elements && elements.size > 0 ?
":" +
(elements.select { |e| !e.is_a?(LogStash::Config::AST::Whitespace) && e.elements && e.elements.size > 0 }||[]).map{|e|
begin
"\n"+e.inspect(indent+" ")
rescue # Defend against inspect not taking a parameter
"\n"+indent+" "+e.inspect
end
begin
"\n"+e.inspect(indent+" ")
rescue # Defend against inspect not taking a parameter
"\n"+indent+" "+e.inspect
end
}.join("") :
""
)
Expand Down

0 comments on commit 9f36ef1

Please sign in to comment.