summaryrefslogtreecommitdiff
path: root/lib/coderay.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay.rb')
-rw-r--r--lib/coderay.rb9
1 files changed, 9 insertions, 0 deletions
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 <tt>:scanner_options</tt> is not set.