Module: RubyProf::Profile::LegacyMethodElimination

Included in:
RubyProf::Profile
Defined in:
lib/ruby-prof/profile/legacy_method_elimination.rb

Instance Method Summary collapse

Instance Method Details

#eliminate_methods!(matchers) ⇒ Object

eliminate some calls from the graph by merging the information into callers. matchers can be a list of strings or regular expressions or the name of a file containing regexps.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ruby-prof/profile/legacy_method_elimination.rb', line 6

def eliminate_methods!(matchers)
  RubyProf.deprecation_warning(
    "Method 'eliminate_methods!' is deprecated",
    "Please call 'exclude_methods!' before starting the profile run instead."
  )
  matchers = read_regexps_from_file(matchers) if matchers.is_a?(String)
  eliminated = []
  threads.each do |thread|
    matchers.each{ |matcher| eliminated.concat(eliminate_methods(thread.methods, matcher)) }
  end
  eliminated
end