Mercurial > hg > soundsoftware-site
view .svn/pristine/a7/a728943093f6831306c2b123cde489f05fdadba9.svn-base @ 1119:22d81bd0b62c redmine-2.2-integration
Deleted existing the embedded plugin and replaced it witgh redmine_embedded (same functionality, but upgraded to be compatible with Redmine 2.x).
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 08 Jan 2013 14:43:04 +0000 |
parents | cbb26bc654de |
children |
line wrap: on
line source
module CodeRay module Encoders # Counts the LoC (Lines of Code). Returns an Integer >= 0. # # Alias: +loc+ # # Everything that is not comment, markup, doctype/shebang, or an empty line, # is considered to be code. # # For example, # * HTML files not containing JavaScript have 0 LoC # * in a Java class without comments, LoC is the number of non-empty lines # # A Scanner class should define the token kinds that are not code in the # KINDS_NOT_LOC constant, which defaults to [:comment, :doctype]. class LinesOfCode < TokenKindFilter register_for :lines_of_code NON_EMPTY_LINE = /^\s*\S.*$/ protected def setup options if scanner kinds_not_loc = scanner.class::KINDS_NOT_LOC else warn "Tokens have no associated scanner, counting all nonempty lines." if $VERBOSE kinds_not_loc = CodeRay::Scanners::Scanner::KINDS_NOT_LOC end options[:exclude] = kinds_not_loc super options end def finish options output @tokens.text.scan(NON_EMPTY_LINE).size end end end end