ruhoh/ruhoh.rb — pull request #145 by amanking (2013-03-23 19:11:59+00:00)
Title: Fix for with_index call on Array

I am using ruby 2.0.0p0 (2013-02-24 revision 39474).

ruhoh breaks when rendering summary of a post. Example error:
lib/ruhoh/resources/_page/model_view.rb:67:in `summary': undefined method `with_index' for ["Hi\n", "How are you?"]:Array (NoMethodError)

Perhaps this does not occur on Ruby 1.9.2+ However, in Ruby 2.0, there have been some changes with respect to return types being Array or Enumerator. http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/

This could have caused this defect. Calling to_enum before using with_index solves the issue. This should also work when the object is already an enumerator.