Sha256: 6d43f5bcaae779b1289a736b834a43138345c696305d31a21bc62a09bcbe3e13

Contents?: true

Size: 352 Bytes

Versions: 2

Compression:

Stored size: 352 Bytes

Contents

require 'pry'
require 'pry-nav'
require 'ruby-prof'

module Troo
  def self.debug(filename = 'profile.html', &block)
    RubyProf.start

    yield

    result = RubyProf.stop
    result.eliminate_methods!([/^Array/, /^Hash/])

    File.open('./tmp/' + filename, 'w') do |file|
      RubyProf::CallStackPrinter.new(result).print(file)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troo-0.0.10 lib/troo/debug.rb
troo-0.0.9 lib/troo/debug.rb