Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class Array def flatten(levels=-1) levels>0?self.inject([]){|m,e|e===(Array)?e.flatten(levels-1).map{|x|m<<x}:m<<e;m}: levels==0?self:(e=self;e=e.flatten(1)until !e.any?{|x|x===Array};e) end end
This paste will be private.
From the Design Piracy series on my blog: