topazproject/topaz — pull request #338 by llimllib (2013-02-10 22:46:32+00:00)
Title: Improve range iteration (make string ranges work)

Ranges by default should iterate only using succ and <=>. This patch enables iteration on a string range. (i.e. `'(a'..'c').each {|x| puts x}` now puts `a\nb\nc`)

* Symbols get converted to strings and use string.upto, as per: https://github.com/ruby/ruby/blob/trunk/range.c#L755 . string.upto isn't yet implemented, so I've marked that test as xfail

* The base iteration case is implemented in mri here: https://github.com/ruby/ruby/blob/trunk/range.c#L265 and documented here: https://github.com/rubyspec/rubyspec/blob/master/core/range/each_spec.rb