summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/text.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2011-05-21 03:03:31 +0000
committermurphy <murphy@rubychan.de>2011-05-21 03:03:31 +0000
commit5efcf487985e7348ed3d39f33b7185028a6e3716 (patch)
treeddaa71a4884a5349d985526f88f11a7514c7b6d7 /lib/coderay/encoders/text.rb
parentc5a193f08ddef1ba1cb5e1f9b0789b2f587022c4 (diff)
downloadcoderay-5efcf487985e7348ed3d39f33b7185028a6e3716.tar.gz
various fixes and cleanups in CodeRay's helpers
Diffstat (limited to 'lib/coderay/encoders/text.rb')
-rw-r--r--lib/coderay/encoders/text.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/coderay/encoders/text.rb b/lib/coderay/encoders/text.rb
index 54a00dc..84e2215 100644
--- a/lib/coderay/encoders/text.rb
+++ b/lib/coderay/encoders/text.rb
@@ -4,7 +4,7 @@ module Encoders
# Concats the tokens into a single string, resulting in the original
# code string if no tokens were removed.
#
- # Alias: +plain+
+ # Alias: +plain+, +plaintext+
#
# == Options
#
@@ -13,31 +13,31 @@ module Encoders
#
# Default: empty String
class Text < Encoder
-
+
register_for :text
-
+
FILE_EXTENSION = 'txt'
-
+
DEFAULT_OPTIONS = {
:separator => nil
}
-
+
def text_token text, kind
super
@out << @sep if @sep
end
-
+
protected
def setup options
super
@sep = options[:separator]
end
-
+
def finish options
super.chomp @sep
end
-
+
end
-
+
end
end