ruby, simple run length encoding