Class: IISAccessLogParser

Inherits:
Object
  • Object
show all
Defined in:
lib/iis-access-log-parser.rb

Defined Under Namespace

Classes: Entry

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ IISAccessLogParser

Returns a new instance of IISAccessLogParser.



44
45
46
47
48
49
# File 'lib/iis-access-log-parser.rb', line 44

def initialize(io)
	io.each_line do |line|
		next if line[0,1] == '#'
		yield Entry.from_string(line)
	end
end

Class Method Details

.from_file(log_file) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/iis-access-log-parser.rb', line 36

def self.from_file(log_file)
	File.open(log_file, 'r') do |io|
		self.new(io) do |entry|
			yield entry
		end
	end
end