class Utils::Grepper
def match_lines(file)
def match_lines(file) for line in file if m = @pattern.match(line) @skip_pattern and @skip_pattern =~ line and next line[m.begin(0)...m.end(0)] = black on_white m[0] @queue and @queue << line if @args['l'] @output << @filename elsif @args['L'] @output << "#{@filename}:#{file.lineno}" elsif @args['e'] @output << "#{@filename}:#{file.lineno}" break else @output << red("#{@filename}:#{file.lineno}") if @args['B'] or @args['C'] @output.concat @queue.data else @output << line end if @args['A'] or @args['C'] where = file.tell lineno = file.lineno @queue.max_size.times do file.eof? and break line = file.readline @queue << line @output << line end file.seek where file.lineno = lineno end end else @queue and @queue << line end end end