fix ruby word_wrap implementation