lib/code_stats/languages.rb in code_stats2-0.1.7 vs lib/code_stats/languages.rb in code_stats2-0.1.8

- old
+ new

@@ -44,11 +44,14 @@ end end module CComments def code - @code ||= text.substitute(/\/\*.+?\*\/\n?/m, '').substitute(/^\/\/.+?[\n\z]/m, '').substitute(/\/\/.+?$/, '') + @code ||= text. + substitute(/\/\*.+?\*\/\n?/m, ''). + substitute(/^\/\/.+?[\n\z]/m, ''). + substitute(/\/\/.+?$/, '') end end module SharpComments def code @@ -90,11 +93,14 @@ include SharpComments extensions :coffee def code - @code ||= text.substitute(/###.+?###\n?/m, '').substitute(/^#.+?[\n\z]/m, '').substitute(/#.+?$/, '') + @code ||= text. + substitute(/###.+?###\n?/m, ''). + substitute(/^#.+?[\n\z]/m, ''). + substitute(/#.+?$/, '') end end class Haml < Abstract extensions :haml @@ -135,8 +141,20 @@ class Clojure < Abstract extensions :clj def code @code ||= text.substitute(/^;.+?[\n\z]/m, '').substitute(/;.+?$/, '') + end + end + + class Scala < Java + extensions :scala + end + + class Html < Abstract + extensions :html, :xhtml + + def code + @code ||= text.substitute(/<!--.+?-->\n?/m, '') end end end \ No newline at end of file