The `begin ... while` idiom is hard to read. I prefer (and the [ruby style guide](https://github.com/bbatsov/ruby-style-guide#syntax) agrees) `loop ... break`

```ruby
loop do
   ...
   break unless ...
end
```