Class: CodeRay::Encoders::Debug

### Home Classes Methods

### In Files

- lib/coderay/encoders/debug.rb

### Parent

CodeRay::Encoders::Encoder

### Methods

- #begin_group
- #begin_line
- #end_group
- #end_line
- #text_token

### Class/Module Index

Quicksearch

- CodeRay
- CodeRay::Duo
- CodeRay::Encoders
- CodeRay::Encoders::CommentFilter
- CodeRay::Encoders::Count
- CodeRay::Encoders::Debug
- CodeRay::Encoders::DebugLint
- CodeRay::Encoders::Div
- CodeRay::Encoders::Encoder
- CodeRay::Encoders::Filter
- CodeRay::Encoders::HTML
- CodeRay::Encoders::HTML::Output
- CodeRay::Encoders::JSON
- CodeRay::Encoders::LinesOfCode
- CodeRay::Encoders::Lint
- CodeRay::Encoders::Null
- CodeRay::Encoders::Page
- CodeRay::Encoders::Span
- CodeRay::Encoders::Statistic
- CodeRay::Encoders::Terminal
- CodeRay::Encoders::Text
- CodeRay::Encoders::TokenKindFilter
- CodeRay::Encoders::XML
- CodeRay::Encoders::YAML
- CodeRay::FileType
- CodeRay::ForRedCloth
- CodeRay::Plugin
- CodeRay::PluginHost
- CodeRay::Scanners
- CodeRay::Scanners::C
- CodeRay::Scanners::CPlusPlus
- CodeRay::Scanners::CSS
- CodeRay::Scanners::Clojure
- CodeRay::Scanners::Debug
- CodeRay::Scanners::Delphi
- CodeRay::Scanners::Diff
- CodeRay::Scanners::ERB
- CodeRay::Scanners::Go
- CodeRay::Scanners::Groovy
- CodeRay::Scanners::HAML
- CodeRay::Scanners::HTML
- CodeRay::Scanners::JSON
- CodeRay::Scanners::Java
- CodeRay::Scanners::JavaScript
- CodeRay::Scanners::Python
- CodeRay::Scanners::Raydebug
- CodeRay::Scanners::Ruby
- CodeRay::Scanners::SQL
- CodeRay::Scanners::Sass
- CodeRay::Scanners::Scanner
- CodeRay::Scanners::Taskpaper
- CodeRay::Scanners::Text
- CodeRay::Scanners::XML
- CodeRay::Scanners::YAML
- CodeRay::Styles
- CodeRay::Styles::Alpha
- CodeRay::Styles::Style
- CodeRay::Tokens
- CodeRay::TokensProxy
- CodeRay::WordList
- CodeRay::WordList::CaseIgnoring

No matching classes.

# 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.

See also: Scanners::Debug

### Constants

FILE_EXTENSION

### Public Instance Methods

begin_group(kind) click to toggle source

    # File lib/coderay/encoders/debug.rb, line 30
    def begin_group kind
      @out << "#{kind}<"
    end

begin_line(kind) click to toggle source

    # File lib/coderay/encoders/debug.rb, line 38
    def begin_line kind
      @out << "#{kind}["
    end

end_group(kind) click to toggle source

    # File lib/coderay/encoders/debug.rb, line 34
    def end_group kind
      @out << '>'
    end

end_line(kind) click to toggle source

    # File lib/coderay/encoders/debug.rb, line 42
    def end_line kind
      @out << ']'
    end

text_token(text, kind) click to toggle source

    # File lib/coderay/encoders/debug.rb, line 20
    def text_token text, kind
      if kind == :space
        @out << text
      else
        text = text.gsub('\', '\\\\') if text.index('\')
        text = text.gsub(')',  '\\)')    if text.index(')')
        @out << "#{kind}(#{text})"
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.