diff options
-rw-r--r-- | Changes.textile | 1 | ||||
-rw-r--r-- | lib/coderay/scanner.rb | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Changes.textile b/Changes.textile index 92efb28..19b91dd 100644 --- a/Changes.textile +++ b/Changes.textile @@ -105,6 +105,7 @@ h3. @Scanners::Scanner@ A list of all token classes not considered in LOC count. Added appropriate values for scanners. +* *NEW* method @#lang@ returns the scanner's lang, which is its @plugin_id@. * *FIXED* automatic, safe UTF-8 detection _[Ruby 1.9]_ * *FIXED* column takes care of multibyte encodings _[Ruby 1.9]_ * *FIXED* is dumpable (@Tokens@ store their scanner in an @@scanner@ variable) diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb index 8233b2c..d6dd19f 100644 --- a/lib/coderay/scanner.rb +++ b/lib/coderay/scanner.rb @@ -152,6 +152,11 @@ module CodeRay alias code string alias code= string= + # Returns the Plugin ID for this scanner. + def lang + self.class.plugin_id + end + # Scans the code and returns all tokens in a Tokens object. def tokenize new_string=nil, options = {} options = @options.merge(options) |