Class: RubyMaat::Parsers::BaseParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_maat/parsers/base_parser.rb

Overview

Base class for all VCS parsers

Instance Method Summary collapse

Constructor Details

#initialize(log_file, options = {}) ⇒ BaseParser

Returns a new instance of BaseParser.



7
8
9
10
11
# File 'lib/ruby_maat/parsers/base_parser.rb', line 7

def initialize(log_file, options = {})
  @log_file = log_file
  @options = options
  @encoding = options[:input_encoding] || "UTF-8"
end

Instance Method Details

#parseObject



13
14
15
16
17
18
19
# File 'lib/ruby_maat/parsers/base_parser.rb', line 13

def parse
  validate_file_exists!
  content = read_log_file
  parse_content(content)
rescue => e
  handle_parse_error(e)
end