diff options
author | murphy <murphy@rubychan.de> | 2011-03-07 22:46:15 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2011-03-07 22:46:15 +0000 |
commit | 4a8301855693fc520cdd98d518f89ae06874dcd7 (patch) | |
tree | 20d0a2e66a41fa15031fd7078da90c5650faac7d /lib/coderay/encoders | |
parent | 458af2b3548de96e9ff79772dfbdf87794285c62 (diff) | |
download | coderay-4a8301855693fc520cdd98d518f89ae06874dcd7.tar.gz |
lines of code, still not working properly
Diffstat (limited to 'lib/coderay/encoders')
-rw-r--r-- | lib/coderay/encoders/lines_of_code.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |