Module: Parsefiles::Parse
- Included in:
- FileOps
- Defined in:
- lib/parsefiles/parse.rb
Instance Method Summary collapse
-
#parse_gz ⇒ Object
Handles tar.gz and zip.
- #parse_log ⇒ Object (also: #parse_txt)
- #parse_zip ⇒ Object
Instance Method Details
#parse_gz ⇒ Object
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_log ⇒ Object 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_zip ⇒ Object
18 19 20 |
# File 'lib/parsefiles/parse.rb', line 18 def parse_zip #TODO end |