diff options
Diffstat (limited to 'lib/coderay/scanner.rb')
-rw-r--r-- | lib/coderay/scanner.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb index 229ba19..8233b2c 100644 --- a/lib/coderay/scanner.rb +++ b/lib/coderay/scanner.rb @@ -114,9 +114,10 @@ module CodeRay # # Else, a Tokens object is used. def initialize code='', options = {}, &block - @options = self.class::DEFAULT_OPTIONS.merge options raise "I am only the basic Scanner class. I can't scan "\ "anything. :( Use my subclasses." if self.class == Scanner + + @options = self.class::DEFAULT_OPTIONS.merge options super Scanner.normify(code) @@ -199,6 +200,14 @@ module CodeRay end pos - (string.rindex(?\n, pos) || 0) end + + def marshal_dump + @options + end + + def marshal_load options + @options = options + end protected |