Class: Webmeter::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/webmeter/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Parser

Returns a new instance of Parser.



3
4
5
# File 'lib/webmeter/parser.rb', line 3

def initialize(filename)
  @filename = filename
end

Instance Method Details

#parseObject



7
8
9
10
11
12
13
14
15
# File 'lib/webmeter/parser.rb', line 7

def parse
  file = File.new(@filename)
  matches = []
  file.each { |log|
    match = log.match(/GET (.*?) HTTP/)
    matches << match[1] if not match.nil?
  }
  matches.map(&:strip)
end