summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-01-13 15:49:04 +0000
committermurphy <murphy@rubychan.de>2009-01-13 15:49:04 +0000
commitdb6274c90dc88a2a2ca22a78779a705ecb074465 (patch)
tree04b983cd7ca0dc3fb2097f951c3f79761f6a1b3d /lib/coderay/scanners/ruby.rb
parent301adecdbdc5a0b3921c68c19491747b517edc03 (diff)
downloadcoderay-db6274c90dc88a2a2ca22a78779a705ecb074465.tar.gz
Ruby Scanner: Shebang comments are highlighted as :doctype.
Diffstat (limited to 'lib/coderay/scanners/ruby.rb')
-rw-r--r--lib/coderay/scanners/ruby.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index 90c640a..721f0e4 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -147,6 +147,10 @@ module Scanners
tokens << [match, kind]
next
+ elsif bol? && match = scan(/\#!.*/)
+ tokens << [match, :doctype]
+ next
+
elsif match = scan(/\#.*/) or
( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) )
kind = :comment