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
def sleep_until(time) time.times do break if block_given? && yield sleep(1) end end
Usage:
sleep_until(18){till_i_die}