#!/usr/bin/env ruby count = 0 while line = gets if line =~ /Ruby/ count += 1 end end puts "#{count} Ruby lines"