Sha256: 0f6b9582de014027fbac85e19b861b92655688594b5f3b99951dfbd4516e5d24
Contents?: true
Size: 621 Bytes
Versions: 6790
Compression:
Stored size: 621 Bytes
Contents
# frozen_string_literal: true require 'coderay' class Pry # @api private # @since v0.13.0 class SyntaxHighlighter def self.highlight(code, language = :ruby) tokenize(code, language).term end def self.tokenize(code, language = :ruby) CodeRay.scan(code, language) end def self.keyword_token_color CodeRay::Encoders::Terminal::TOKEN_COLORS[:keyword] end # Sets comment token to blue (black by default), so it's more legible. def self.overwrite_coderay_comment_token! CodeRay::Encoders::Terminal::TOKEN_COLORS[:comment][:self] = "\e[1;34m" end end end
Version data entries
6,790 entries across 6,786 versions & 31 rubygems