Class: Webmeter::Parser
- Inherits:
-
Object
- Object
- Webmeter::Parser
- Defined in:
- lib/webmeter/parser.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
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
#parse ⇒ Object
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 |