Is there any better way in Ruby to sleep until some condition is true ?
loop do sleep(1) if ready_to_go break end end
I like this form since it is simple and only uses sleep if needed after it tests for the done condition:
begin ready_to_go = do_some_action end until ready_to_go or not sleep 1