Module: Parsefiles::Parse

Included in:
FileOps
Defined in:
lib/parsefiles/parse.rb

Instance Method Summary collapse

Instance Method Details

#parse_gzObject

Handles tar.gz and zip



9
10
11
12
13
14
15
16
# File 'lib/parsefiles/parse.rb', line 9

def parse_gz
  File.open(file, "r") do |f|
    gz = Zlib::GzipReader.new(f)
    gz.each_line do |line|
      match_line(line.chomp)
    end
  end
end

#parse_logObject Also known as: parse_txt



22
23
24
25
26
27
28
# File 'lib/parsefiles/parse.rb', line 22

def parse_log
  File.open(@file, "r") do |open_file|
    open_file.each do |line|
      match_line(line.chomp)
    end
  end
end

#parse_zipObject



18
19
20
# File 'lib/parsefiles/parse.rb', line 18

def parse_zip
  #TODO
end