Class: PryTheme::Config::Executor Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-theme/config.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Responsible for actions that are defined in theme_options.

Since:

  • 1.1.0

Instance Method Summary collapse

Instance Method Details

#paint_key_as_symbolvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

The method amends the default behaviour of CodeRay.

This method returns an undefined value.

Sets the colour of the key token to the colour of the symbol token (akin to Pygments). Without this patch keys and symbols have generally different colours. It’s impossible to set the colour of the key token, but with help of this method you can make it look like a symbol.

Examples:

{foo: 1, :bar => 2}
#  ^       ^
#  |       |
# key    symbol

See Also:

Since:

  • 1.1.0



24
25
26
27
# File 'lib/pry-theme/config.rb', line 24

def paint_key_as_symbol
  token_colors = CodeRay::Encoders::Terminal::TOKEN_COLORS
  token_colors[:key] = token_colors[:symbol]
end