Enable SpaceAfterColon, SpaceAfterComma, SpaceAfterSemicolon (#15180)

Enable SpaceAfterColon, SpaceAfterComma, SpaceAfterSemicolon and fix occurrences.
This commit is contained in:
Andres Rodriguez 2023-07-14 16:46:35 -04:00 committed by GitHub
parent 26ff2f7db9
commit b63ffea472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 376 additions and 376 deletions

View file

@ -26,6 +26,12 @@ Layout/TrailingWhitespace:
Enabled: true
Layout/TrailingEmptyLines:
Enabled: true
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAfterSemicolon:
Enabled: true
##### Need review #####
Layout/AccessModifierIndentation:
@ -170,16 +176,10 @@ Layout/RescueEnsureAlignment:
Enabled: false
Layout/SingleLineBlockChain:
Enabled: false
Layout/SpaceAfterColon:
Enabled: false
Layout/SpaceAfterComma:
Enabled: false
Layout/SpaceAfterMethodName:
Enabled: false
Layout/SpaceAfterNot:
Enabled: false
Layout/SpaceAfterSemicolon:
Enabled: false
Layout/SpaceAroundBlockParameters:
Enabled: false
Layout/SpaceAroundEqualsInParameterDefault:

View file

@ -53,7 +53,7 @@ module LogStash
raise CompressError.new("File #{target} exist") if ::File.exist?(target)
::Zip::File.open(target, ::Zip::File::CREATE) do |zipfile|
Dir.glob("#{dir}/**/*").each do |file|
path_in_zip = file.gsub("#{dir}/","")
path_in_zip = file.gsub("#{dir}/", "")
zipfile.add(path_in_zip, file)
end
end
@ -97,14 +97,14 @@ module LogStash
Stud::Temporary.file do |tar_file|
::Gem::Package::TarWriter.new(tar_file) do |tar|
Dir.glob("#{dir}/**/*").each do |file|
name = file.gsub("#{dir}/","")
name = file.gsub("#{dir}/", "")
stats = ::File.stat(file)
mode = stats.mode
if ::File.directory?(file)
tar.mkdir(name, mode)
else # is a file to be added
tar.add_file(name,mode) do |out|
tar.add_file(name, mode) do |out|
File.open(file, "rb") do |fd|
chunk = nil
size = 0

View file

@ -68,7 +68,7 @@ class LogStash::PluginManager::Generate < LogStash::PluginManager::Command
else
# copy the new file, in case of being an .erb file should render first
if source_entry.end_with?("erb")
target_entry = target_entry.gsub(/.erb$/,"").gsub("example", name)
target_entry = target_entry.gsub(/.erb$/, "").gsub("example", name)
File.open(target_entry, "w") { |f| f.write(render(source_entry)) }
else
FileUtils.cp(source_entry, target_entry)

View file

@ -549,7 +549,7 @@ class LogStash::Agent
uptime_precise_millis = uptime_metric.with_units_precise(ScaleUnits::MILLISECONDS)
uptime_precise_seconds = uptime_metric.with_units_precise(ScaleUnits::SECONDS)
events_namespace = metric.namespace([:stats,:events])
events_namespace = metric.namespace([:stats, :events])
flow_metrics = []
flow_metrics << create_flow_metric("input_throughput", get_counter(events_namespace, :in), uptime_precise_seconds)
flow_metrics << create_flow_metric("filter_throughput", get_counter(events_namespace, :out), uptime_precise_seconds)
@ -558,7 +558,7 @@ class LogStash::Agent
flow_metrics << create_flow_metric("worker_concurrency", get_timer(events_namespace, :duration_in_millis), uptime_precise_millis)
registered, unregistered = flow_metrics.partition do |flow_metric|
@metric.collector.register?([:stats,:flow], flow_metric.name.to_sym, flow_metric)
@metric.collector.register?([:stats, :flow], flow_metric.name.to_sym, flow_metric)
end
unregistered.each do |unregistered_flow_metric|

View file

@ -36,7 +36,7 @@ module LogStash::Api::AppHelpers
data = generate_error_hash(data)
else
selected_fields = extract_fields(filter.to_s.strip)
data.select! { |k,v| selected_fields.include?(k) } unless selected_fields.empty?
data.select! { |k, v| selected_fields.include?(k) } unless selected_fields.empty?
unless options.include?(:exclude_default_metadata)
data = data.to_hash
if data.values.size == 0 && selected_fields.size > 0

View file

@ -41,7 +41,7 @@ module LogStash
def build(*klass_path)
# Get a nested path with args like (:parent, :child)
klass = klass_path.reduce(factory) {|acc,v| acc[v]}
klass = klass_path.reduce(factory) {|acc, v| acc[v]}
if klass
klass.new(service)

View file

@ -29,7 +29,7 @@ module LogStash
:os => os,
:jvm => jvm
}
payload.select! { |k,v| selected_fields.include?(k) } unless selected_fields.empty?
payload.select! { |k, v| selected_fields.include?(k) } unless selected_fields.empty?
payload
end

View file

@ -83,7 +83,7 @@ module LogStash
def flow
extract_metrics(
[:stats,:flow],
[:stats, :flow],
:input_throughput, :filter_throughput, :output_throughput, :queue_backpressure, :worker_concurrency
)
rescue LogStash::Instrument::MetricStore::MetricNotFound

View file

@ -46,7 +46,7 @@ module LogStash::Codecs; class Base < LogStash::Plugin
# DEPRECATED: Prefer defining encode_sync or multi_encode
def encode(event)
encoded = multi_encode([event])
encoded.each {|event,data| @on_event.call(event,data) }
encoded.each {|event, data| @on_event.call(event, data) }
end # def encode
public

View file

