class RubyProf::Profile
Public Instance Methods
eliminate_methods(methods, paths = [Dir.pwd])
click to toggle source
# File lib/rdepend/trace.rb, line 13 def eliminate_methods(methods, paths = [Dir.pwd]) eliminated = [] i = 0 while i < methods.size method_info = methods[i] parent = method_info.parents.first sources = [method_info.source_file] sources << parent.target.source_file unless parent.nil? match = paths.any? do |path| sources.any? { |source| source.start_with?(path) } end if match || method_info.root? i += 1 else eliminated << methods.delete_at(i) method_info.eliminate! end end eliminated end
eliminate_methods!(paths = [Dir.pwd])
click to toggle source
# File lib/rdepend/trace.rb, line 5 def eliminate_methods!(paths = [Dir.pwd]) eliminated = [] threads.each do |thread| eliminated.concat(eliminate_methods(thread.methods, paths)) end eliminated end