Class: Autoproj::Stats::SLOCCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/autoproj/stats/sloc_counter.rb

Instance Method Summary collapse

Instance Method Details

#find_counter_for_path(path) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/autoproj/stats/sloc_counter.rb', line 4

def find_counter_for_path(path)
    case path
    when /\.rb$/, /\.orogen$/
        lambda { |line| line !~ /^(?:#|end)$/ }
    when /\.py$/
        lambda { |line| line !~ /^#/ }
    when /\.(?:[ch]pp|cc?|hh?)$/
        lambda { |line| line !~ /^(?:[{}]+|\/\/)$/ }
    when /CMakeLists.txt/, /\.cmake$/
        lambda { |line| line !~ /^#/ }
    when /\.sdf$/
        lambda { |line| true }
    end
end