Sha256: 53d59075b141c22ec20f2cd32a1477ca714f7a4ce0fdb2e35e767c83414759a2

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

module RubyProf
  class AbstractPrinter
    def initialize(result)
      @result = result
      @output = nil
      @options = {}
    end

    # Specify print options.
    # 
    # options - Hash table
    #   :min_percent - Number 0 to 100 that specifes the minimum
    #                  %self (the methods self time divided by the
    #                  overall total time) that a method must take
    #                  for it to be printed out in the report.
    #                  Default value is 0.
    #
    #   :print_file  - True or false. Specifies if a method's source
    #                  file should be printed.  Default value if false.
    #
    def setup_options(options = {})
      @options = options
    end      

    def min_percent
      @options[:min_percent] || 0
    end
    
    def print_file
      @options[:print_file] || false
    end
    
    def method_name(method)
      name = method.full_name
      if print_file
        name += " (#{method.source_file}:#{method.line}}"
      end
      name
    end
  end
end 

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
adamh-ruby-prof-0.7.3 lib/ruby-prof/abstract_printer.rb
skaes-ruby-prof-0.7.3 lib/ruby-prof/abstract_printer.rb
ruby-prof-danielhoey-0.8.1 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.8.2 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.8.1-x86-mingw32 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.8.1-x86-mswin32 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.8.1 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.10 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.9 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.8 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.7 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.6 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.5 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.4 lib/ruby-prof/abstract_printer.rb
rdp-ruby-prof-0.7.4 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.3 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.2-x86-mswin32-60 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.2 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.1 lib/ruby-prof/abstract_printer.rb
ruby-prof-0.7.1-x86-mswin32-60 lib/ruby-prof/abstract_printer.rb