summaryrefslogtreecommitdiff
path: root/lib/coderay/duo.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-05-01 02:58:17 +0000
committermurphy <murphy@rubychan.de>2010-05-01 02:58:17 +0000
commit7bf48ce6cf5c75a2278d6545f02781a79f53ebbb (patch)
treec0f87f427bf4d8b8a8c56ec1f722367949c8ff5b /lib/coderay/duo.rb
parent6f1178b7fb8967dda865433ecb9e309f6cb733e1 (diff)
downloadcoderay-7bf48ce6cf5c75a2278d6545f02781a79f53ebbb.tar.gz
Got rid of the old streaming system (see #142).
Diffstat (limited to 'lib/coderay/duo.rb')
-rw-r--r--lib/coderay/duo.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/coderay/duo.rb b/lib/coderay/duo.rb
index 5468dda..c11bd3f 100644
--- a/lib/coderay/duo.rb
+++ b/lib/coderay/duo.rb
@@ -23,9 +23,6 @@ module CodeRay
# simple:
# CodeRay::Duo[:ruby, :page].highlight 'bla 42'
#
- # streaming:
- # CodeRay::Duo[:ruby, :page].highlight 'bar 23', :stream => true
- #
# with options:
# CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??'
#
@@ -64,18 +61,9 @@ module CodeRay
end
# Tokenize and highlight the code using +scanner+ and +encoder+.
- #
- # If the :stream option is set, the Duo will go into streaming mode,
- # saving memory for the cost of time.
- def encode code, options = { :stream => false }
- stream = options.delete :stream
+ def encode code, options = {}
options = @options.merge options
- if stream
- encoder.encode_stream(code, @lang, options)
- else
- scanner.code = code
- encoder.encode_tokens(scanner.tokenize, options)
- end
+ encoder.encode(code, @lang, options)
end
alias highlight encode