lib/pry-theme.rb in pry-theme-0.0.10 vs lib/pry-theme.rb in pry-theme-0.1.0

- old
+ new

@@ -1,12 +1,15 @@ require 'pry-theme/version' +require 'pry-theme/uninstaller' require 'pry-theme/helper' -require 'pry-theme/commands' require 'pry-theme/palette' +require 'pry-theme/term_notation' require 'pry-theme/theme' +require 'pry-theme/rgb' +require 'pry-theme/color_converter' +require 'pry-theme/commands' require 'pry-theme/when_started_hook' -require 'pry-theme/uninstaller' require 'yaml' module PryTheme @@ -121,19 +124,19 @@ end end color_bg = find_color($7, palette) do |c| if palette.color_depth == 256 - "48;5;#{c.term}" + "#{ TermNotation::BACKGROUND256 }#{c.term}" else Formatting::BACKGROUNDS[c.human.to_s] end end # Uh oh :( notation = if !color_fg - "38;0" + TermNotation::NO_FOREGROUND elsif palette.notation palette.notation[0..-2] else nil end @@ -141,10 +144,10 @@ [notation, color_fg, formatting, color_bg].flatten.compact.join(";") else # In cases when a user decided not to provide an argument value in theme, # use default color. Not handling this situation results in CodeRay's # error ("can't convert nil into String" stuff). - "38;0;0" + TermNotation::EMPTY end rescue NoColorError => e Pry.output.puts "#{e}: wrong color value: `#{color}`. Typo?" end