How to Read from stdin in Ruby Posted in Polyglotbits on 28 of Aug, 2015

Reading from stdin in ruby is as easy as calling STDIN.read

STDIN.read.split("\n").each do |a|
   puts a
end

This will just print out everything handed in.