ruby: tcp socket sample(input line must end with \n)