class Middleman::Profiling::RubyProfProfiler

A profiler that uses ruby-prof

def initialize

def initialize
  begin
    require 'ruby-prof'
  rescue LoadError
    raise "To use the --profile option, you must 'gem install ruby-prof' (and include it in your Gemfile if running under bundle exec)"
  end
end

def report(report_name)

def report(report_name)
  result = RubyProf.stop
  printer = RubyProf::GraphHtmlPrinter.new(result)
  outfile = File.join("profile", report_name)
  outfile = (outfile + '.html') unless outfile.end_with? '.html'
  FileUtils.mkdir_p(File.dirname(outfile))
  File.open(outfile, 'w') do |f|
    printer.print(f, :min_percent=> 1)
  end
end

def start

def start
  RubyProf.start
end