All pastes #382944 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-06 00:38 UTC
rendered paste body
def prompt(msg,error)
   while(1)
      print msg + " "
      str = gets.chomp
      if yield str then 
         return str
      else 
         print error + "\n"
      end
    end
end