Rainbow library: do not extend String

- do not include all the rainbow presenter methods directly in the
    String class
This commit is contained in:
Olle Jonsson 2016-09-01 11:15:22 +02:00 committed by James Casey
parent 7e77fd6c57
commit b259b186a7

View File

@ -1,5 +1,5 @@
require "logger" require "logger"
require "rainbow/ext/string" require "rainbow"
module GitHubChangelogGenerator module GitHubChangelogGenerator
module Helper module Helper
@ -16,11 +16,11 @@ module GitHubChangelogGenerator
@log.formatter = proc do |severity, _datetime, _progname, msg| @log.formatter = proc do |severity, _datetime, _progname, msg|
string = "#{msg}\n" string = "#{msg}\n"
case severity case severity
when "DEBUG" then string.color(:magenta) when "DEBUG" then Rainbow(string).magenta
when "INFO" then string.color(:white) when "INFO" then Rainbow(string).white
when "WARN" then string.color(:yellow) when "WARN" then Rainbow(string).yellow
when "ERROR" then string.color(:red) when "ERROR" then Rainbow(string).red
when "FATAL" then string.color(:red).bright when "FATAL" then Rainbow(string).red.bright
else string else string
end end
end end