def waiter(duration=2, max=240, logger=STDOUT, msg=nil, bells=0, &check)
      # TODO: Move to Drydock. [ed-why?]
      raise "The waiter needs a block!" unless check
      duration = 1 if duration < 1
      max = duration*2 if max < duration
      dot = '.'
      begin
        if msg && logger
          logger.print msg 
          logger.flush
        end
        Timeout::timeout(max) do
          while !check.call
            sleep duration
            logger.print dot if logger.respond_to?(:print)
            logger.flush if logger.respond_to?(:flush)
          end
        end
      rescue Timeout::Error => ex
        retry if Annoy.pose_question(" Keep waiting?\a ", /yes|y|ya|sure|you bet!/i, logger)
        return false
      end
      
      if msg && logger
        logger.puts
        logger.flush
      end
      
      Rudy::Utils.bell(bells, logger)
      true
    end
def waiter(duration=2, max=240, logger=STDOUT, msg=nil, bells=0, &check)
      # TODO: Move to Drydock. [ed-why?]
      raise "The waiter needs a block!" unless check
      duration = 1 if duration < 1
      max = duration*2 if max < duration
      dot = '.'
      begin
        if msg && logger
          logger.print msg 
          logger.flush
        end
        Timeout::timeout(max) do
          while !check.call
            sleep duration
            logger.print dot if logger.respond_to?(:print)
            logger.flush if logger.respond_to?(:flush)
          end
        end
      rescue Timeout::Error => ex
        retry if Annoy.pose_question(" Keep waiting?\a ", /yes|y|ya|sure|you bet!/i, logger)
        return false
      end
      
      if msg && logger
        logger.puts
        logger.flush
      end
      
      Rudy::Utils.bell(bells, logger)
      true
    end
Wait for something to happen.
 * +duration+ seconds to wait between tries (default: 2).
 * +max+ maximum time to wait (default: 240). Throws an exception when exceeded.
 * +logger+ IO object to print +dot+ to.
 * +msg+ the message to print before executing the block.
 * +bells+ number of terminal bells to ring. Set to nil or false to keep the waiter silent

 The +check+ block must return false while waiting. Once it returns true
 the waiter will return true too.