Fix syntax for 'while' and 'until' in ruby