diff options
Diffstat (limited to 'vendor/plugins/coderay-0.7.6.227/lib/coderay/encoders/text.rb')
-rw-r--r-- | vendor/plugins/coderay-0.7.6.227/lib/coderay/encoders/text.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/plugins/coderay-0.7.6.227/lib/coderay/encoders/text.rb b/vendor/plugins/coderay-0.7.6.227/lib/coderay/encoders/text.rb new file mode 100644 index 000000000..14282ac5f --- /dev/null +++ b/vendor/plugins/coderay-0.7.6.227/lib/coderay/encoders/text.rb @@ -0,0 +1,32 @@ +module CodeRay +module Encoders + + class Text < Encoder + + include Streamable + register_for :text + + FILE_EXTENSION = 'txt' + + DEFAULT_OPTIONS = { + :separator => '' + } + + protected + def setup options + @out = '' + @sep = options[:separator] + end + + def token text, kind + @out << text + @sep if text.is_a? ::String + end + + def finish options + @out.chomp @sep + end + + end + +end +end |