Ruby - Read text file character by character