OTWO-1213 Works around lost encoding in Ruby/C binding layer
[ohcount] / ruby / gestalt / rules / c_keyword_rule.rb
1 module Ohcount
2         module Gestalt
3                 class CKeywordRule < KeywordRule
4
5                         def initialize(*keywords)
6                                 super('c',*keywords)
7                         end
8
9       def process_source_file(source_file)
10         if source_file.language_breakdown('c')
11           @count += source_file.language_breakdown('c').code.scan(regexp).size
12         elsif source_file.language_breakdown('cpp')
13           @count += source_file.language_breakdown('cpp').code.scan(regexp).size
14         end
15       end
16                 end
17         end
18 end