module JazzFingers::CodeRay

Constants

ESCAPED_COLORS
UNESCAPED_COLORS

Public Class Methods

setup!() click to toggle source
# File lib/jazz_fingers/coderay.rb, line 6
def self.setup!
  ::CodeRay.scan("example", :ruby).term

  if ::CodeRay::VERSION >= '1.1.0'
    ESCAPED_COLORS.each do |key, value|
      ::CodeRay::Encoders::Terminal::TOKEN_COLORS[key] = value
    end
  else
    UNESCAPED_COLORS.each do |key, value|
      ::CodeRay::Encoders::Terminal::TOKEN_COLORS[key] = value
    end
  end
end