class Rake::FileList
def egrep(pattern)
a standard emac style file:linenumber:line message will be printed to
name, line number, and the matching line of text. If no block is given,
block is given, call the block on each matching line, passing the file
Grep each of the files in the filelist using the given pattern. If a
def egrep(pattern) each do |fn| open(fn) do |inf| count = 0 inf.each do |line| count += 1 if pattern.match(line) if block_given? yield fn, count, line else puts "#{fn}:#{count}:#{line}" end end end end end end