Included Modules

Files

Class Index [+]

Quicksearch

CodeRay::Encoders::Debug

Debug Encoder

Fast encoder producing simple debug output.

It is readable and diff-able and is used for testing.

You cannot fully restore the tokens information from the output, because consecutive :space tokens are merged. Use Tokens#dump for caching purposes.

Constants

FILE_EXTENSION

Protected Instance Methods

begin_line(kind) click to toggle source
    # File lib/coderay/encoders/debug.rb, line 38
38:     def begin_line kind
39:       "#{kind}["
40:     end
close_token(kind) click to toggle source
    # File lib/coderay/encoders/debug.rb, line 34
34:     def close_token kind
35:       ">"
36:     end
end_line(kind) click to toggle source
    # File lib/coderay/encoders/debug.rb, line 42
42:     def end_line kind
43:       "]"
44:     end
open_token(kind) click to toggle source
    # File lib/coderay/encoders/debug.rb, line 30
30:     def open_token kind
31:       "#{kind}<"
32:     end
text_token(text, kind) click to toggle source
    # File lib/coderay/encoders/debug.rb, line 21
21:     def text_token text, kind
22:       if kind == :space
23:         text
24:       else
25:         text = text.gsub(/[)\\]/, '\\\0')  # escape ) and \
26:         "#{kind}(#{text})"
27:       end
28:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.