Class/Module Index [+]

Quicksearch

Fluent::TextParser::MultilineParser

Constants

FORMAT_MAX_NUM

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/parser.rb, line 546
def configure(conf)
  super

  formats = parse_formats(conf).compact.map { |f| f[1..-2] }.join
  begin
    @regex = Regexp.new(formats, Regexp::MULTILINE)
    if @regex.named_captures.empty?
      raise "No named captures"
    end
    @parser = RegexpParser.new(@regex, conf)
  rescue => e
    raise ConfigError, "Invalid regexp '#{formats}': #{e}"
  end

  if @format_firstline
    check_format_regexp(@format_firstline, 'format_firstline')
    @firstline_regex = Regexp.new(@format_firstline[1..-2])
  end
end
firstline?(text) click to toggle source
# File lib/fluent/parser.rb, line 578
def firstline?(text)
  @firstline_regex.match(text)
end
has_firstline?() click to toggle source
# File lib/fluent/parser.rb, line 574
def has_firstline?
  !!@format_firstline
end
parse(text, &block) click to toggle source
# File lib/fluent/parser.rb, line 566
def parse(text, &block)
  if block
    @parser.call(text, &block)
  else
    @parser.call(text)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.