unix wc implemented in ruby