class CodeWeb::TextReport

Attributes

arg_regex[RW]
base_url[RW]
method_calls[RW]

@!attribute :method_calls [r]

list of all the method_Calls
@return [Array<MethodCall>]

Public Class Methods

new(method_calls, class_map={}, arg_regex=nil, out=STDOUT, options = {}) click to toggle source
# File lib/code_web/text_report.rb, line 11
def initialize(method_calls, class_map={}, arg_regex=nil, out=STDOUT, options = {})
  @method_calls = method_calls
  @arg_regex = arg_regex
  @base_url = options[:base_url]
  @url_and_file = options[:url_and_file]
  @out = out
end

Public Instance Methods

arg_regex?() click to toggle source
# File lib/code_web/text_report.rb, line 9
def arg_regex? ; ! arg_regex.nil? ; end
methods_by_name() click to toggle source
# File lib/code_web/text_report.rb, line 40
def methods_by_name
  MethodList.group_by(method_calls, :short_method_name)
end
report() click to toggle source
# File lib/code_web/text_report.rb, line 19
def report
  methods_by_name.each do |methods|
    @out.puts "---- #{methods.name} ----"
    methods.group_by(:signature, arg_regex).each do |methods_with_signature|
      if arg_regex?
        @out.puts " --> #{arg_regex.inspect}=#{methods_with_signature.name}"
      else
        @out.puts " --> #{methods_with_signature.name}"
      end
      methods_with_signature.each_with_index do |method, i|
        @out.puts
        @out.puts method.signature
        @out.puts "#{method.filename}:#{method.line}"
      end
      @out.puts
      @out.puts
    end
    @out.puts
  end
end