@ -115,11 +115,11 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC
def map_expr_attributes
# Turn attributes into a hash map
self.attributes.recursive_select(Attribute).map(&:expr).map {|k,v|
self.attributes.recursive_select(Attribute).map(&:expr).map {|k, v|
if v.kind_of?(Java::OrgLogstashConfigIrExpression::ValueExpression)
[k, v.get]
else
[k,v]
[k, v]
end
}.reduce({}) do |hash, kv|
k, v = kv
@ -277,7 +277,7 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC
end
else_stack.reverse.each_cons(2) do |cons|
later,earlier = cons
later, earlier = cons
earlier << later
end
exprs << else_stack.first

View file

@ -49,7 +49,7 @@ module LogStashCompilerLSCLGrammar
s2 << r4
end
if s2.last
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
r2.extend(Config0)
else
@index = i2
@ -61,14 +61,14 @@ module LogStashCompilerLSCLGrammar
break
end
end
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
s0 << r1
if r1
r5 = _nt_cs
s0 << r5
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Config,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Config, input, i0...index, s0)
r0.extend(Config1)
else
@index = i0
@ -101,7 +101,7 @@ module LogStashCompilerLSCLGrammar
if r3
r2 = r3
else
r2 = instantiate_node(SyntaxNode,input, index...index)
r2 = instantiate_node(SyntaxNode, input, index...index)
end
s1 << r2
if r2
@ -129,7 +129,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s1 << r5
if r5
if (match_len = has_terminal?("\r", false, index))
@ -142,7 +142,7 @@ module LogStashCompilerLSCLGrammar
if r8
r7 = r8
else
r7 = instantiate_node(SyntaxNode,input, index...index)
r7 = instantiate_node(SyntaxNode, input, index...index)
end
s1 << r7
if r7
@ -159,7 +159,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Comment0)
else
@index = i1
@ -175,7 +175,7 @@ module LogStashCompilerLSCLGrammar
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Comment,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Comment, input, i0...index, s0)
end
node_cache[:comment][start_index] = r0
@ -217,7 +217,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace, input, i0...index, s0)
node_cache[:cs][start_index] = r0
@ -254,7 +254,7 @@ module LogStashCompilerLSCLGrammar
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace, input, i0...index, s0)
end
node_cache[:whitespace][start_index] = r0
@ -327,7 +327,7 @@ module LogStashCompilerLSCLGrammar
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(PluginSection0)
else
@index = i6
@ -339,7 +339,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s0 << r5
if r5
if (match_len = has_terminal?("}", false, index))
@ -356,7 +356,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::PluginSection,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::PluginSection, input, i0...index, s0)
r0.extend(PluginSection1)
else
@index = i0
@ -413,7 +413,7 @@ module LogStashCompilerLSCLGrammar
i0 = index
if (match_len = has_terminal?("input", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"input"')
@ -424,7 +424,7 @@ module LogStashCompilerLSCLGrammar
r0 = r1
else
if (match_len = has_terminal?("filter", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"filter"')
@ -435,7 +435,7 @@ module LogStashCompilerLSCLGrammar
r0 = r2
else
if (match_len = has_terminal?("output", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"output"')
@ -498,7 +498,7 @@ module LogStashCompilerLSCLGrammar
s4 << r6
end
if s4.last
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
r4 = instantiate_node(SyntaxNode, input, i4...index, s4)
r4.extend(Plugins0)
else
@index = i4
@ -510,11 +510,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
s1 << r3
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Plugins1)
else
@index = i1
@ -523,7 +523,7 @@ module LogStashCompilerLSCLGrammar
if r1
r0 = r1
else
r0 = instantiate_node(SyntaxNode,input, index...index)
r0 = instantiate_node(SyntaxNode, input, index...index)
end
node_cache[:plugins][start_index] = r0
@ -623,7 +623,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(Plugin0)
else
@index = i9
@ -635,11 +635,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Plugin1)
else
@index = i6
@ -648,7 +648,7 @@ module LogStashCompilerLSCLGrammar
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
if r5
@ -670,7 +670,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Plugin,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Plugin, input, i0...index, s0)
r0.extend(Plugin2)
else
@index = i0
@ -713,7 +713,7 @@ module LogStashCompilerLSCLGrammar
@index = i1
r1 = nil
else
r1 = instantiate_node(LogStash::Compiler::LSCL::AST::Name,input, i1...index, s1)
r1 = instantiate_node(LogStash::Compiler::LSCL::AST::Name, input, i1...index, s1)
end
if r1
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
@ -771,7 +771,7 @@ module LogStashCompilerLSCLGrammar
s0 << r2
if r2
if (match_len = has_terminal?("=>", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=>"')
@ -789,7 +789,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Attribute,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Attribute, input, i0...index, s0)
r0.extend(Attribute0)
else
@index = i0
@ -950,12 +950,12 @@ module LogStashCompilerLSCLGrammar
@index = i2
r2 = nil
else
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
end
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Bareword,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Bareword, input, i0...index, s0)
r0.extend(Bareword0)
else
@index = i0
@ -998,7 +998,7 @@ module LogStashCompilerLSCLGrammar
loop do
i3 = index
if (match_len = has_terminal?('\"', false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('\'\\"\'')
@ -1024,7 +1024,7 @@ module LogStashCompilerLSCLGrammar
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1038,7 +1038,7 @@ module LogStashCompilerLSCLGrammar
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(DoubleQuotedString0)
else
@index = i5
@ -1058,7 +1058,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?('"', false, index))
@ -1072,7 +1072,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String, input, i0...index, s0)
r0.extend(DoubleQuotedString1)
else
@index = i0
@ -1115,7 +1115,7 @@ module LogStashCompilerLSCLGrammar
loop do
i3 = index
if (match_len = has_terminal?("\\'", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"\\\\\'"')
@ -1141,7 +1141,7 @@ module LogStashCompilerLSCLGrammar
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1155,7 +1155,7 @@ module LogStashCompilerLSCLGrammar
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(SingleQuotedString0)
else
@index = i5
@ -1175,7 +1175,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?("'", false, index))
@ -1189,7 +1189,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String, input, i0...index, s0)
r0.extend(SingleQuotedString1)
else
@index = i0
@ -1264,7 +1264,7 @@ module LogStashCompilerLSCLGrammar
loop do
i3 = index
if (match_len = has_terminal?('\/', false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('\'\\/\'')
@ -1290,7 +1290,7 @@ module LogStashCompilerLSCLGrammar
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1304,7 +1304,7 @@ module LogStashCompilerLSCLGrammar
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(Regexp0)
else
@index = i5
@ -1324,7 +1324,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?('/', false, index))
@ -1338,7 +1338,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegExp,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegExp, input, i0...index, s0)
r0.extend(Regexp1)
else
@index = i0
@ -1378,7 +1378,7 @@ module LogStashCompilerLSCLGrammar
if r2
r1 = r2
else
r1 = instantiate_node(SyntaxNode,input, index...index)
r1 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r1
if r1
@ -1401,7 +1401,7 @@ module LogStashCompilerLSCLGrammar
@index = i3
r3 = nil
else
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
end
s0 << r3
if r3
@ -1430,11 +1430,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Number0)
else
@index = i6
@ -1443,13 +1443,13 @@ module LogStashCompilerLSCLGrammar
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Number,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Number, input, i0...index, s0)
r0.extend(Number1)
else
@index = i0
@ -1545,7 +1545,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s7.last
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
r7.extend(Array0)
else
@index = i7
@ -1557,11 +1557,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
s4 << r6
end
if s4.last
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
r4 = instantiate_node(SyntaxNode, input, i4...index, s4)
r4.extend(Array1)
else
@index = i4
@ -1570,7 +1570,7 @@ module LogStashCompilerLSCLGrammar
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
r3 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r3
if r3
@ -1590,7 +1590,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Array,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Array, input, i0...index, s0)
r0.extend(Array2)
else
@index = i0
@ -1641,7 +1641,7 @@ module LogStashCompilerLSCLGrammar
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
r3 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r3
if r3
@ -1661,7 +1661,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Hash,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Hash, input, i0...index, s0)
r0.extend(Hash0)
else
@index = i0
@ -1715,7 +1715,7 @@ module LogStashCompilerLSCLGrammar
s3 << r5
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Hashentries0)
else
@index = i3
@ -1727,11 +1727,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntries,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntries, input, i0...index, s0)
r0.extend(Hashentries1)
else
@index = i0
@ -1800,7 +1800,7 @@ module LogStashCompilerLSCLGrammar
s0 << r5
if r5
if (match_len = has_terminal?("=>", false, index))
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r6 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=>"')
@ -1818,7 +1818,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntry,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntry, input, i0...index, s0)
r0.extend(Hashentry0)
else
@index = i0
@ -1882,7 +1882,7 @@ module LogStashCompilerLSCLGrammar
s3 << r5
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Branch0)
else
@index = i3
@ -1894,7 +1894,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
i7, s7 = index, []
@ -1905,7 +1905,7 @@ module LogStashCompilerLSCLGrammar
s7 << r9
end
if s7.last
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
r7.extend(Branch1)
else
@index = i7
@ -1914,13 +1914,13 @@ module LogStashCompilerLSCLGrammar
if r7
r6 = r7
else
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r6
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Branch,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Branch, input, i0...index, s0)
r0.extend(Branch2)
else
@index = i0
@ -1974,7 +1974,7 @@ module LogStashCompilerLSCLGrammar
i0, s0 = index, []
if (match_len = has_terminal?("if", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"if"')
@ -2013,7 +2013,7 @@ module LogStashCompilerLSCLGrammar
s8 << r10
end
if s8.last
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
r8.extend(If0)
else
@index = i8
@ -2025,7 +2025,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
s0 << r7
if r7
if (match_len = has_terminal?("}", false, index))
@ -2044,7 +2044,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::If,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::If, input, i0...index, s0)
r0.extend(If1)
else
@index = i0
@ -2102,7 +2102,7 @@ module LogStashCompilerLSCLGrammar
i0, s0 = index, []
if (match_len = has_terminal?("else", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"else"')
@ -2114,7 +2114,7 @@ module LogStashCompilerLSCLGrammar
s0 << r2
if r2
if (match_len = has_terminal?("if", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"if"')
@ -2153,7 +2153,7 @@ module LogStashCompilerLSCLGrammar
s10 << r12
end
if s10.last
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
r10 = instantiate_node(SyntaxNode, input, i10...index, s10)
r10.extend(ElseIf0)
else
@index = i10
@ -2165,7 +2165,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
s0 << r9
if r9
if (match_len = has_terminal?("}", false, index))
@ -2186,7 +2186,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Elsif,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Elsif, input, i0...index, s0)
r0.extend(ElseIf1)
else
@index = i0
@ -2232,7 +2232,7 @@ module LogStashCompilerLSCLGrammar
i0, s0 = index, []
if (match_len = has_terminal?("else", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"else"')
@ -2265,7 +2265,7 @@ module LogStashCompilerLSCLGrammar
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Else0)
else
@index = i6
@ -2277,7 +2277,7 @@ module LogStashCompilerLSCLGrammar
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s0 << r5
if r5
if (match_len = has_terminal?("}", false, index))
@ -2294,7 +2294,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Else,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Else, input, i0...index, s0)
r0.extend(Else1)
else
@index = i0
@ -2364,7 +2364,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Condition0)
else
@index = i3
@ -2376,11 +2376,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Condition,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Condition, input, i0...index, s0)
r0.extend(Condition1)
else
@index = i0
@ -2451,7 +2451,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Expression0)
else
@index = i1
@ -2600,7 +2600,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(NegativeExpression0)
else
@index = i1
@ -2629,7 +2629,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(NegativeExpression1)
else
@index = i9
@ -2703,7 +2703,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::InExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::InExpression, input, i0...index, s0)
r0.extend(InExpression0)
else
@index = i0
@ -2768,7 +2768,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::NotInExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::NotInExpression, input, i0...index, s0)
r0.extend(NotInExpression0)
else
@index = i0
@ -2792,7 +2792,7 @@ module LogStashCompilerLSCLGrammar
end
if (match_len = has_terminal?("in", false, index))
r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r0 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"in"')
@ -2824,7 +2824,7 @@ module LogStashCompilerLSCLGrammar
i0, s0 = index, []
if (match_len = has_terminal?("not ", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"not "')
@ -2836,7 +2836,7 @@ module LogStashCompilerLSCLGrammar
s0 << r2
if r2
if (match_len = has_terminal?("in", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"in"')
@ -2846,7 +2846,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0 = instantiate_node(SyntaxNode, input, i0...index, s0)
r0.extend(NotInOperator0)
else
@index = i0
@ -3012,7 +3012,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(MethodCall0)
else
@index = i9
@ -3024,11 +3024,11 @@ module LogStashCompilerLSCLGrammar
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(MethodCall1)
else
@index = i6
@ -3037,7 +3037,7 @@ module LogStashCompilerLSCLGrammar
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
if r5
@ -3059,7 +3059,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::MethodCall,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::MethodCall, input, i0...index, s0)
r0.extend(MethodCall2)
else
@index = i0
@ -3142,7 +3142,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::ComparisonExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::ComparisonExpression, input, i0...index, s0)
r0.extend(CompareExpression0)
else
@index = i0
@ -3167,7 +3167,7 @@ module LogStashCompilerLSCLGrammar
i0 = index
if (match_len = has_terminal?("==", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=="')
@ -3179,7 +3179,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
else
if (match_len = has_terminal?("!=", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"!="')
@ -3191,7 +3191,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
else
if (match_len = has_terminal?("<=", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"<="')
@ -3203,7 +3203,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
else
if (match_len = has_terminal?(">=", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('">="')
@ -3316,7 +3316,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegexpExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegexpExpression, input, i0...index, s0)
r0.extend(RegexpExpression0)
else
@index = i0
@ -3341,7 +3341,7 @@ module LogStashCompilerLSCLGrammar
i0 = index
if (match_len = has_terminal?("=~", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=~"')
@ -3353,7 +3353,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::RegExpOperator)
else
if (match_len = has_terminal?("!~", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"!~"')
@ -3387,7 +3387,7 @@ module LogStashCompilerLSCLGrammar
i0 = index
if (match_len = has_terminal?("and", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"and"')
@ -3399,7 +3399,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
else
if (match_len = has_terminal?("or", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"or"')
@ -3411,7 +3411,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
else
if (match_len = has_terminal?("xor", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"xor"')
@ -3423,7 +3423,7 @@ module LogStashCompilerLSCLGrammar
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
else
if (match_len = has_terminal?("nand", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"nand"')
@ -3470,7 +3470,7 @@ module LogStashCompilerLSCLGrammar
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Selector,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Selector, input, i0...index, s0)
end
node_cache[:selector][start_index] = r0
@ -3521,7 +3521,7 @@ module LogStashCompilerLSCLGrammar
@index = i2
r2 = nil
else
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
end
s0 << r2
if r2
@ -3536,7 +3536,7 @@ module LogStashCompilerLSCLGrammar
end
end
if s0.last
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::SelectorElement,input, i0...index, s0)
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::SelectorElement, input, i0...index, s0)
r0.extend(SelectorElement0)
else
@index = i0

View file

@ -92,8 +92,8 @@ class Treetop::Runtime::SyntaxNode
tv = "...#{tv[-20..-1]}" if tv.size > 20
indent +
self.class.to_s.sub(/.*:/,'') +
em.map{|m| "+"+m.to_s.sub(/.*:/,'')}*"" +
self.class.to_s.sub(/.*:/, '') +
em.map{|m| "+"+m.to_s.sub(/.*:/, '')}*"" +
" offset=#{interval.first}" +
", #{tv.inspect}" +
im +

View file

@ -560,8 +560,8 @@ class Treetop::Runtime::SyntaxNode
tv = "...#{tv[-20..-1]}" if tv.size > 20
indent +
self.class.to_s.sub(/.*:/,'') +
em.map{|m| "+"+m.to_s.sub(/.*:/,'')}*"" +
self.class.to_s.sub(/.*:/, '') +
em.map{|m| "+"+m.to_s.sub(/.*:/, '')}*"" +
" offset=#{interval.first}" +
", #{tv.inspect}" +
im +

View file

@ -70,7 +70,7 @@ module LogStashConfig
s5 << r7
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(Config0)
else
@index = i5
@ -82,7 +82,7 @@ module LogStashConfig
break
end
end
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
r4 = instantiate_node(SyntaxNode, input, i4...index, s4)
s0 << r4
if r4
r8 = _nt_cs
@ -92,7 +92,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Config,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Config, input, i0...index, s0)
r0.extend(Config1)
else
@index = i0
@ -125,7 +125,7 @@ module LogStashConfig
if r3
r2 = r3
else
r2 = instantiate_node(SyntaxNode,input, index...index)
r2 = instantiate_node(SyntaxNode, input, index...index)
end
s1 << r2
if r2
@ -153,7 +153,7 @@ module LogStashConfig
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s1 << r5
if r5
if (match_len = has_terminal?("\r", false, index))
@ -166,7 +166,7 @@ module LogStashConfig
if r8
r7 = r8
else
r7 = instantiate_node(SyntaxNode,input, index...index)
r7 = instantiate_node(SyntaxNode, input, index...index)
end
s1 << r7
if r7
@ -183,7 +183,7 @@ module LogStashConfig
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Comment0)
else
@index = i1
@ -199,7 +199,7 @@ module LogStashConfig
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Config::AST::Comment,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Comment, input, i0...index, s0)
end
node_cache[:comment][start_index] = r0
@ -241,7 +241,7 @@ module LogStashConfig
break
end
end
r0 = instantiate_node(LogStash::Config::AST::Whitespace,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Whitespace, input, i0...index, s0)
node_cache[:cs][start_index] = r0
@ -278,7 +278,7 @@ module LogStashConfig
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Config::AST::Whitespace,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Whitespace, input, i0...index, s0)
end
node_cache[:whitespace][start_index] = r0
@ -351,7 +351,7 @@ module LogStashConfig
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(PluginSection0)
else
@index = i6
@ -363,7 +363,7 @@ module LogStashConfig
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s0 << r5
if r5
if (match_len = has_terminal?("}", false, index))
@ -380,7 +380,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::PluginSection,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::PluginSection, input, i0...index, s0)
r0.extend(PluginSection1)
else
@index = i0
@ -437,7 +437,7 @@ module LogStashConfig
i0 = index
if (match_len = has_terminal?("input", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"input"')
@ -448,7 +448,7 @@ module LogStashConfig
r0 = r1
else
if (match_len = has_terminal?("filter", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"filter"')
@ -459,7 +459,7 @@ module LogStashConfig
r0 = r2
else
if (match_len = has_terminal?("output", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"output"')
@ -522,7 +522,7 @@ module LogStashConfig
s4 << r6
end
if s4.last
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
r4 = instantiate_node(SyntaxNode, input, i4...index, s4)
r4.extend(Plugins0)
else
@index = i4
@ -534,11 +534,11 @@ module LogStashConfig
break
end
end
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
s1 << r3
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Plugins1)
else
@index = i1
@ -547,7 +547,7 @@ module LogStashConfig
if r1
r0 = r1
else
r0 = instantiate_node(SyntaxNode,input, index...index)
r0 = instantiate_node(SyntaxNode, input, index...index)
end
node_cache[:plugins][start_index] = r0
@ -647,7 +647,7 @@ module LogStashConfig
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(Plugin0)
else
@index = i9
@ -659,11 +659,11 @@ module LogStashConfig
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Plugin1)
else
@index = i6
@ -672,7 +672,7 @@ module LogStashConfig
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
if r5
@ -694,7 +694,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Plugin,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Plugin, input, i0...index, s0)
r0.extend(Plugin2)
else
@index = i0
@ -737,7 +737,7 @@ module LogStashConfig
@index = i1
r1 = nil
else
r1 = instantiate_node(LogStash::Config::AST::Name,input, i1...index, s1)
r1 = instantiate_node(LogStash::Config::AST::Name, input, i1...index, s1)
end
if r1
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
@ -795,7 +795,7 @@ module LogStashConfig
s0 << r2
if r2
if (match_len = has_terminal?("=>", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=>"')
@ -813,7 +813,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Attribute,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Attribute, input, i0...index, s0)
r0.extend(Attribute0)
else
@index = i0
@ -974,12 +974,12 @@ module LogStashConfig
@index = i2
r2 = nil
else
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
end
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Bareword,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Bareword, input, i0...index, s0)
r0.extend(Bareword0)
else
@index = i0
@ -1022,7 +1022,7 @@ module LogStashConfig
loop do
i3 = index
if (match_len = has_terminal?('\"', false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('\'\\"\'')
@ -1048,7 +1048,7 @@ module LogStashConfig
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1062,7 +1062,7 @@ module LogStashConfig
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(DoubleQuotedString0)
else
@index = i5
@ -1082,7 +1082,7 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?('"', false, index))
@ -1096,7 +1096,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::String,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::String, input, i0...index, s0)
r0.extend(DoubleQuotedString1)
else
@index = i0
@ -1139,7 +1139,7 @@ module LogStashConfig
loop do
i3 = index
if (match_len = has_terminal?("\\'", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"\\\\\'"')
@ -1165,7 +1165,7 @@ module LogStashConfig
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1179,7 +1179,7 @@ module LogStashConfig
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(SingleQuotedString0)
else
@index = i5
@ -1199,7 +1199,7 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?("'", false, index))
@ -1213,7 +1213,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::String,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::String, input, i0...index, s0)
r0.extend(SingleQuotedString1)
else
@index = i0
@ -1288,7 +1288,7 @@ module LogStashConfig
loop do
i3 = index
if (match_len = has_terminal?('\/', false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('\'\\/\'')
@ -1314,7 +1314,7 @@ module LogStashConfig
else
@terminal_failures.pop
@index = i6
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s5 << r6
if r6
@ -1328,7 +1328,7 @@ module LogStashConfig
s5 << r8
end
if s5.last
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
r5.extend(Regexp0)
else
@index = i5
@ -1348,7 +1348,7 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
if (match_len = has_terminal?('/', false, index))
@ -1362,7 +1362,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::RegExp,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::RegExp, input, i0...index, s0)
r0.extend(Regexp1)
else
@index = i0
@ -1402,7 +1402,7 @@ module LogStashConfig
if r2
r1 = r2
else
r1 = instantiate_node(SyntaxNode,input, index...index)
r1 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r1
if r1
@ -1425,7 +1425,7 @@ module LogStashConfig
@index = i3
r3 = nil
else
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
end
s0 << r3
if r3
@ -1454,11 +1454,11 @@ module LogStashConfig
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Number0)
else
@index = i6
@ -1467,13 +1467,13 @@ module LogStashConfig
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Number,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Number, input, i0...index, s0)
r0.extend(Number1)
else
@index = i0
@ -1569,7 +1569,7 @@ module LogStashConfig
end
end
if s7.last
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
r7.extend(Array0)
else
@index = i7
@ -1581,11 +1581,11 @@ module LogStashConfig
break
end
end
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
s4 << r6
end
if s4.last
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
r4 = instantiate_node(SyntaxNode, input, i4...index, s4)
r4.extend(Array1)
else
@index = i4
@ -1594,7 +1594,7 @@ module LogStashConfig
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
r3 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r3
if r3
@ -1614,7 +1614,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Array,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Array, input, i0...index, s0)
r0.extend(Array2)
else
@index = i0
@ -1665,7 +1665,7 @@ module LogStashConfig
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
r3 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r3
if r3
@ -1685,7 +1685,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Hash,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Hash, input, i0...index, s0)
r0.extend(Hash0)
else
@index = i0
@ -1739,7 +1739,7 @@ module LogStashConfig
s3 << r5
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Hashentries0)
else
@index = i3
@ -1751,11 +1751,11 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::HashEntries,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::HashEntries, input, i0...index, s0)
r0.extend(Hashentries1)
else
@index = i0
@ -1824,7 +1824,7 @@ module LogStashConfig
s0 << r5
if r5
if (match_len = has_terminal?("=>", false, index))
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r6 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=>"')
@ -1842,7 +1842,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::HashEntry,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::HashEntry, input, i0...index, s0)
r0.extend(Hashentry0)
else
@index = i0
@ -1906,7 +1906,7 @@ module LogStashConfig
s3 << r5
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Branch0)
else
@index = i3
@ -1918,7 +1918,7 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
if r2
i7, s7 = index, []
@ -1929,7 +1929,7 @@ module LogStashConfig
s7 << r9
end
if s7.last
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
r7.extend(Branch1)
else
@index = i7
@ -1938,13 +1938,13 @@ module LogStashConfig
if r7
r6 = r7
else
r6 = instantiate_node(SyntaxNode,input, index...index)
r6 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r6
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Branch,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Branch, input, i0...index, s0)
r0.extend(Branch2)
else
@index = i0
@ -1998,7 +1998,7 @@ module LogStashConfig
i0, s0 = index, []
if (match_len = has_terminal?("if", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"if"')
@ -2037,7 +2037,7 @@ module LogStashConfig
s8 << r10
end
if s8.last
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
r8.extend(If0)
else
@index = i8
@ -2049,7 +2049,7 @@ module LogStashConfig
break
end
end
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
r7 = instantiate_node(SyntaxNode, input, i7...index, s7)
s0 << r7
if r7
if (match_len = has_terminal?("}", false, index))
@ -2068,7 +2068,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::If,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::If, input, i0...index, s0)
r0.extend(If1)
else
@index = i0
@ -2126,7 +2126,7 @@ module LogStashConfig
i0, s0 = index, []
if (match_len = has_terminal?("else", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"else"')
@ -2138,7 +2138,7 @@ module LogStashConfig
s0 << r2
if r2
if (match_len = has_terminal?("if", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"if"')
@ -2177,7 +2177,7 @@ module LogStashConfig
s10 << r12
end
if s10.last
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
r10 = instantiate_node(SyntaxNode, input, i10...index, s10)
r10.extend(ElseIf0)
else
@index = i10
@ -2189,7 +2189,7 @@ module LogStashConfig
break
end
end
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
s0 << r9
if r9
if (match_len = has_terminal?("}", false, index))
@ -2210,7 +2210,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Elsif,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Elsif, input, i0...index, s0)
r0.extend(ElseIf1)
else
@index = i0
@ -2256,7 +2256,7 @@ module LogStashConfig
i0, s0 = index, []
if (match_len = has_terminal?("else", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"else"')
@ -2289,7 +2289,7 @@ module LogStashConfig
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(Else0)
else
@index = i6
@ -2301,7 +2301,7 @@ module LogStashConfig
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
r5 = instantiate_node(SyntaxNode, input, i5...index, s5)
s0 << r5
if r5
if (match_len = has_terminal?("}", false, index))
@ -2318,7 +2318,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Else,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Else, input, i0...index, s0)
r0.extend(Else1)
else
@index = i0
@ -2388,7 +2388,7 @@ module LogStashConfig
end
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3 = instantiate_node(SyntaxNode, input, i3...index, s3)
r3.extend(Condition0)
else
@index = i3
@ -2400,11 +2400,11 @@ module LogStashConfig
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
s0 << r2
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::Condition,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Condition, input, i0...index, s0)
r0.extend(Condition1)
else
@index = i0
@ -2475,7 +2475,7 @@ module LogStashConfig
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(Expression0)
else
@index = i1
@ -2624,7 +2624,7 @@ module LogStashConfig
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1 = instantiate_node(SyntaxNode, input, i1...index, s1)
r1.extend(NegativeExpression0)
else
@index = i1
@ -2653,7 +2653,7 @@ module LogStashConfig
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(NegativeExpression1)
else
@index = i9
@ -2727,7 +2727,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::InExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::InExpression, input, i0...index, s0)
r0.extend(InExpression0)
else
@index = i0
@ -2792,7 +2792,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::NotInExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::NotInExpression, input, i0...index, s0)
r0.extend(NotInExpression0)
else
@index = i0
@ -2816,7 +2816,7 @@ module LogStashConfig
end
if (match_len = has_terminal?("in", false, index))
r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r0 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"in"')
@ -2848,7 +2848,7 @@ module LogStashConfig
i0, s0 = index, []
if (match_len = has_terminal?("not ", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"not "')
@ -2860,7 +2860,7 @@ module LogStashConfig
s0 << r2
if r2
if (match_len = has_terminal?("in", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"in"')
@ -2870,7 +2870,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0 = instantiate_node(SyntaxNode, input, i0...index, s0)
r0.extend(NotInOperator0)
else
@index = i0
@ -3036,7 +3036,7 @@ module LogStashConfig
end
end
if s9.last
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
r9 = instantiate_node(SyntaxNode, input, i9...index, s9)
r9.extend(MethodCall0)
else
@index = i9
@ -3048,11 +3048,11 @@ module LogStashConfig
break
end
end
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8 = instantiate_node(SyntaxNode, input, i8...index, s8)
s6 << r8
end
if s6.last
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
r6 = instantiate_node(SyntaxNode, input, i6...index, s6)
r6.extend(MethodCall1)
else
@index = i6
@ -3061,7 +3061,7 @@ module LogStashConfig
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
r5 = instantiate_node(SyntaxNode, input, index...index)
end
s0 << r5
if r5
@ -3083,7 +3083,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::MethodCall,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::MethodCall, input, i0...index, s0)
r0.extend(MethodCall2)
else
@index = i0
@ -3166,7 +3166,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::ComparisonExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::ComparisonExpression, input, i0...index, s0)
r0.extend(CompareExpression0)
else
@index = i0
@ -3191,7 +3191,7 @@ module LogStashConfig
i0 = index
if (match_len = has_terminal?("==", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=="')
@ -3203,7 +3203,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::ComparisonOperator)
else
if (match_len = has_terminal?("!=", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"!="')
@ -3215,7 +3215,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::ComparisonOperator)
else
if (match_len = has_terminal?("<=", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"<="')
@ -3227,7 +3227,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::ComparisonOperator)
else
if (match_len = has_terminal?(">=", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('">="')
@ -3340,7 +3340,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::RegexpExpression,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::RegexpExpression, input, i0...index, s0)
r0.extend(RegexpExpression0)
else
@index = i0
@ -3365,7 +3365,7 @@ module LogStashConfig
i0 = index
if (match_len = has_terminal?("=~", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"=~"')
@ -3377,7 +3377,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::RegExpOperator)
else
if (match_len = has_terminal?("!~", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"!~"')
@ -3411,7 +3411,7 @@ module LogStashConfig
i0 = index
if (match_len = has_terminal?("and", false, index))
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r1 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"and"')
@ -3423,7 +3423,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::BooleanOperator)
else
if (match_len = has_terminal?("or", false, index))
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r2 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"or"')
@ -3435,7 +3435,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::BooleanOperator)
else
if (match_len = has_terminal?("xor", false, index))
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r3 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"xor"')
@ -3447,7 +3447,7 @@ module LogStashConfig
r0.extend(LogStash::Config::AST::BooleanOperator)
else
if (match_len = has_terminal?("nand", false, index))
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
r4 = instantiate_node(SyntaxNode, input, index...(index + match_len))
@index += match_len
else
terminal_parse_failure('"nand"')
@ -3494,7 +3494,7 @@ module LogStashConfig
@index = i0
r0 = nil
else
r0 = instantiate_node(LogStash::Config::AST::Selector,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::Selector, input, i0...index, s0)
end
node_cache[:selector][start_index] = r0
@ -3545,7 +3545,7 @@ module LogStashConfig
@index = i2
r2 = nil
else
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
r2 = instantiate_node(SyntaxNode, input, i2...index, s2)
end
s0 << r2
if r2
@ -3560,7 +3560,7 @@ module LogStashConfig
end
end
if s0.last
r0 = instantiate_node(LogStash::Config::AST::SelectorElement,input, i0...index, s0)
r0 = instantiate_node(LogStash::Config::AST::SelectorElement, input, i0...index, s0)
r0.extend(SelectorElement0)
else
@index = i0

View file

@ -235,7 +235,7 @@ module LogStash::Config::Mixin
# add any options from this class
prefix = self.name.split("::").last.downcase
@flags.each do |flag|
flagpart = flag[:args].first.gsub(/^--/,"")
flagpart = flag[:args].first.gsub(/^--/, "")
# TODO(sissel): logger things here could help debugging.
opts.on("--#{prefix}-#{flagpart}", *flag[:args][1..-1], &flag[:block])
@ -595,7 +595,7 @@ module LogStash::Config::Mixin
return [false, "Expected a hex-encoded SHA-256 fingerprint, got `#{candidate.inspect}`"] unless candidate.kind_of?(String) && candidate =~ /\A(?:[[:xdigit:]]{2}:?){32}\z/
return [true, candidate.upcase.tr('^0-9A-F','')]
return [true, candidate.upcase.tr('^0-9A-F', '')]
else
return false, "Unknown validator symbol #{validator}"
end # case validator

View file

@ -55,7 +55,7 @@ module LogStash module Config
end
if module_names.length > module_names.uniq.length
duplicate_modules = module_names.group_by(&:to_s).select { |_,v| v.size > 1 }.keys
duplicate_modules = module_names.group_by(&:to_s).select { |_, v| v.size > 1 }.keys
raise LogStash::ConfigLoadingError, I18n.t("logstash.modules.configuration.modules-must-be-unique", :duplicate_modules => duplicate_modules)
end

View file

@ -71,16 +71,16 @@ module LogStash; module Config;
def self.format_pipeline_vertex_section_stats(stats, pipeline)
return nil unless stats
(stats || {}).reduce([]) do |acc,kv|
(stats || {}).reduce([]) do |acc, kv|
plugin_id, plugin_stats = kv
props = Hash.new {|h,k| h[k] = []}
props = Hash.new {|h, k| h[k] = []}
next unless plugin_stats
flattened = flatten_metrics(plugin_stats)
segmented = flattened.reduce(Hash.new {|h,k| h[k] = []}) do |acc,kv|
k,v = kv
segmented = flattened.reduce(Hash.new {|h, k| h[k] = []}) do |acc, kv|
k, v = kv
metric_value = v.value
root_metric_field = ROOT_METRIC_MAPPINGS[k]
@ -124,8 +124,8 @@ module LogStash; module Config;
def self.flatten_metrics(hash_or_value, namespaces = [])
if hash_or_value.is_a?(Hash)
return hash_or_value.reduce({}) do |acc,kv|
k,v = kv
return hash_or_value.reduce({}) do |acc, kv|
k, v = kv
# We must concat the arrays, creating a copy instead of mutation
# to handle the case where there are multiple sibling metrics in a namespace
new_namespaces = namespaces.clone

View file

@ -31,7 +31,7 @@ class LogStash::DependencyReport < Clamp::Command
OTHER_DEPENDENCIES = [
["jruby", "", "http://jruby.org", "EPL-2.0"],
["Red Hat Universal Base Image minimal","8","https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8","Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf","","https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/8/ubi-minimal-8-source.tar.gz"]
["Red Hat Universal Base Image minimal", "8", "https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8", "Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf", "", "https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/8/ubi-minimal-8-source.tar.gz"]
]
def execute
@ -40,7 +40,7 @@ class LogStash::DependencyReport < Clamp::Command
tmp_dir = java.lang.System.getProperty("java.io.tmpdir")
ruby_output_path = File.join(tmp_dir, SecureRandom.uuid)
# Write a CSV with just the ruby stuff
CSV.open(ruby_output_path, "wb", :headers => [ "name", "version", "url", "license","copyright","sourceURL" ], :write_headers => true) do |csv|
CSV.open(ruby_output_path, "wb", :headers => [ "name", "version", "url", "license", "copyright", "sourceURL" ], :write_headers => true) do |csv|
puts "Finding gem dependencies"
gems.each { |d| csv << d }
puts "Finding gem embedded java/jar dependencies"
@ -108,7 +108,7 @@ class LogStash::DependencyReport < Clamp::Command
# convert manifest attributes to a map w/ keys .to_s
# without this, the attribute keys will be `Object#inspect` values
# like #<Java::JavaUtilJar::Attributes::Name0xabcdef0>
attributes = Hash[manifest.getMainAttributes.map { |k,v| [k.to_s, v] }]
attributes = Hash[manifest.getMainAttributes.map { |k, v| [k.to_s, v] }]
begin
# Prefer the maven/pom groupId when it is available.
@ -154,10 +154,10 @@ class LogStash::DependencyReport < Clamp::Command
}
# Get a map of name => spdx
MAP_APACHE2 = Hash[ALIASES.map { |spdx,aliases| aliases.map { |value| [value, spdx] } }[0]]
MAP_ARTISTIC2 = Hash[ALIASES.map { |spdx,aliases| aliases.map { |value| [value, spdx] } }[1]]
MAP_BSD = Hash[ALIASES.map { |spdx,aliases| aliases.map { |value| [value, spdx] } }[2]]
MAP_GPL2 = Hash[ALIASES.map { |spdx,aliases| aliases.map { |value| [value, spdx] } }[3]]
MAP_APACHE2 = Hash[ALIASES.map { |spdx, aliases| aliases.map { |value| [value, spdx] } }[0]]
MAP_ARTISTIC2 = Hash[ALIASES.map { |spdx, aliases| aliases.map { |value| [value, spdx] } }[1]]
MAP_BSD = Hash[ALIASES.map { |spdx, aliases| aliases.map { |value| [value, spdx] } }[2]]
MAP_GPL2 = Hash[ALIASES.map { |spdx, aliases| aliases.map { |value| [value, spdx] } }[3]]
module_function
def map(value)

View file

@ -44,7 +44,7 @@ module LogStash
Setting.new("modules_list", Array, []),
Setting.new("modules_variable_list", Array, []),
Setting::Modules.new("cloud.id", LogStash::Util::CloudSettingId),
Setting::Modules.new("cloud.auth",LogStash::Util::CloudSettingAuth),
Setting::Modules.new("cloud.auth", LogStash::Util::CloudSettingAuth),
Setting::Boolean.new("modules_setup", false),
Setting::Boolean.new("config.test_and_exit", false),
Setting::Boolean.new("config.reload.automatic", false),

View file

@ -195,7 +195,7 @@ class LogStash::Filters::Base < LogStash::Plugin
# matches the filter's conditions (right type, etc)
protected
def filter_matched(event)
LogStash::Util::Decorators.add_fields(@add_field,event,"filters/#{self.class.name}")
LogStash::Util::Decorators.add_fields(@add_field, event, "filters/#{self.class.name}")
@remove_field.each do |field|
field = event.sprintf(field)
@ -204,7 +204,7 @@ class LogStash::Filters::Base < LogStash::Plugin
event.remove(field)
end
LogStash::Util::Decorators.add_tags(@add_tag,event,"filters/#{self.class.name}")
LogStash::Util::Decorators.add_tags(@add_tag, event, "filters/#{self.class.name}")
# note below that the tags array field needs to be updated then reassigned to the event.
# this is important because a construct like event["tags"].delete(tag) will not work

View file

@ -137,8 +137,8 @@ class LogStash::Inputs::Base < LogStash::Plugin
# Only set 'type' if not already set. This is backwards-compatible behavior
event.set("type", @type) if @type && !event.include?("type")
LogStash::Util::Decorators.add_fields(@add_field,event,"inputs/#{self.class.name}")
LogStash::Util::Decorators.add_tags(@tags,event,"inputs/#{self.class.name}")
LogStash::Util::Decorators.add_fields(@add_field, event, "inputs/#{self.class.name}")
LogStash::Util::Decorators.add_tags(@tags, event, "inputs/#{self.class.name}")
end
protected

View file

@ -156,7 +156,7 @@ module LogStash module Instrument
# }
# }
def extract_metrics(path, *keys)
keys.reduce({}) do |acc,k|
keys.reduce({}) do |acc, k|
# Simplify 1-length keys
k = k.first if k.is_a?(Array) && k.size == 1
@ -175,7 +175,7 @@ module LogStash module Instrument
# If there already is a hash at this location use that so we don't overwrite it
np_hash = acc[next_path] || {}
acc[next_path] = next_keys.reduce(np_hash) do |a,next_key|
acc[next_path] = next_keys.reduce(np_hash) do |a, next_key|
a.merge! extract_metrics(path + [next_path], [next_key, *rest])
end
end

View file

@ -151,14 +151,14 @@ module LogStash module Instrument module PeriodicPoller
def collect_non_heap_metrics(data)
non_heap = aggregate_information_for(data["non_heap"].values)
non_heap.each_pair do |key, value|
metric.gauge([:jvm, :memory, :non_heap],key, value.to_i)
metric.gauge([:jvm, :memory, :non_heap], key, value.to_i)
end
end
def collect_pools_metrics(data)
metrics = build_pools_metrics(data)
metrics.each_pair do |key, hash|
hash.each_pair do |p,v|
hash.each_pair do |p, v|
metric.gauge([:jvm, :memory, :pools, key.to_sym], p, v)
end
end
@ -186,9 +186,9 @@ module LogStash module Instrument module PeriodicPoller
end
def aggregate_information_for(collection)
collection.reduce(default_information_accumulator) do |m,e|
collection.reduce(default_information_accumulator) do |m, e|
e = { e[0] => e[1] } if e.is_a?(Array)
e.each_pair do |k,v|
e.each_pair do |k, v|
if MEMORY_TRANSPOSE_MAP.include?(k)
transpose_key = MEMORY_TRANSPOSE_MAP[k]
m[transpose_key] += v

View file

@ -47,7 +47,7 @@ module LogStash module Modules class KibanaConfig
end
def index_pattern
[KibanaResource.new(@index_name, "index-pattern", dynamic("index-pattern"),nil, @pattern_name)]
[KibanaResource.new(@index_name, "index-pattern", dynamic("index-pattern"), nil, @pattern_name)]
end
def resources

View file

@ -35,8 +35,8 @@ module LogStash module Modules class LogStashConfig
name = "var.inputs"
values = get_setting(LogStash::Setting::SplittableStringArray.new(name, String, default))
aliases.each { |k,v| values << v if values.include?(k) }
aliases.invert.each { |k,v| values << v if values.include?(k) }
aliases.each { |k, v| values << v if values.include?(k) }
aliases.invert.each { |k, v| values << v if values.include?(k) }
values.flatten.uniq
end

View file

@ -292,7 +292,7 @@ module LogStash module Plugins
# @param name [String] plugin name
# @return [Boolean] true if klass is a valid plugin for name
def is_a_plugin?(klass, name)
(klass.class == Java::JavaLang::Class && klass.simple_name.downcase == name.gsub('_','')) ||
(klass.class == Java::JavaLang::Class && klass.simple_name.downcase == name.gsub('_', '')) ||
(klass.ancestors.include?(LogStash::Plugin) && klass.respond_to?(:config_name) &&
klass.config_name == name)
end

View file

@ -225,12 +225,12 @@ module LogStash
YAML.safe_load(IO.read(path)) || {}
end
def flatten_hash(h,f="",g={})
def flatten_hash(h, f="", g={})
return g.update({ f => h }) unless h.is_a? Hash
if f.empty?
h.each { |k,r| flatten_hash(r,k,g) }
h.each { |k, r| flatten_hash(r, k, g) }
else
h.each { |k,r| flatten_hash(r,"#{f}.#{k}",g) }
h.each { |k, r| flatten_hash(r, "#{f}.#{k}", g) }
end
g
end

View file

@ -204,7 +204,7 @@ module LogStash::Util
def self.deep_clone(o)
case o
when Hash
o.inject({}) {|h, (k,v)| h[k] = deep_clone(v); h }
o.inject({}) {|h, (k, v)| h[k] = deep_clone(v); h }
when Array
o.map {|v| deep_clone(v) }
when Integer, Symbol, IO, TrueClass, FalseClass, NilClass

View file

@ -26,7 +26,7 @@ module LogStash::Util
# fields is a hash of field => value
# where both `field` and `value` can use sprintf syntax.
def add_fields(fields,event, pluginname)
def add_fields(fields, event, pluginname)
fields.each do |field, value|
field = event.sprintf(field)
value = Array(value)

View file

@ -124,7 +124,7 @@ describe LogStash::WrappedAckedQueue, :stress_test => true do
queue.close
if output_strings.any?
output_strings << __memoized.reject{|k,v| reject_memo_keys.include?(k)}.inspect
output_strings << __memoized.reject{|k, v| reject_memo_keys.include?(k)}.inspect
end
expect(output_strings).to eq([])

View file

@ -61,7 +61,7 @@ describe LogStash::Codecs::Base do
describe "#{codec_class}" do
describe "multi_encode" do
it "should return an array of [event,data] tuples" do
expect(instance.multi_encode([event,event])).to eq([encoded_tuple, encoded_tuple])
expect(instance.multi_encode([event, event])).to eq([encoded_tuple, encoded_tuple])
end
end

View file

@ -223,8 +223,8 @@ describe LogStashConfigParser do
@code = @config.compile
eval(@code)
end
def plugin(*args);end
def line_to_source(*args);end
def plugin(*args); end
def line_to_source(*args); end
end
end
context "(filters)" do
@ -277,8 +277,8 @@ describe LogStashConfigParser do
@code = @config.compile
eval(@code)
end
def plugin(*args);end
def line_to_source(*args);end
def plugin(*args); end
def line_to_source(*args); end
end
end

View file

@ -38,7 +38,7 @@ describe LogStash::Config::Mixin do
it "should not log the password" do
expect(LogStash::Logging::Logger).to receive(:new).with(anything).and_return(double_logger)
expect(double_logger).to receive(:warn) do |arg1,arg2|
expect(double_logger).to receive(:warn) do |arg1, arg2|
message = 'You are using a deprecated config setting "old_opt" set in test_deprecated. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. this is old school If you have any questions about this, please visit the #logstash channel on freenode irc.'
expect(arg1).to eq(message)
expect(arg2[:plugin].to_s).to include('"password"=><password>')

View file

@ -23,8 +23,8 @@ describe LogStash::Environment do
context "when loading jars dependencies" do
let(:default_jars_location) { File.join("vendor", "jar-dependencies") }
let(:default_runtime_location) { File.join(default_jars_location,"runtime-jars","*.jar") }
let(:default_test_location) { File.join(default_jars_location,"test-jars","*.jar") }
let(:default_runtime_location) { File.join(default_jars_location, "runtime-jars", "*.jar") }
let(:default_test_location) { File.join(default_jars_location, "test-jars", "*.jar") }
it "find runtime jars in the default location" do
expect(subject).to receive(:find_jars).with(default_runtime_location).and_return([])
@ -38,7 +38,7 @@ describe LogStash::Environment do
context "when loading a jar file" do
let(:dummy_jar_file) { File.join(default_jars_location,"runtime-jars","elasticsearch.jar") }
let(:dummy_jar_file) { File.join(default_jars_location, "runtime-jars", "elasticsearch.jar") }
it "requires the jar files if there are jars to load" do
expect(subject).to receive(:find_jars).with(default_runtime_location).and_return([dummy_jar_file])

View file

@ -37,17 +37,17 @@ describe "LogStash::Inputs::Base#decorate" do
end
it "should add multiple tag" do
input = LogStash::Inputs::NOOP.new("tags" => ["value1","value2"])
input = LogStash::Inputs::NOOP.new("tags" => ["value1", "value2"])
evt = LogStash::Event.new({"type" => "noop"})
input.instance_eval {decorate(evt)}
expect(evt.get("tags")).to eq(["value1","value2"])
expect(evt.get("tags")).to eq(["value1", "value2"])
end
it "should allow duplicates tag" do
input = LogStash::Inputs::NOOP.new("tags" => ["value","value"])
input = LogStash::Inputs::NOOP.new("tags" => ["value", "value"])
evt = LogStash::Event.new({"type" => "noop"})
input.instance_eval {decorate(evt)}
expect(evt.get("tags")).to eq(["value","value"])
expect(evt.get("tags")).to eq(["value", "value"])
end
it "should add tag with sprintf" do
@ -75,7 +75,7 @@ describe "LogStash::Inputs::Base#decorate" do
input = LogStash::Inputs::NOOP.new("add_field" => {"field" => ["value1", "value2"], "field2" => "value"})
evt = LogStash::Event.new({"type" => "noop"})
input.instance_eval {decorate(evt)}
expect(evt.get("field")).to eq(["value1","value2"])
expect(evt.get("field")).to eq(["value1", "value2"])
expect(evt.get("field2")).to eq("value")
end

View file

@ -119,7 +119,7 @@ describe LogStash::Instrument::PeriodicPoller::JVM do
# Make looking up metric paths easy when given varargs of keys
# e.g. mval(:parent, :child)
def mval(*metric_path)
metric_path.reduce(jvm_metrics) {|acc,k| acc[k]}.value
metric_path.reduce(jvm_metrics) {|acc, k| acc[k]}.value
end
[

View file

@ -69,7 +69,7 @@ describe LogStash::Instrument::PeriodicPoller::Os do
end
def mval(*metric_path)
metric_path.reduce(os_metrics) {|acc,k| acc[k]}.value
metric_path.reduce(os_metrics) {|acc, k| acc[k]}.value
end
it "should have a value for #{[:cgroup, :cpuacc, :control_group]} that is a String" do

View file

@ -240,18 +240,18 @@ describe "Java integration" do
context "when compacting" do
context "#compact with nils" do
let(:initial_array) { [1,2,3,nil,nil,6] }
let(:initial_array) { [1, 2, 3, nil, nil, 6] }
it "should remove nil values from a copy" do
expect(subject.compact).to eq([1,2,3,6])
expect(subject).to eq([1,2,3,nil,nil,6])
expect(subject.compact).to eq([1, 2, 3, 6])
expect(subject).to eq([1, 2, 3, nil, nil, 6])
end
end
context "#compact! with nils" do
let(:initial_array) { [1,2,3,nil,nil,6] }
let(:initial_array) { [1, 2, 3, nil, nil, 6] }
it "should remove nil values" do
expect(subject.compact!).to eq([1,2,3,6])
expect(subject).to eq([1,2,3,6])
expect(subject.compact!).to eq([1, 2, 3, 6])
expect(subject).to eq([1, 2, 3, 6])
end
it "should return the original" do
@ -260,10 +260,10 @@ describe "Java integration" do
end
context "#compact! without nils" do
let(:initial_array) { [1,2,3,6] }
let(:initial_array) { [1, 2, 3, 6] }
it "should return nil" do
expect(subject.compact!).to be nil
expect(subject).to eq([1,2,3,6])
expect(subject).to eq([1, 2, 3, 6])
end
end
end

View file

@ -75,14 +75,14 @@ describe LogStash::Modules::CLIParser do
let(:expected_value) { "example" }
let(:unparsed) { expected_key + "=" + expected_value }
it "split it into a key value pair" do
expect(subject.get_kv(module_name,unparsed)).to eq([expected_key,expected_value])
expect(subject.get_kv(module_name, unparsed)).to eq([expected_key, expected_value])
end
end
context "when it receives an invalid string" do
let(:bad_example) { "var.fail" }
it "raise a LogStash::ConfigLoadingError exception" do
expect { subject.get_kv(module_name,bad_example) }.to raise_error LogStash::ConfigLoadingError
expect { subject.get_kv(module_name, bad_example) }.to raise_error LogStash::ConfigLoadingError
end
end
end
@ -91,7 +91,7 @@ describe LogStash::Modules::CLIParser do
context "when it receives a valid string" do
let(:expected) { "var.input.stdin.type=example" }
it "split the module name from the rest of the string" do
expect(subject.name_splitter(proto_mod_vars)).to eq([module_name,expected])
expect(subject.name_splitter(proto_mod_vars)).to eq([module_name, expected])
end
end

View file

@ -182,7 +182,7 @@ describe ::LogStash::Plugins::Builtin::Pipeline do
other_input.register
output.register
@input_threads = inputs_queues.map do |input_plugin,input_queue|
@input_threads = inputs_queues.map do |input_plugin, input_queue|
Thread.new do
input_plugin.run(input_queue)
end
@ -205,7 +205,7 @@ describe ::LogStash::Plugins::Builtin::Pipeline do
end
it "should send the message to both outputs" do
inputs_queues.each do |i,q|
inputs_queues.each do |i, q|
expect(q.pop(true).to_hash_with_metadata).to match(event.to_hash_with_metadata)
end
end

View file

@ -95,13 +95,13 @@ describe LogStash::Plugins::CATrustedFingerprintSupport do
context 'with multiple `ca_trusted_fingerprint` values' do
let(:options) { super().merge('ca_trusted_fingerprint' => input) }
context 'that are valid' do
let(:input) { ["1b:ad:1d:ea:"*8,'BEefCaB1'*8] }
let(:input) { ["1b:ad:1d:ea:"*8, 'BEefCaB1'*8] }
include_examples('normalizes fingerprints') do
let(:normalized) { ["1BAD1DEA"*8,"BEEFCAB1"*8] }
let(:normalized) { ["1BAD1DEA"*8, "BEEFCAB1"*8] }
end
end
context 'that is not valid' do
let(:input) { ["NOPE","1BAD1DEA"*8] }
let(:input) { ["NOPE", "1BAD1DEA"*8] }
include_examples('rejects bad input in the usual way')
end

View file

@ -307,7 +307,7 @@ describe LogStash::Runner do
end
context "when defined by the user" do
let(:args) { ["--api.http.port", port_argument,"-e", pipeline_string] }
let(:args) { ["--api.http.port", port_argument, "-e", pipeline_string] }
context "as a single-value string" do
let(:port_argument) { "10000" }
it "creates an Agent whose `api.http.port` is an appropriate single-element range" do

View file

@ -116,7 +116,7 @@ describe "LogStash::Util::JavaVersion" do
include_examples("version parsing", "a plain version", "1.3.0", 1, 3, 0, 0, nil)
include_examples("version parsing", "an update", "1.4.0_03", 1, 4, 0, 3, nil)
include_examples("version parsing", "a build", "1.4.0-beta", 1, 4, 0, 0,"beta")
include_examples("version parsing", "a build", "1.4.0-beta", 1, 4, 0, 0, "beta")
include_examples("version parsing", "an update+build", "1.4.0_03-beta", 1, 4, 0, 3, "beta")
end

View file

@ -43,7 +43,7 @@ shared_context "api setup" do |settings_overrides={}|
# @return [false] if the condition was NOT met
def block_until(limit_seconds, &condition)
deadline = Time.now + limit_seconds
loop.with_index do |_,try|
loop.with_index do |_, try|
break if Time.now >= deadline
return true if condition.call

View file

@ -67,15 +67,15 @@ def license_agreement_for_flavor(flavor)
end
def get_logstash_status(container)
make_request(container,'curl -s http://localhost:9600/')['status']
make_request(container, 'curl -s http://localhost:9600/')['status']
end
def get_node_info(container)
make_request(container,'curl -s http://localhost:9600/_node/')
make_request(container, 'curl -s http://localhost:9600/_node/')
end
def get_node_stats(container)
make_request(container,'curl -s http://localhost:9600/_node/stats')
make_request(container, 'curl -s http://localhost:9600/_node/stats')
end
def get_pipeline_setting(container, property, pipeline='main')

View file

@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
# Files
s.files = Dir['lib/**/*','spec/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
s.files = Dir['lib/**/*', 'spec/**/*', '*.gemspec', '*.md', 'CONTRIBUTORS', 'Gemfile', 'LICENSE', 'NOTICE.TXT']
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})

View file

@ -42,11 +42,11 @@ class TestSettings
if get("config").is_a?(Hash)
tmp = {}
get("config").each do |k, v|
tmp[k] = get("config")[k].gsub('\n','').split.join(" ")
tmp[k] = get("config")[k].gsub('\n', '').split.join(" ")
end
@test_settings["config"] = tmp
else
config_string = get("config").gsub('\n','').split.join(" ")
config_string = get("config").gsub('\n', '').split.join(" ")
@test_settings["config"] = config_string
end
end

View file

@ -145,7 +145,7 @@ describe "Test Dead Letter Queue" do
end
context 'using logstash.yml and separate config file' do
let(:generator_config_file) { config_to_temp_file(@fixture.config("root",{ :dlq_dir => dlq_dir })) }
let(:generator_config_file) { config_to_temp_file(@fixture.config("root", { :dlq_dir => dlq_dir })) }
before :each do
logstash_service.start_background_with_config_settings(generator_config_file, settings_dir)

View file

@ -91,7 +91,7 @@ describe "Support environment variable in condition" do
it "exits with error when env variable is undefined" do
test_env["LOGSTASH_KEYSTORE_PASS"] = logstash_keystore_password
logstash = @logstash.run_cmd(["bin/logstash","-e", "filter { if \"${NOT_EXIST}\" { mutate {add_tag => \"oh no\"} } }", "--path.settings", settings_dir], true, test_env)
logstash = @logstash.run_cmd(["bin/logstash", "-e", "filter { if \"${NOT_EXIST}\" { mutate {add_tag => \"oh no\"} } }", "--path.settings", settings_dir], true, test_env)
expect(logstash.stderr_and_stdout).to match(/Cannot evaluate `\$\{NOT_EXIST\}`/)
expect(logstash.exit_code).to be(1)
end

View file

@ -74,7 +74,7 @@ describe "Guard reserved tags field against incorrect use" do
it "should throw exception when assigning two illegal values" do
['rename', 'warn'].each do |mode|
logstash = @logstash.run_cmd(["bin/logstash","-e", @fixture.config('set_illegal_tags').gsub("\n", ""),
logstash = @logstash.run_cmd(["bin/logstash", "-e", @fixture.config('set_illegal_tags').gsub("\n", ""),
"--path.settings", settings_dir, "--event_api.tags.illegal", mode],
true, test_env)
expect(logstash.stderr_and_stdout).to match(/Ruby exception occurred/)

View file

@ -82,7 +82,7 @@ describe "Test that Logstash" do
it "won't show secret value when pipeline definition is wrong" do
test_env["LOGSTASH_KEYSTORE_PASS"] = logstash_keystore_passowrd
logstash = @logstash.run_cmd(["bin/logstash","-e", "input { http { user => test password => \"${tag1}\" port = \"3333\" }}", "--path.settings", settings_dir], true, test_env)
logstash = @logstash.run_cmd(["bin/logstash", "-e", "input { http { user => test password => \"${tag1}\" port = \"3333\" }}", "--path.settings", settings_dir], true, test_env)
expect(logstash.stderr_and_stdout).to match(/\[ERROR\]/)
expect(logstash.stderr_and_stdout).to match(/\\"\$\{tag1\}\\"/)
end

View file

@ -33,7 +33,7 @@ RSpec::Matchers.define :run_successfully_and_output do |expected_output|
end
end
RSpec::Matchers.define :have_installed? do |name,*args|
RSpec::Matchers.define :have_installed? do |name, *args|
match do |actual|
version = args.first
actual.plugin_installed?(name, version)

View file

@ -54,11 +54,11 @@ module LogStash
hosts, host = [], {}
lines.each do |line|
if line.match(/Host\s(.*)$/)
host = { :host => line.gsub("Host","").strip }
host = { :host => line.gsub("Host", "").strip }
elsif line.match(/HostName\s(.*)$/)
host[:hostname] = line.gsub("HostName","").strip
host[:hostname] = line.gsub("HostName", "").strip
elsif line.match(/Port\s(.*)$/)
host[:port] = line.gsub("Port","").strip
host[:port] = line.gsub("Port", "").strip
elsif line.empty?
hosts << host
host = {}

View file

@ -198,7 +198,7 @@ namespace "artifact" do
task "archives_oss" => ["prepare", "generate_build_metadata"] do
#with bundled JDKs
@bundles_jdk = true
license_details = ['APACHE-LICENSE-2.0',"-oss", oss_exclude_paths]
license_details = ['APACHE-LICENSE-2.0', "-oss", oss_exclude_paths]
create_archive_pack(license_details, "x86_64", "linux", "windows", "darwin")
create_archive_pack(license_details, "arm64", "linux", "darwin")
@ -496,7 +496,7 @@ namespace "artifact" do
tar.add_symlink(path_in_tar, File.readlink(path), stat.mode)
else
tar.add_file_simple(path_in_tar, stat.mode, stat.size) do |io|
File.open(path,'rb') do |fd|
File.open(path, 'rb') do |fd|
chunk = nil
size = 0
size += io.write(chunk) while chunk = fd.read(16384)

View file

@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
# Files
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION"]
s.files = Dir["lib/**/*", "spec/**/*", "*.gemspec", "*.md", "CONTRIBUTORS", "Gemfile", "LICENSE", "NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION"]
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})

View file

@ -28,7 +28,7 @@ end
module ResourceDSLMethods
# Convert a nested hash to a mapping of key paths to expected classes
def hash_to_mapping(h, path=[], mapping={})
h.each do |k,v|
h.each do |k, v|
if v.is_a?(Hash)
hash_to_mapping(v, path + [k], mapping)
else
@ -75,12 +75,12 @@ module ResourceDSLMethods
end
end
hash_to_mapping(expected).each do |resource_path,klass|
hash_to_mapping(expected).each do |resource_path, klass|
dotted = resource_path.join(".")
it "should set '#{dotted}' at '#{path}' to be a '#{klass}'" do
expect(last_response).to be_ok # fail early if need be
resource_path_value = resource_path.reduce(payload) do |acc,v|
resource_path_value = resource_path.reduce(payload) do |acc, v|
expect(acc).to be_a(Hash), "Got a nil looking for #{resource_path} in #{payload}"
expect(acc.has_key?(v)).to eql(true), "Expected to find value '#{v}' in structure '#{acc}', but could not. Payload was '#{payload}'"
acc[v]

View file

@ -119,7 +119,7 @@ describe LogStash::Bundler do
context 'with the cleaning option' do
it 'should add the --clean arguments' do
options.merge!(:clean => true)
expect(bundler_arguments).to include('install','--clean')
expect(bundler_arguments).to include('install', '--clean')
end
end
end

View file

@ -72,7 +72,7 @@ describe LogStash::PluginManager do
before(:each) do
allow(gemfile).to receive(:gemset).and_return(gemset)
allow(gemset).to receive(:sources).and_return(sources)
expect(fetcher).to receive(:spec_for_dependency).and_return([[],[]])
expect(fetcher).to receive(:spec_for_dependency).and_return([[], []])
end
it "should load all available sources" do

View file

@ -18,9 +18,9 @@
# This is needed because some of the plugins have weird declaration in their header files
# so I make sure the basic namespaces are correctly setup.
module LogStash
module Codecs;end
module Inputs;end
module Output;end
module Codecs; end
module Inputs; end
module Output; end
end
module LogStash module Docgen

View file

@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
# Files
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION"]
s.files = Dir["lib/**/*", "spec/**/*", "*.gemspec", "*.md", "CONTRIBUTORS", "Gemfile", "LICENSE", "NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION"]
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})

View file

@ -57,7 +57,7 @@ describe "Pack the dependencies", :integration => true do
downloaded_dependencies = Dir.glob(File.join(dependencies_path, "*.gem"))
expect(downloaded_dependencies.size).to eq(2)
expect(downloaded_dependencies).to include(/flores-0\.0\.6/,/stud/)
expect(downloaded_dependencies).to include(/flores-0\.0\.6/, /stud/)
expect(downloaded_dependencies).not_to include(/logstash-devutils/)
expect(File.read(Dir.glob(File.join(dependencies_path, "flores*.gem")).first)).to eq(dummy_checksum_content)
@ -81,7 +81,7 @@ describe "Pack the dependencies", :integration => true do
downloaded_dependencies = Dir.glob(File.join(dependencies_path, "*.gem"))
expect(downloaded_dependencies.size).to eq(2)
expect(downloaded_dependencies).to include(/flores-0\.0\.6/,/stud/)
expect(downloaded_dependencies).to include(/flores-0\.0\.6/, /stud/)
expect(downloaded_dependencies).not_to include(/logstash-devutils/)
expect(File.read(Dir.glob(File.join(dependencies_path, "flores*.gem")).first)).not_to eq(dummy_checksum_content)

View file

@ -14,7 +14,7 @@ module LogStash
lines = ["security_protocol => '#{security_protocol}'"]
lines.push("ssl_truststore_type => '#{bound_scope.setting("var.input.kafka.ssl_truststore_type", "")}'")
ssl_truststore_location = bound_scope.setting("var.input.kafka.ssl_truststore_location","")
ssl_truststore_location = bound_scope.setting("var.input.kafka.ssl_truststore_location", "")
lines.push("ssl_truststore_location => '#{ssl_truststore_location}'") unless ssl_truststore_location.empty?
["ssl_truststore_password", "ssl_keystore_password", "ssl_key_password"].each do |name|
@ -24,16 +24,16 @@ module LogStash
lines.push("ssl_keystore_type => '#{bound_scope.setting("var.input.kafka.ssl_keystore_type", "")}'")
ssl_keystore_location = bound_scope.setting("var.input.kafka.ssl_keystore_location","")
ssl_keystore_location = bound_scope.setting("var.input.kafka.ssl_keystore_location", "")
lines.push("ssl_keystore_location => '#{ssl_keystore_location}'") unless ssl_keystore_location.empty?
lines.push("sasl_mechanism => '#{bound_scope.setting("var.input.kafka.sasl_mechanism", "")}'")
lines.push("sasl_kerberos_service_name => '#{bound_scope.setting("var.input.kafka.sasl_kerberos_service_name", "")}'")
jaas_path = bound_scope.setting("var.input.kafka.jaas_path","")
jaas_path = bound_scope.setting("var.input.kafka.jaas_path", "")
lines.push("jaas_path => '#{jaas_path}'") unless jaas_path.empty?
kerberos_config = bound_scope.setting("var.input.kafka.kerberos_config","")
kerberos_config = bound_scope.setting("var.input.kafka.kerberos_config", "")
lines.push("kerberos_config => '#{kerberos_config}'") unless kerberos_config.empty?
lines.compact.join("\n ")
@ -47,10 +47,10 @@ module LogStash
verify_enabled = bound_scope.setting("var.input.tcp.ssl_verify", true)
lines.push("ssl_verify => #{verify_enabled}")
ssl_cert = bound_scope.setting("var.input.tcp.ssl_cert","")
ssl_cert = bound_scope.setting("var.input.tcp.ssl_cert", "")
lines.push("ssl_cert => '#{ssl_cert}'") unless ssl_cert.empty?
ssl_key = bound_scope.setting("var.input.tcp.ssl_key","")
ssl_key = bound_scope.setting("var.input.tcp.ssl_key", "")
lines.push("ssl_key => '#{ssl_key}'") unless ssl_key.empty?
lines.push("ssl_key_passphrase => '#{ bound_scope.setting("var.input.tcp.ssl_key_passphrase", "")}'")

View file

@ -221,9 +221,9 @@ describe LogStash::ConfigManagement::ElasticsearchSource do
describe "system indices api" do
let(:mock_client) { double("http_client") }
let(:config) { "input { generator { count => 100 } tcp { port => 6005 } } output { }}" }
let(:es_version_8_2) { { major:8, minor: 2} }
let(:es_version_8_3) { { major:8, minor: 3} }
let(:es_version_9_0) { { major:9, minor: 0} }
let(:es_version_8_2) { { major: 8, minor: 2} }
let(:es_version_8_3) { { major: 8, minor: 3} }
let(:es_version_9_0) { { major: 9, minor: 0} }
let(:pipeline_id) { "super_generator" }
let(:elasticsearch_response) { {"#{pipeline_id}"=> {"pipeline"=> "#{config}"}} }
let(:all_pipelines) { JSON.parse(::File.read(::File.join(::File.dirname(__FILE__), "fixtures", "pipelines.json"))) }
@ -272,13 +272,13 @@ describe LogStash::ConfigManagement::ElasticsearchSource do
it "should give unique pipeline with multiple wildcard patterns" do
expect(mock_client).to receive(:get).with("#{described_class::SYSTEM_INDICES_API_PATH}/").and_return(all_pipelines.clone)
expect(subject).to receive(:log_pipeline_not_found).with(["*pipeline*"]).exactly(1)
expect(subject.fetch_config(es_version_8_2, ["host1_pipeline*", "host2_pipeline*","*pipeline*"], mock_client).keys).to eq(["host1_pipeline1", "host1_pipeline2", "host2_pipeline1", "host2_pipeline2"])
expect(subject.fetch_config(es_version_8_2, ["host1_pipeline*", "host2_pipeline*", "*pipeline*"], mock_client).keys).to eq(["host1_pipeline1", "host1_pipeline2", "host2_pipeline1", "host2_pipeline2"])
end
it "should accept a mix of wildcard and non wildcard pattern" do
expect(mock_client).to receive(:get).with("#{described_class::SYSTEM_INDICES_API_PATH}/").and_return(all_pipelines.clone)
expect(mock_logger).to receive(:warn).never
expect(subject.fetch_config(es_version_8_2, ["host1_pipeline*", "host2_pipeline*","super_generator"], mock_client).keys).to eq(["super_generator", "host1_pipeline1", "host1_pipeline2", "host2_pipeline1", "host2_pipeline2"])
expect(subject.fetch_config(es_version_8_2, ["host1_pipeline*", "host2_pipeline*", "super_generator"], mock_client).keys).to eq(["super_generator", "host1_pipeline1", "host1_pipeline2", "host2_pipeline1", "host2_pipeline2"])
end
it "should log unmatched pattern" do
@ -715,15 +715,15 @@ describe LogStash::ConfigManagement::ElasticsearchSource do
describe "create pipeline fetcher by es version" do
it "should give SystemIndicesFetcher in [8]" do
expect(subject.get_pipeline_fetcher({ major:8, minor:2 })).to be_an_instance_of LogStash::ConfigManagement::SystemIndicesFetcher
expect(subject.get_pipeline_fetcher({ major: 8, minor: 2 })).to be_an_instance_of LogStash::ConfigManagement::SystemIndicesFetcher
end
it "should give SystemIndicesFetcher in [7.10]" do
expect(subject.get_pipeline_fetcher({ major:7, minor:10 })).to be_an_instance_of LogStash::ConfigManagement::SystemIndicesFetcher
expect(subject.get_pipeline_fetcher({ major: 7, minor: 10 })).to be_an_instance_of LogStash::ConfigManagement::SystemIndicesFetcher
end
it "should give LegacyHiddenIndicesFetcher in [7.9]" do
expect(subject.get_pipeline_fetcher({ major:7, minor:9 })).to be_an_instance_of LogStash::ConfigManagement::LegacyHiddenIndicesFetcher
expect(subject.get_pipeline_fetcher({ major: 7, minor: 9 })).to be_an_instance_of LogStash::ConfigManagement::LegacyHiddenIndicesFetcher
end
end

View file

@ -398,8 +398,8 @@ describe LogStash::Filters::Geoip do
eula_db_dirname = get_dir_path("foo")
FileUtils.mkdir_p(eula_db_dirname)
rewrite_temp_metadata(metadata_path, [ ["City","1620246514","","foo",true],
["ASN","1620246514","","foo",true]])
rewrite_temp_metadata(metadata_path, [ ["City", "1620246514", "", "foo", true],
["ASN", "1620246514", "", "foo", true]])
path = db_manager.subscribe_database_path(CITY, nil, mock_geoip_plugin)

View file

@ -123,7 +123,7 @@ describe LogStash::Filters::Geoip do
context "gz md5" do
it "should give the last gz md5" do
write_temp_metadata(temp_metadata_path, ["City","","SOME_GZ_MD5","SOME_MD5",second_dirname])
write_temp_metadata(temp_metadata_path, ["City", "", "SOME_GZ_MD5", "SOME_MD5", second_dirname])
expect(dbm.gz_md5(database_type)).to eq("SOME_GZ_MD5")
end
@ -134,7 +134,7 @@ describe LogStash::Filters::Geoip do
context "updated at" do
it "should give the last update timestamp" do
write_temp_metadata(temp_metadata_path, ["City","1611690807","SOME_GZ_MD5",second_dirname,true])
write_temp_metadata(temp_metadata_path, ["City", "1611690807", "SOME_GZ_MD5", second_dirname, true])
expect(dbm.check_at(database_type)).to eq(1611690807)
end
@ -199,8 +199,8 @@ describe LogStash::Filters::Geoip do
context "reset md5" do
it "should reset md5 to empty string only" do
rewrite_temp_metadata(temp_metadata_path, [ ["ASN","1620246514","SOME MD5","1620246514",true],
["City","1620246514","SOME MD5","1620246514",true] ])
rewrite_temp_metadata(temp_metadata_path, [ ["ASN", "1620246514", "SOME MD5", "1620246514", true],
["City", "1620246514", "SOME MD5", "1620246514", true] ])
dbm.reset_md5(database_type)
row = dbm.get_metadata(database_type).last
@ -213,7 +213,7 @@ describe LogStash::Filters::Geoip do
context "dirnames" do
it "should reset md5 to empty string only" do
write_temp_metadata(temp_metadata_path, city2_metadata)
rewrite_temp_metadata(temp_metadata_path, [ ["ASN","1620246514","SOME MD5","CC",true],
rewrite_temp_metadata(temp_metadata_path, [ ["ASN", "1620246514", "SOME MD5", "CC", true],
city2_metadata ])
dirnames = dbm.dirnames

View file

@ -75,8 +75,8 @@ module GeoipHelper
dirname = "CC"
metadata = []
metadata << ["ASN",now,"",dirname,false]
metadata << ["City",now,"",dirname,false]
metadata << ["ASN", now, "", dirname, false]
metadata << ["City", now, "", dirname, false]
metadata << row if row
FileUtils.mkdir_p(::File.dirname(temp_file_path))
@ -93,11 +93,11 @@ module GeoipHelper
end
def city2_metadata
["City",Time.now.to_i,"",second_dirname,true]
["City", Time.now.to_i, "", second_dirname, true]
end
def city_expired_metadata
["City","1220227200","","1220227200",true]
["City", "1220227200", "", "1220227200", true]
end
def copy_city_database(filename)

View file

@ -42,7 +42,7 @@ end
def with_environment(overrides)
replacement = ENV.to_hash
.merge(overrides)
.reject { |_,v| v.nil? }
.reject { |_, v| v.nil? }
with_environment!(replacement) { yield }
end