From 4a8301855693fc520cdd98d518f89ae06874dcd7 Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 7 Mar 2011 22:46:15 +0000 Subject: lines of code, still not working properly --- lib/coderay/encoders/lines_of_code.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/coderay/encoders/lines_of_code.rb') diff --git a/lib/coderay/encoders/lines_of_code.rb b/lib/coderay/encoders/lines_of_code.rb index 2e2dd9a..4215d23 100644 --- a/lib/coderay/encoders/lines_of_code.rb +++ b/lib/coderay/encoders/lines_of_code.rb @@ -22,6 +22,10 @@ module Encoders protected + def setup options + @out = 0 + end + def compile tokens, options if scanner = tokens.scanner kinds_not_loc = scanner.class::KINDS_NOT_LOC @@ -30,11 +34,11 @@ module Encoders kinds_not_loc = CodeRay::Scanners::Scanner::KINDS_NOT_LOC end code = tokens.token_kind_filter :exclude => kinds_not_loc - @loc = code.to_s.scan(NON_EMPTY_LINE).size + @out = code.to_s.scan(NON_EMPTY_LINE).size end def finish options - @loc + @out end end -- cgit v1.2.1