vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/utils.rb
def prompt( promptString, failure_msg="Try again." ) # :yields: response
		promptString.chomp!
		response = nil

		begin
			response = readline( ansiCode('bold', 'green') +
				"#{promptString}: " + ansiCode('reset') ).strip
			if block_given? && ! yield( response ) 
				errorMessage( failure_msg + "\n\n" )
				response = nil
			end
		end until response

		return response
	end
### Output the specified <tt>promptString</tt> as a prompt (in green) and
### return the user's input with leading and trailing spaces removed.  If a
### test is provided, the prompt will repeat until the test returns true.
### An optional failure message can also be passed in.
Output the specified promptString as a prompt (in green) and
return the user's input with leading and trailing spaces removed.  If a
test is provided, the prompt will repeat until the test returns true.
An optional failure message can also be passed in.
Output the specified promptString as a prompt ( in green ) and return the user ' s input with leading and trailing spaces removed . If a test is provided the prompt will repeat until the test returns true . An optional failure message can also be passed in .
def prompt( promptString, failure_msg="Try again." ) 
		promptString.chomp!
		response = nil
		begin
			response = readline( ansiCode('bold', 'green') +
				"#{promptString}: " + ansiCode('reset') ).strip
			if block_given? && ! yield( response ) 
				errorMessage( failure_msg + "\n\n" )
				response = nil
			end
		end until response
		return response
	end
def prompt ( promptString , failure_msg = "Try again." ) promptString . chomp! response = nil begin response = readline ( ansiCode ( 'bold' , 'green' ) + "#{promptString}: " + ansiCode ( 'reset' ) ) . strip if block_given? && ! yield ( response ) errorMessage ( failure_msg + "\n\n" ) response = nil end end until response return response end
Output the specified <tt>promptString</tt> as a prompt (in green) and
return the user's input with leading and trailing spaces removed.
Output the specified <tt > promptString< / tt > as a prompt ( in green ) and return the user ' s input with leading and trailing spaces removed .
# :yields: response
promptString
failure_msg