Class: RubyProf::Profile
- Inherits:
-
Object
- Object
- RubyProf::Profile
- Defined in:
- lib/rdepend/trace.rb
Instance Method Summary collapse
- #eliminate_methods(methods, paths = [Dir.pwd]) ⇒ Object
- #eliminate_methods!(paths = [Dir.pwd]) ⇒ Object
Instance Method Details
#eliminate_methods(methods, paths = [Dir.pwd]) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 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] source = method_info.source_file match = paths.any? { |path| source.start_with?(path) } 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]) ⇒ Object
5 6 7 8 9 10 11 |
# 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 |