$ ruby -e 'favorites = []; while(input = gets and input != "\n") do favorites.push input.chomp end; p favorites'
x
y
z

["x", "y", "z"]