Sure seems the only way to do this in Ruby is a filter type method then passing results to map. I’m not sure if this works in 1.8, but in 1.9 you could:
[0,1,2,1,0].take_while {|val| val < 2}.map(&:some_function)
Or in the times example
3.times.take_while {|count| count <= 1 } #=> [0,1]