Module: CodeStats::Languages::CComments

Included in:
Cpp, Java, JavaScript, Php
Defined in:
lib/code_stats/languages.rb

Instance Method Summary collapse

Instance Method Details

#codeObject


48
49
50
51
52
53
# File 'lib/code_stats/languages.rb', line 48

def code
  @code ||= text.
    substitute(/\/\*.+?\*\/\n?/m, '').
    substitute(/^\/\/.+?[\n\z]/m, '').
    substitute(/\/\/.+?$/, '')
end