From a3b4ad06b992bd418a1d34bfb271c09fd9bedf11 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 21 Mar 2006 14:46:34 +0000 Subject: =?UTF-8?q?CodeRay::Duo=20added=20for=20cool=20caching!=20bench/ca?= =?UTF-8?q?ching.rb=20added=20t=C2=B4for=20demonstrating=20this.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HTML Encoder: creates unwrapped output by default (still problems with that.) Numerizing changed (doesn't try to prevent nesting errors) Speedup: "::String" is faster. --- lib/coderay.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/coderay.rb') diff --git a/lib/coderay.rb b/lib/coderay.rb index e1dbcd2..6c84c8b 100644 --- a/lib/coderay.rb +++ b/lib/coderay.rb @@ -138,6 +138,7 @@ module CodeRay require 'coderay/tokens' require 'coderay/scanner' require 'coderay/encoder' + require 'coderay/duo' require 'coderay/style' @@ -271,6 +272,14 @@ module CodeRay Encoders[format].new options end + # Finds the Scanner class for +lang+ and creates an instance, passing + # +options+ to it. + # + # See Scanner.new. + def scanner lang, options = {} + Scanners[lang].new '', options + end + # Extract the options for the scanner from the +options+ hash. # # Returns an empty Hash if :scanner_options is not set. -- cgit v1.2.1