Mercurial > hg > soundsoftware-site
comparison vendor/gems/coderay-0.9.7/lib/coderay/encoders/text.rb @ 523:0b6c82dead28 luisf
Merge from branch "cannam"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:23:37 +0100 |
parents | 0579821a129a |
children |
comparison
equal
deleted
inserted
replaced
318:f7c525dc7585 | 523:0b6c82dead28 |
---|---|
1 module CodeRay | |
2 module Encoders | |
3 | |
4 class Text < Encoder | |
5 | |
6 include Streamable | |
7 register_for :text | |
8 | |
9 FILE_EXTENSION = 'txt' | |
10 | |
11 DEFAULT_OPTIONS = { | |
12 :separator => '' | |
13 } | |
14 | |
15 protected | |
16 def setup options | |
17 super | |
18 @sep = options[:separator] | |
19 end | |
20 | |
21 def text_token text, kind | |
22 text + @sep | |
23 end | |
24 | |
25 def finish options | |
26 super.chomp @sep | |
27 end | |
28 | |
29 end | |
30 | |
31 end | |
32 end |