find the first gap in array of fixnum values

p [1,2,3,5,6,8,9,10].inject {|a, e| e == a.next ? e : (break a.next)}

will produce 4
-- 
Posted via http://www.ruby-forum.com/.