Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
喜欢这个:
people = []
begin
info = gets.chomp
people += [Person.new(info)] if not info.empty?
end while not info.empty?
该begin <code> end while <condition>由Ruby的作者Matz的拒绝。相反,他建议使用Kernel#loop,例如
loop do
# some code here
break if <condition>
end