File: countlines.rb

Project: Invitation to Ruby

#!/usr/bin/env ruby

count = 0
while line = gets
  if line =~ /Ruby/
    count += 1
  end
end
puts "#{count} Ruby lines"


[ Index ][ Table of Contents ]
Generated by [ source2html ]