Method: RubyProf::MultiPrinter#print

Defined in:
lib/ruby-prof/multi_printer.rb

create profile files under options or the current directory. options is used as the base name for the pofile file, defaults to “profile”.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ruby-prof/multi_printer.rb', line 16

def print(options)
  @profile = options.delete(:profile) || "profile"
  @directory = options.delete(:path) || File.expand_path(".")
  File.open(stack_profile, "w") do |f|
    @stack_printer.print(f, options.merge(:graph => "#{@profile}.graph.html"))
  end
  File.open(graph_profile, "w") do |f|
    @graph_printer.print(f, options)
  end
  File.open(tree_profile, "w") do |f|
    @tree_printer.print(f, options)
  end
  File.open(flat_profile, "w") do |f|
    @flat_printer.print(f, options)
  end
end