Iterating through dates.

Indirectly, someone was asking how to iterate through dates in Ruby. Here’s one way: (Date.today..Date.today + 10).each { |date| puts date } # 2007-06-05 # 2007-06-06 # … # 2007-06-14 # 2007-06-15 You can do the same thing with Time objects, but be aware it iterates over seconds, not days. (Time.now..Time.now + 10).each { |time| [...]