Sha256: 788be109ec124eac3fcb84632f8171be762255aaec051ca7bfa2e2b66e52fca9

Contents?: true

Size: 403 Bytes

Versions: 1

Compression:

Stored size: 403 Bytes

Contents

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

module Troo
  # @param  [String]
  # @param  []
  # @return []
  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

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.11 lib/troo/debug.rb