Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def group_by groups = [] inject({}) do |grouped, element| index = yield(element) if group = grouped[index] group << element else group = [element] groups << [index, group] grouped[index] = group end grouped end groups end if RUBY_VERSION < '1.9'
This paste will be private.
From the Design Piracy series on my blog: