Using while and until in a single line code
i = 1 i = i * 2 until i > 1000 puts i
The value of i is doubled over and over until the result is over 1000, at which point the loop ends (1024 being 2 to the power of 10).