class Middleman::Profiling::RubyProfProfiler

A profiler that uses ruby-prof

def initialize

def initialize
  require 'ruby-prof'
rescue LoadError
  raise "To use the --profile option, you must add the 'ruby-prof' gem to your Gemfile"
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