Method: CountVonCount.new

Defined in:
lib/count_von_count.rb

.new(path, code_paths = nil, test_paths = nil, no_default = false, format = :txt, output = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/count_von_count.rb', line 6

def self.new(path, code_paths=nil, test_paths=nil, no_default=false, format=:txt, output = nil)
  code_paths = code_paths || []
  test_paths = test_paths || []
  path = Pathname.new(path).realpath
  unless no_default
    code_paths = default_code_paths + code_paths
    test_paths = default_test_paths + test_paths
  end
  raise "No code paths given" if code_paths.empty?

  formatter = formatters[format].new(path, output)
  CountVonCount::Counter.new(path, code_paths, test_paths, formatter)
end