Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
module Kernel def __profile__(name, min=1) require 'ruby-prof' unless defined?(RubyProf) return_result = '' result = RubyProf.profile do 100.times{return_result = yield} end printer = RubyProf::GraphHtmlPrinter.new(result) path = File.join(MERB_ROOT, 'log', "#{name}.html") File.open(path, 'w') do |file| printer.print(file, {:min_percent => min, :print_file => true}) end return_result end end
This paste will be private.
From the Design Piracy series on my blog: