Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def self.new if block_given? env = MethodContext.current.block else # Support for ancient pre-block-pass style: # def something; Proc.new; end # something { a_block } => Proc instance env = MethodContext.current.sender.block end if env return from_environment(env) else raise ArgumentError, "tried to create a Proc object without a block" end end
This paste will be private.
From the Design Piracy series on my blog: