Closed simeonwillbanks closed 10 years ago
More debugging info:
❯ irb
>> require 'pry'
=> true
>> require 'pry-theme'
=> false
>> ::CodeRay::Encoders::Terminal::TOKEN_COLORS
=> {:debug=>"\e[1;37;44m", :annotation=>"\e[34m", :attribute_name=>"\e[35m", :attribute_value=>"\e[31m", :binary=>{:self=>"\e[31m", :char=>"\e[1;31m", :delimiter=>"\e[1;31m"}, :char=>{:self=>"\e[35m", :delimiter=>"\e[1;35m"}, :clas
s=>"\e[1;35;4m", :class_variable=>"\e[36m", :color=>"\e[32m", :comment=>{:self=>"\e[1;30m", :char=>"\e[37m", :delimiter=>"\e[37m"}, :constant=>"\e[1;34;4m", :decorator=>"\e[35m", :definition=>"\e[1;33m", :directive=>"\e[33m", :docs
tring=>"\e[31m", :doctype=>"\e[1;34m", :done=>"\e[1;30;2m", :entity=>"\e[31m", :error=>"\e[1;37;41m", :exception=>"\e[1;31m", :float=>"\e[1;35m", :function=>"\e[1;34m", :global_variable=>"\e[1;32m", :hex=>"\e[1;36m", :id=>"\e[1;34m
", :include=>"\e[31m", :integer=>"\e[1;34m", :imaginary=>"\e[1;34m", :important=>"\e[1;31m", :key=>{:self=>"\e[35m", :char=>"\e[1;35m", :delimiter=>"\e[1;35m"}, :keyword=>"\e[32m", :label=>"\e[1;33m", :local_variable=>"\e[33m", :na
mespace=>"\e[1;35m", :octal=>"\e[1;34m", :predefined=>"\e[36m", :predefined_constant=>"\e[1;36m", :predefined_type=>"\e[1;32m", :preprocessor=>"\e[1;36m", :pseudo_class=>"\e[1;34m", :regexp=>{:self=>"\e[35m", :delimiter=>"\e[1;35m"
, :modifier=>"\e[35m", :char=>"\e[1;35m"}, :reserved=>"\e[32m", :shell=>{:self=>"\e[33m", :char=>"\e[1;33m", :delimiter=>"\e[1;33m", :escape=>"\e[1;33m"}, :string=>{:self=>"\e[31m", :modifier=>"\e[1;31m", :char=>"\e[1;35m", :delimi
ter=>"\e[1;31m", :escape=>"\e[1;31m"}, :symbol=>{:self=>"\e[33m", :delimiter=>"\e[1;33m"}, :tag=>"\e[32m", :type=>"\e[1;34m", :value=>"\e[36m", :variable=>"\e[34m", :insert=>{:self=>"\e[42m", :insert=>"\e[1;32;42m", :eyecatcher=>"\
e[102m"}, :delete=>{:self=>"\e[41m", :delete=>"\e[1;31;41m", :eyecatcher=>"\e[101m"}, :change=>{:self=>"\e[44m", :change=>"\e[37;44m"}, :head=>{:self=>"\e[45m", :filename=>"\e[37;45m"}, :method=>"\e[1;34m", :escape=>nil}
>> PryTheme.tput_colors
=> 256
>> t = PryTheme.create :name => 'tomorrow' do
?> author :name => 'John Mair'
>> description 'A theme should not get in your way'
>>
?> define_theme do
?> class_ 'gold'
>> class_variable 'alizarin'
>> comment 'gray03'
>> constant 'gold'
>> error 'tangerine', [:italic]
>> float 'tangerine'
>> global_variable 'alizarin'
>> inline_delimiter 'heliotrope01'
>> instance_variable 'alizarin'
>> integer 'tangerine'
>> keyword 'heliotrope03'
>> method 'royal_blue05'
>> predefined_constant 'tangerine'
>> symbol 'old_gold'
>>
?> regexp do
?> self_ 'alizarin'
>> char 'heliotrope01'
>> content 'old_gold'
>> delimiter 'alizarin'
>> modifier 'old_gold'
>> escape 'heliotrope01'
>> end
>>
?> shell do
?> self_ 'gray02'
>> char 'heliotrope01'
>> content 'puce01'
>> delimiter 'gray02'
>> escape 'heliotrope01'
>> end
>>
?> string do
?> self_ 'old_gold'
>> char 'heliotrope01'
>> content 'old_gold'
>> delimiter 'old_gold'
>> escape 'heliotrope01'
>> end
>> end
>> end
lse, @definition=#<PryTheme::Theme::Definition:0x007fe4bd8b1880 @color_model=256, @class_=#<PryTheme::Color256:0x007fe4bd8a9a90 @options={:from=>:readable, :foreground=>"gold", :background=>nil, :bold=>false, :italic=>false, :under
line=>false}, @color_model=256, @readable_fg="gold", @readable_bg=false>, @class_variable=#<PryTheme::Color256:0x007fe4bd8a95e0 @options={:from=>:readable, :foreground=>"alizarin", :background=>nil, :bold=>false, :italic=>false, :u
nderline=>false}, @color_model=256, @readable_fg="alizarin", @readable_bg=false>, @comment=#<PryTheme::Color256:0x007fe4bd8a9270 @options={:from=>:readable, :foreground=>"gray03", :background=>nil, :bold=>false, :italic=>false, :un
derline=>false}, @color_model=256, @readable_fg="gray03", @readable_bg=false>, @constant=#<PryTheme::Color256:0x007fe4bd8a8f28 @options={:from=>:readable, :foreground=>"gold", :background=>nil, :bold=>false, :italic=>false, :underl
ine=>false}, @color_model=256, @readable_fg="gold", @readable_bg=false>, @error=#<PryTheme::Color256:0x007fe4bd8a8708 @options={:from=>:readable, :foreground=>"tangerine", :background=>nil, :bold=>false, :italic=>true, :underline=>
false}, @color_model=256, @readable_fg="tangerine", @readable_bg=false>, @float=#<PryTheme::Color256:0x007fe4bd8a82d0 @options={:from=>:readable, :foreground=>"tangerine", :background=>nil, :bold=>false, :italic=>false, :underline=
>false}, @color_model=256, @readable_fg="tangerine", @readable_bg=false>, @global_variable=#<PryTheme::Color256:0x007fe4bd8a3e88 @options={:from=>:readable, :foreground=>"alizarin", :background=>nil, :bold=>false, :italic=>false, :
underline=>false}, @color_model=256, @readable_fg="alizarin", @readable_bg=false>, @inline_delimiter=#<PryTheme::Color256:0x007fe4bd8a3af0 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :it
alic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=false>, @instance_variable=#<PryTheme::Color256:0x007fe4bd8a3438 @options={:from=>:readable, :foreground=>"alizarin", :background=>nil, :b
old=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="alizarin", @readable_bg=false>, @integer=#<PryTheme::Color256:0x007fe4bd8a2fd8 @options={:from=>:readable, :foreground=>"tangerine", :background=>nil,
:bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="tangerine", @readable_bg=false>, @keyword=#<PryTheme::Color256:0x007fe4bd8a2b78 @options={:from=>:readable, :foreground=>"heliotrope03", :background=
>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope03", @readable_bg=false>, @method=#<PryTheme::Color256:0x007fe4bd8a2830 @options={:from=>:readable, :foreground=>"royal_blue05", :bac
kground=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="royal_blue05", @readable_bg=false>, @predefined_constant=#<PryTheme::Color256:0x007fe4bd8a2510 @options={:from=>:readable, :foreground=
>"tangerine", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="tangerine", @readable_bg=false>, @symbol=#<PryTheme::Color256:0x007fe4bd8a21f0 @options={:from=>:readable, :foregroun
d=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=false>, @regexp=#<PryTheme::Theme::Definition::Regexp:0x007fe4bd8a20d8 @color_model=256, @mo
difier=#<PryTheme::Color256:0x007fe4bd8a09e0 @options={:from=>:readable, :foreground=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=false>, @
self_=#<PryTheme::Color256:0x007fe4bd8a1778 @options={:from=>:readable, :foreground=>"alizarin", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="alizarin", @readable_bg=false>, @c
har=#<PryTheme::Color256:0x007fe4bd8a1480 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=fals
e>, @content=#<PryTheme::Color256:0x007fe4bd8a1048 @options={:from=>:readable, :foreground=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=fal
se>, @delimiter=#<PryTheme::Color256:0x007fe4bd8a0cd8 @options={:from=>:readable, :foreground=>"alizarin", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="alizarin", @readable_bg=
false>, @escape=#<PryTheme::Color256:0x007fe4bd8a06c0 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @read
able_bg=false>>, @shell=#<PryTheme::Theme::Definition::Shell:0x007fe4bd8a05d0 @color_model=256, @self_=#<PryTheme::Color256:0x007fe4bd89bc88 @options={:from=>:readable, :foreground=>"gray02", :background=>nil, :bold=>false, :italic
=>false, :underline=>false}, @color_model=256, @readable_fg="gray02", @readable_bg=false>, @char=#<PryTheme::Color256:0x007fe4bd89b9b8 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :italic
=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=false>, @content=#<PryTheme::Color256:0x007fe4bd89b6c0 @options={:from=>:readable, :foreground=>"puce01", :background=>nil, :bold=>false, :ita
lic=>false, :underline=>false}, @color_model=256, @readable_fg="puce01", @readable_bg=false>, @delimiter=#<PryTheme::Color256:0x007fe4bd89b418 @options={:from=>:readable, :foreground=>"gray02", :background=>nil, :bold=>false, :ital
ic=>false, :underline=>false}, @color_model=256, @readable_fg="gray02", @readable_bg=false>, @escape=#<PryTheme::Color256:0x007fe4bd89b0d0 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :it
alic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=false>>, @string=#<PryTheme::Theme::Definition::String:0x007fe4bd89b030 @color_model=256, @self_=#<PryTheme::Color256:0x007fe4bd89a860 @op
tions={:from=>:readable, :foreground=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=false>, @char=#<PryTheme::Color256:0x007fe4bd89a5b8 @opti
ons={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=false>, @content=#<PryTheme::Color256:0x007fe4bd89a
1f8 @options={:from=>:readable, :foreground=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=false>, @delimiter=#<PryTheme::Color256:0x007fe4bd
899e10 @options={:from=>:readable, :foreground=>"old_gold", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="old_gold", @readable_bg=false>, @escape=#<PryTheme::Color256:0x007fe4bd
899a50 @options={:from=>:readable, :foreground=>"heliotrope01", :background=>nil, :bold=>false, :italic=>false, :underline=>false}, @color_model=256, @readable_fg="heliotrope01", @readable_bg=false>>>>
>> t.to_coderay
=> {:class=>"\e[38;5;220m", :class_variable=>"\e[38;5;203m", :comment=>"\e[38;5;246m", :constant=>"\e[38;5;220m", :error=>"\e[38;5;208;3m", :float=>"\e[38;5;208m", :global_variable=>"\e[38;5;203m", :inline_delimiter=>"\e[38;5;99m",
:instance_variable=>"\e[38;5;203m", :integer=>"\e[38;5;208m", :keyword=>"\e[38;5;171m", :method=>"\e[38;5;105m", :predefined_constant=>"\e[38;5;208m", :symbol=>"\e[38;5;142m", :regexp=>{:modifier=>"\e[38;5;142m", :self=>"\e[38;5;2
03m", :char=>"\e[38;5;99m", :content=>"\e[38;5;142m", :delimiter=>"\e[38;5;203m", :escape=>"\e[38;5;99m"}, :shell=>{:self=>"\e[38;5;245m", :char=>"\e[38;5;99m", :content=>"\e[38;5;174m", :delimiter=>"\e[38;5;245m", :escape=>"\e[38;
5;99m"}, :string=>{:self=>"\e[38;5;142m", :char=>"\e[38;5;99m", :content=>"\e[38;5;142m", :delimiter=>"\e[38;5;142m", :escape=>"\e[38;5;99m"}}
>> ::CodeRay::Encoders::Terminal::TOKEN_COLORS.merge!(t.to_coderay)
=> {:debug=>"\e[1;37;44m", :annotation=>"\e[34m", :attribute_name=>"\e[35m", :attribute_value=>"\e[31m", :binary=>{:self=>"\e[31m", :char=>"\e[1;31m", :delimiter=>"\e[1;31m"}, :char=>{:self=>"\e[35m", :delimiter=>"\e[1;35m"}, :class=>"\e[38;5;220m", :class_variable=>"\e[38;5;203m", :color=>"\e[32m", :comment=>"\e[38;5;246m", :constant=>"\e[38;5;220m", :decorator=>"\e[35m", :definition=>"\e[1;33m", :directive=>"\e[33m", :docstring=>"\e[31m", :doctype=>"\e[1;34m", :done=>"\e[1;30;2m", :entity=>"\e[31m", :error=>"\e[38;5;208;3m", :exception=>"\e[1;31m", :float=>"\e[38;5;208m", :function=>"\e[1;34m", :global_variable=>"\e[38;5;203m", :hex=>"\e[1;36m", :id=>"\e[1;34m", :include=>"\e[31m", :integer=>"\e[38;5;208m", :imaginary=>"\e[1;34m", :important=>"\e[1;31m", :key=>{:self=>"\e[35m", :char=>"\e[1;35m", :delimiter=>"\e[1;35m"}, :keyword=>"\e[38;5;171m", :label=>"\e[1;33m", :local_variable=>"\e[33m", :namespace=>"\e[1;35m", :octal=>"\e[1;34m", :predefined=>"\e[36m", :predefined_constant=>"\e[38;5;208m", :predefined_type=>"\e[1;32m", :preprocessor=>"\e[1;36m", :pseudo_class=>"\e[1;34m", :regexp=>{:modifier=>"\e[38;5;142m", :self=>"\e[38;5;203m", :char=>"\e[38;5;99m", :content=>"\e[38;5;142m", :delimiter=>"\e[38;5;203m", :escape=>"\e[38;5;99m"}, :reserved=>"\e[32m", :shell=>{:self=>"\e[38;5;245m", :char=>"\e[38;5;99m", :content=>"\e[38;5;174m", :delimiter=>"\e[38;5;245m", :escape=>"\e[38;5;99m"}, :string=>{:self=>"\e[38;5;142m", :char=>"\e[38;5;99m", :content=>"\e[38;5;142m", :delimiter=>"\e[38;5;142m", :escape=>"\e[38;5;99m"}, :symbol=>"\e[38;5;142m", :tag=>"\e[32m", :type=>"\e[1;34m", :value=>"\e[36m", :variable=>"\e[34m", :insert=>{:self=>"\e[42m", :insert=>"\e[1;32;42m", :eyecatcher=>"\e[102m"}, :delete=>{:self=>"\e[41m", :delete=>"\e[1;31;41m", :eyecatcher=>"\e[101m"}, :change=>{:self=>"\e[44m", :change=>"\e[37;44m"}, :head=>{:self=>"\e[45m", :filename=>"\e[37;45m"}, :method=>"\e[38;5;105m", :escape=>nil, :inline_delimiter=>"\e[38;5;99m", :instance_variable=>"\e[38;5;203m"}
Hope this helps. If you need anything else, please let me know!
Hello! What are your Pry, CodeRay and Pry Theme versions? Make sure to update them to the recent ones (namely, you must use CodeRay v1.1.0 and Pry Theme v1.0.2).
Upgrading my gems worked!
Thanks for the help and the awesome gem! :smile:
Cheers!
@kyrylo when I use
pry-theme
, anm
is inserted into the source.Without
pry-theme
With
pry-theme
I'm using iTerm2. Also, I've changed my default ANSI colors to base16-shell.
I understand, this might be a rabbit hole. Any suggestions appreciated! Thanks for the help.