add a snippet of `while` for Ruby